Creating Web Service Reference in Visual Studio to PayPal SOAP API - web-services

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

Related

Stub client generation Apache CXF

I am seeing one behavior while accessing one wsdl. I used Apache Axis 1.3 as well as JAX-WS wsimport tool to generate client stubs, it is successfully generating stubs.
But when I am using apache-cxf-2.7.18 and using wsdl2java command, it's not generating stubs, giving me error.
WSDL is on https. I added proxy in wsdl2java bat file as well. wsdl contains a which is also on https.
Error I am getting like:
enter image description here
It seems to that it's not able to include underlying wsdl.
Can anybody give me any pointer what I am doing wrong?
I believe, when I am doing any service publishing, it can not be client implementation specific like it is supported by Axis but not CXF. or I can do that? Is there any restriction that could be applied?
(Solution in comments)
The error log shows a connection error when downloading the WSDL, probably due to a misconfiguration of the proxy in wsdl2java when using a SSL connection through maven
Maven is not is not able to download imports using the proxy configuration, since you have downloaded the wsdl, you can also download all referenced url resources to local files and change <wsdl:import location= to use each local file. Use a relative path ./yourfile or a URL format file://path/to/the/file

Generating a WCF client for MODIS Web Service

I want to create a WCF client for MODIS Web Service available on this website: http://daac.ornl.gov/MODIS/MODIS-menu/modis_webservice.html There is a link to WSDL file, which can I use to generate proxy class. The problem is, that this file is somehow malformed, I cannot create clients with .NET tools like Add Service Reference, wsdl.exe or svcutil.exe. When I try to generate proxy class through website, I get following response:
I've tried to download the WSDL file and create proxy class from local copy, but then I've got this error:
These errors are the same for Add Service Reference and for console output of wsdl.exe and svcutil.exe utils. Is there any other way to create a WCF client to this service or is it impossible in .NET?
EDIT-----
I've managed that the problem occurs, becouse the WSDL is in RPC/Endoded standard and .NET tools cannot handle it properly. I've tried to convert it to Document/literal standard but it's still not working. Can somebody look at my WSDL file and check what I have wrong? It's available under this link: https://wklej.to/67rR7
removing wsdl:documentation blocks inside the element
tags helps to generating codes via svcutil.exe or wsdl.exe.
Baseline for this solution
Hopes this helps.

Visual Studio web reference - $metadata vs. ?wsdl

This is a legacy project that I have not touched in a while. Now the web reference is causing me trouble.
I connect to a SOAP service from a Windows Mobile 6 client. When the service host runs locally on my development box, I can point the web reference to it and it will discover the WSDL, i.e. it will attempt to pull the service description by appending ?wsdl to the endpoint URL. I can build the app and connect to the service from the emulator.
I can for some reason not point Visual Studio to the current production environment for discovery. There it appends /$metadata to the URL instead of ?wsdl. The wsdl is there and I can view it in a browser, though. The mobile app is live and has been connecting to the service for years.
The HTML document does not contain Web service discovery information.
There was an error downloading 'https://mysite/myservice.asmx/$metadata'.
The request failed with the error message:
--
<html>
<head>
<title>Request format is unrecognized for
I know that it is not possible to discover a web service on a non-standard port from Visual Studio. Does it not work with SSL, either? How does Visual Studio decide to use either method for discovery?Or do you have any other thoughts?
I still have no clue what's going wrong with your service but I can discover webservices on non standard ports adding the port to the url (and the ?wsdl as well) from within WS
http://10.177.55.13:10321/MyServices/?wsdl
If this doesn't help open the wsdl in your browser. Copy the xml code, paste it into your editor and save it as .wsdl file. In VS use the filename as url for the service.
HTH
Ruediger

Unable to import WSDL in to Visual Studio 2012

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.

Add service reference to ESB toolkit and BizTalk

I have installed BizTalk together with ESB toolkit and ESB services are up and running according to IIS. I want to connect to these services from a simple WinForm application.
When I try to add this service reference in my project in visual studio
localhost/ESB.BizTalkOperationsService/Operations.asmx
I get the following error message:
There was an error downloading 'localhost/ESB.BizTalkOperationsService/Operations.asmx/_vti_bin/ListData.svc/$metadata'.
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'localhost/ESB.BizTalkOperationsService/Operations.asmx'.
The remote server returned an unexpected response: (405) Method Not Allowed.
The remote server returned an error: (405) Method Not Allowed.
If the service is defined in the current solution, try building the solution and adding the service reference again."
I can browse to:
localhost/ESB.BizTalkOperationsService
but not to the service directly:
localhost/ESB.BizTalkOperationsService/Operations.asmx
How do I communicate with this ESB service?
The problem was that the webservice had been incorrectly installed. I managed to fix this problem by unistalling and reinstalling according to this tutorial
http://geekswithblogs.net/BizTalkUnleashed/archive/2012/11/07/biztalk-server-2013-beta-on-windows-8-visual-studio-2012.aspx