I am trying to re-create the Rate
code sample from the current UPS Developer's Kit on .Net 5. The code sample is based on .NET Framework 4.5.
I imported the Rates_Pkg_Gnd\RatingPACKAGE\PACKAGEWebServices\SCHEMA-WSDLs\RateWS.wsdl
into a completely new .NET 5 Console project as a WCF Web Service (Visual Studio 2019).
I then copied the code from the code sample exactly line-by-line. Visual Studio added a reference to the imported Web Service. However, the very first line of code is not found in the new Web Service:
RateService rate = new RateService();
I contacted UPS Developer Support but "they do not help with coding". Has RateService
been renamed or Is there a replacement in the new schema?
If you are using WCF then it is called RatePortTypeClient
. Or if you choose to use a Web Reference it is called RateService
. You should also add a using [your reference name] to your code. Picture below shows ServiceReference1
- as a WCF. And RateWebReference
as a Web Reference.