I have a C# ASP.NET that site I am trying to add UPS quoting to. I used the code from the sample and have imported the included WSDL, all of the objects map out properly to the wsdl except the RateService class.
This is the code sample and WSDL that I am working from.
This is the code snippet that has an error:
RateService rate = new RateService();
RateRequest rateRequest = new RateRequest();
UPSSecurity upss = new UPSSecurity();
The compile error is that RateService is not found.
I am pretty sure the WSDL is importing because the rest of the classes compile just fine. Did UPS change their API since the sample? Anyone have any ideas?
Your WSDL file has this block:
It looks like the
RateServiceserice is defined. Are you sure it imported correctly?The sample code (in your zip) also shows the generated web reference – it has a
RateServiceclass.To add this reference to your project, go to
Add Service Reference, selectAdvancedon the botton of the dialog and then selectAdd Web Referenceon the bottom of the second dialog. Enter the URL to the WSDL file and then add the reference.Make sure you add the correct
usingstatements to your code files to use the types from the WSDL.(This is both for VS 2008 and VS 2010.)