2

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.

Community
  • 1
  • 1
Oxymoron
  • 1,380
  • 2
  • 19
  • 47
  • I assume that you've registered, and requested an access key as outlined in their [developer kit](https://www.ups.com/upsdeveloperkit?loc=en_US)? – crthompson Aug 26 '13 at 22:09
  • The difference between the development and production WSDL's is that the development do not actually execute anything. Its strictly for testing. You can make the URL's configurable by setting them up as dev and release in your app.config – crthompson Aug 26 '13 at 22:10
  • Yes I have registered, and building the sample code using my access keys work fine. The issue is adding a web reference to an existing project. – Oxymoron Aug 26 '13 at 22:11
  • @paqogomez UPS provides a "Customer Integration Environment" for using with testing and development. development WSDL's will still make calls to their services. – Oxymoron Aug 26 '13 at 22:12
  • Did you attempt to use "Add Service Reference"? "Add Web Reference" uses the legacy "ASMX" technology which is not intended for new development. – John Saunders Aug 26 '13 at 23:18
  • I did, this isn't a .NET web service, visual studio is unable to automatically pull the wsdl file from the service. I am developing a new application which consumes the service. "Add Service Reference" isn't an option. – Oxymoron Aug 27 '13 at 06:11

2 Answers2

3

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.

Oxymoron
  • 1,380
  • 2
  • 19
  • 47
2

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.

enter image description here

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.

enter image description here

With it, explorer found the service.

enter image description here

Hope this helps.

Sangam Uprety
  • 1,482
  • 2
  • 20
  • 38