Reputation: 1452
I am trying to add a web reference hosted by a thrid party to a new project in visual studio 2012. Specifically the UPS API. I have contacted their support and if I receive a response before this question is answered it will be updated.
Now adding a normal web reference I have followed the article at MSDN: How to add a reference to a web service and question here on SO at How to add a Web reference Visual Studio 2012. However for the UPS APIs when following this method, the following error is received:
There was an error downloading 'https://wwwcie.ups.com/webservices/Void/_vti_bin/ListData.svc/$metadata'.
The request failed with HTTP status 404: Not Found.
Now on the UPS Development Community forum, there was a similar question to this available here. However, their solution was to use the sample projects provided by UPS with the web references already in them and edit it. This solution isn't effective if I am to consume the web reference in an existing application.
Additional information, UPS does provide WSDL files in the development package. I'm hesitant to follow the approach of adding them because between development and production, the URLs to the web services change. If this could be a solution, would you mind explaining the life cycle of the WSDL from development and production and how the URLs can be configurable.
UPS Tech Support Response:
Thank you for your inquiry. I apologize for the difficulty you have encountered when attempting to integrate the UPS Developer Kit APIs into your solution.
Due to the many possible programming languages and environments, we do not support client code directly.
For your convenience, UPS provides sample code in each Developer's Kit. These files include code samples in C#, Java, XML, PHP, and Perl, and can be used as an example of how to integrate UPS Developer APIs. No samples other than those provided in the Developer's Kit are available. Please keep in mind that you will need to customize these files to fit your specific needs.
Upvotes: 2
Views: 3255
Reputation: 1482
Though it is old question, I think it will helpful to anyone who stumbles upon same issue again. I have been through the same situation for many hours recently. I tried to add service reference with the end point https://onlinetools.ups.com/webservices/Rate.
Though this url, when browsed in my browser, displays information as mentioned in the developer guide provided by ups, which I can access after I login into their site with my account credentials, it shows error while adding reference - be it service reference or the web reference as mentioned in the question in this post. Seems they are intentionally not providing all essential files that is needed by the service explorer.
Then I hosted the Rate.wsdl file in my localhost and tried to add web service reference. I had forgotten to include all the files (.xsd, .cs etc.) in the same folder as Rate.wsdl. So it showed error. After including all those files in the folder, I could successfully add web service reference.
With it, explorer found the service.
Hope this helps.
Upvotes: 2
Reputation: 1452
My solution was to take the provided WSDL files and use their pathways on my system as the web reference URL. There was a setting automatically added in Project.Properties.Settings for the actual url of the web service.
Upvotes: 3