Unable to import WSDL in to Visual Studio 2012 - web-services

Trying to integrate with a PHP SOAP-based web service. The client has given me a URL to a WSDL file which seems to confirm to the W3C Standard for WSDL.
I'm using the Add Web Reference option in the Advanced Dialog to add the reference. When I add the URL, the web browser in the dialog box displays the two methods in the WSDL specification, but there is an error message in the status area on the right, and the Add Reference button is disabled.
Error message:
The document at the url http://www.NAMEHERE.com/NAME/xml/test.php?wsdl was not
recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'XML Schema' is 'The root element of a W3C XML Schema should be <schema> and its nam
If I run the WSDL through an online WSDL validator, it seems right and, like I say, it does appear to conform to standards.
In addition, I've tried using the the WSDL.EXE command-line and tried SOAP, SOAP12, HTTPGET and HTTPPOST protocols, each time getting the same error message.
WSDL Excerpt here:
<?xml version="1.0" encoding="ISO-8859-1"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://www.NAMEHERE.com/NAME/xml/namespace"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://www.NAMEHERE.com/NAME/xml/namespace">
<types>
<xsd:schema targetNamespace="http://www.NAMEHERE.com/NAME/xml/namespace">
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/"/>
<xsd:complexType name="AddressWO">
....
The cilent says that they haven't experienced this issue with any other partners, who are all able to integrate successfully. Albeit, they are PHP to PHP.
I've searched SO and am unable to find the same issue explicity (or any suitable answer).
Any ideas?

After spending a fair amount of time on this, it turns out that the WSDL wasn't perfect afterall. Our business partner needed to make a couple of minor corrections to the WSDL before Visual Studio could import it.
The issue was that they had a minOccurs attribute on an element, which was invalid in that scenario.
The thing to note here is that several online validators said the WSDL was valid, as do the PHP clients we tried.
Then, we used the WLIMPORT program within JDK 1.6+ and this gave a very detailed list of errors in the WSDL, pointing to the exact cause of the issue.
So, our business partner corrected the specification at their end and now Visual Studio imports the WSDL successfully.
Hope this helps.

Related

Need IBM Websphere jax ws webservices.xml and web.xml file

I don't have the sample webservices.xml and web.xml file. Can some one help by providing a complete example? I'm using Web Sphere JAX-WS implementation. WAS 7.x version. JDK 1.6.
I tried setting "UseWSFEP61ScanPolicy: true" in MANIFEST.MF file, for automated annotation scanning (instead of webservices.xml and web.xml file usage), but it is working first time, and after deploying a dynamic patch it doesn' works. The services listed under "services" category of IBM Console is having question mark instead of green arrow. Also some times the services even not listed in "services" category.
I'm using web module version 2.3, so i've to enable automated scanning. I'm not using EJB for web service.
I've decided to use webservices.xml and web.xml due to not much help in annotation scanning. I hope for webservices.xml and web.xml not need to install and reinstall the application EAR in WebSphere. In the case of annotation scanning reinstall is needed.
PLEASE IBM WEB SITE DOESN'T HELP MUCH!!!
Here's a web.xml I've used. Since it's "empty", the default rules for mapping annotated webservice classes to URL's apply, approximately, URL = name of class + "Service".
webservices.xml is not needed.
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
<display-name>wsfp_hello_svc</display-name>
</web-app>
Check SystemOut.log to find the URL of your service, look for something like this:
WSWS7037I: The /HelloService URL pattern was configured for the example.HelloDelegate servlet
If you don't like the default mappings, then you can map your webservice class to a different URL in web.xml just like you would do with a servlet.

Creating Web Service Reference in Visual Studio to PayPal SOAP API

I am trying to update an existing system to use a WCF Web Service reference for its PayPal SOAP API proxy classes.
According to this API documentation, the proper WSDL URL is the following:
https://www.paypal.com/wsdl/PayPalSvc.wsdl
I have tried using the Add Service Reference dialog in Visual Studio, and also the svcutil command. This can be reproduced (for me) in a new console application project, or really any type of project. In all cases, I get the following errors.
There was an error downloading 'https://www.paypal.com/wsdl/PayPalSvc.wsdl/_vti_bin/ListData.svc/$metadata'.
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'https://www.paypal.com/wsdl/PayPalSvc.wsdl'.
The content type text/plain of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
ns:version="204.0"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
(removed the rest of the beginning of the wsdl file)
I don't understand why there are non-resolved references, or why a content type mismatch would cause the process to fail.
Any ideas or even sharing your repro results would be helpful.
There are 3 XSDs referenced by the WSDL which are available at the following URLs-
eBLBaseComponents.xsd
CoreComponentTypes.xsd
EnhancedDataTypes.xsd
Download the WSDL and the 3 xsds into a folder locally on your machine and add a reference to this local copy of the WSDL. It should work

Intercept SOAP request

I know this might sound like a duplicate but despite the number of result for this research, I couldn't manage to find a working answer..
I'm using a Java Web service built with Axis (the first one), running on Tomcat v5.5 and a .Net client with some Web reference (not the service reference).
What I want to do is to have a look on the outgoing request from my client, the soap enveloppe.
So far, I tried to use soapUI, great tool, helped me a lot for other thing, but the structure of my web service is quite complexe (array of complexe datatypes) so I have no idea on how I could give him some parameters, here is an exemple of the generated request :
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.main.gimaweb.itrec.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<web:televerserDocument soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<wsi xsi:type="urn:DocumentWSI" xmlns:urn="urn:DocumentWS">
<version xsi:type="xsd:string">?</version>
<documents xsi:type="doc:ArrayOf_tns1_DocumentWVO" soapenc:arrayType="urn:DocumentWVO[]" xmlns:doc="adress"/>
</wsi>
</web:televerserDocument>
</soapenv:Body>
</soapenv:Envelope>
But what i need is an array with data, so there is a lot of xml tag missing for that purpose. Maybe there is a way to generate a more complete sample request? (I don't know if I'm clear enough).
I also tried to use Fiddler, also a great tool but I never managed to get the soap enveloppe, I just got the WSDL from when I update the web reference.
I tried different kind of adresses like :
localhost:port
localhost.:port
ipv4.fiddler:port
hostname:port
But I guess the adress isn't the origin of the problem, I also used ISS Express instead of Visual Studio development server.
Finally, I tried to use some software named Membrane Moniter, but no way to get it, it's becoming quite old, maybe someone knows an alternative
Does someone have a clue on how to do this?
EDIT: And I also tried to use the TCP/IP Monitor on server side, but onece again, I only get the WSDL from the update on VS's side.. I do not really understand why.
EDIT: My Java Webservices are running on Tomcat v5.5, my ASP.Net client is a web application running on IIS Express

What is the XML format for an item for the Sitecore Webservice

I am trying to use the built in web service in Sitecore 6.5 (.../sitecore/shell/webservice/service.asmx)
There is PDF that describes the commands, but it does not specify the format for inserting/updating items. It claims one can simply use the format when doing a GetXml request, but I have found that not to be true from my testing.
I have tried a number of variations, both trying with an or just single fields as suggested by this blog, with no luck and unfortunately the webservice does not complain about the input, it always responds "OK" with no effect.
The full request (as what I am looking at now)
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<Save xmlns="http://sitecore.net/visual/">
<xml>
<sitecore>
<field itemid="{7CCE4419-E8BD-45F4-9B9C-625E220C59A1}"
fieldid="{3F4B20E9-36E6-4D45-A423-C86567373F82}"
language="en"
version="1">
<content>A title from service</content>
</field>
</sitecore>
</xml>
<databaseName>master</databaseName>
<credentials><!-- removed --></credentials>
</Save>
</soapenv:Body>
If anyone knows what the format is that would be great.
If you are using Sitecore 6.5 then you can use the Item Web API, this should give you access to everything you need via JSON REST services.
There was a great response from Kevin Obee with further links, but also have a read of the following:
Sitecore Item Web API and Json.Net Test Drive
New features in Sitecore 6.6 – Webinar
I normally write my own webservice if I want to do some modifications to Sitecore items and found it a much more flexible way because I mostly want at least just a bit more functionality then the standard webservice has to offer. But be aware that you cannot serialize the Sitecore.Data.Items.Item class so sending an Item object through Soap is not going to work.

Authenticating Office 365 SharePoint Online OOTB services

I want to consume SharePoint data into a non .Net platform. I already use the SharePoint OOTB services like Lists.asmx, Webs.asmx and search.asmx for this purpose.
I have successfully added support for forms based authentication using Authentication.asmx.
Now, I want to provide support for Office 365 SharePoint online. For that purpose I have a demo SharePoint Online site that I am working on.
Problem, I am facing is when I use Mode method of Authentication.asmx I get ‘Forms’ in response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ModeResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<ModeResult>Forms</ModeResult>
</ModeResponse>
</soap:Body>
</soap:Envelope>
However when I use Login.asmx and pass correct username and password, I get ‘PasswordNotMatch’ error, the same credentials are working fine in browser.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<LoginResponse xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<LoginResult>
<ErrorCode>PasswordNotMatch</ErrorCode>
<TimeoutSeconds>0</TimeoutSeconds>
</LoginResult>
</LoginResponse>
</soap:Body>
</soap:Envelope>
Note:- This works perfect for a FBA non Office 365 SharePoint site.
Could somebody please help me in implementing the support for Office 365 SharePoint Online OOTB services?
I've been looking into a similar idea and this thread has been extremely helpful. They actually have a webservice sample using the PInvoke, it might help you get there.
Edit: my search led me to this other post by Wictor Wilen, but trying to avoid the ClientOM for now.
Edit2: alright, got this working. Using the code from Wictor above, I downloaded his sample solution and moved "MsOnlineClaimsHelper.cs" and "WcfClientContracts.cs" to my project, I will be fiddling with what is really used from these files later. I only changed them to remove the ClientOM references including the clientContext_ExecutingWebRequest method.
In a sample MVC3 app or Console app:
MsOnlineClaimsHelper claimsHelper = new MsOnlineClaimsHelper("https://my365site.sharepoint.com/sites/enterprise/", "admin#my365site.onmicrosoft.com", "secret");
using (var lists = new SharePointLists.Lists())
{
lists.Url = #"https://my365site.sharepoint.com/sites/enterprise/_vti_bin/lists.asmx";
lists.CookieContainer = claimsHelper.CookieContainer;
var listCol = lists.GetListCollection();
ViewBag.Message = listCol.InnerXml;
//Console.Write(listCol.InnerXml);
}