开发者

UPS developer API missing ja

开发者 https://www.devze.com 2023-01-12 13:00 出处:网络
I am looking for what jar library to import into my software. I am using ups\'s Shipping_Pkg_Gnd.zip for a spring board to provide shipping label generation. However they did not provide a .jar librar

I am looking for what jar library to import into my software. I am using ups's Shipping_Pkg_Gnd.zip for a spring board to provide shipping label generation. However they did not provide a .jar library in any of sample code that they provide. Does anyone know where to get this library.

Here are the imports that will not work because I do not have the required developer API import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipmentErrorMessage; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.BillShipperType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.InternationalFormType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.LabelImageFormatType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.LabelSpecificationType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.PackageType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.PackageWeightType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.PackagingType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.PaymentInfoType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ProductType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ProductWeightType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.RequestType; import com.ups.www.wsdl.xoltws.sh开发者_StackOverflow社区ip.v1_1.ShipServiceStub.ServiceAccessToken_type0; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ServiceType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipAddressType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipFromType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipPhoneType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipToAddressType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipToType; import com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipUnitOfMeasurementType;


I had the similar issue, and the solution is to use wsimport.sh to generate the jar/class files from the wsdl.

So you have to copy the following six files to the same folder

$ mkdir ups_ship && cd ups_ship
$ ls -1
common.xsd
Error1.1.xsd
IFWS.xsd
ShipWebServiceSchema.xsd
Ship.wsdl
UPSSecurity.xsd
$ wsimport.sh -verbose -keep -extension -target 2.0 Ship.wsdl

Generated code:

$ ls -1 com/ups/wsdl/xoltws/ship/v1/
ShipAcceptErrorMessage.class
ShipAcceptErrorMessage.java
ShipConfirmErrorMessage.class
ShipConfirmErrorMessage.java
ShipmentErrorMessage.class
ShipmentErrorMessage.java
ShipPortType.class
ShipPortType.java
ShipService.class
ShipService.java

Now you can put all your *.class files in a package and use it in your project:

$jar cvf com_ups_wsdl_xoltws_ship_v1.jar ./com/ups/wsdl/xoltws/ship/v1/*.class

Your new jar:

$jar tf com_ups_wsdl_xoltws_ship_v1.jar
META-INF/
META-INF/MANIFEST.MF
com/ups/wsdl/xoltws/ship/v1/ShipAcceptErrorMessage.class
com/ups/wsdl/xoltws/ship/v1/ShipConfirmErrorMessage.class
com/ups/wsdl/xoltws/ship/v1/ShipmentErrorMessage.class
com/ups/wsdl/xoltws/ship/v1/ShipPortType.class
com/ups/wsdl/xoltws/ship/v1/ShipService.class
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号