在这里使用API包:https://www.ups.com/gec/techdocs/pdf/Rates_Pkg_Gnd.zip
添加到RateWS.wsdl的引用方式如下:
- 右键单击网站项目 -> 添加服务引用
- 在地址栏中输入:file://C:\Users\MyUser\Desktop\UPS API\RatingPACKAGE\PACKAGEWebServices\SCHEMA-WSDLs\RateWS.wsdl
Visual Studio会添加几个参考文件:
使用提供的API包中的示例代码,将测试代码复制到我的项目中。
问题:未定义“RateService”类。是否缺少引用?
看起来网址引用没有正确添加。RateService类是未知的。谢谢你的帮助。
- 右键单击网站项目 -> 添加服务引用
- 在地址栏中输入:file://C:\Users\MyUser\Desktop\UPS API\RatingPACKAGE\PACKAGEWebServices\SCHEMA-WSDLs\RateWS.wsdl
Visual Studio会添加几个参考文件:
![enter image description here](https://istack.dev59.com/aWAFN.webp)
问题:未定义“RateService”类。是否缺少引用?
![enter image description here](https://istack.dev59.com/QsIa1.webp)