我正在寻找要导入我的软件的jar库。我使用ups的Shipping_Pkg_Gnd.zip作为弹簧板来提供运输标签生成。但是,他们没有在他们提供的任何示例代码中提供.jar库。有谁知道从哪里获得这个图书馆。
以下是无效的导入,因为我没有所需的开发人员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.ship.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;
答案 0 :(得分:4)
我有类似的问题,解决方法是使用wsimport.sh从wsdl生成jar / class文件。
所以你必须将以下六个文件复制到同一个文件夹
$ 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
生成的代码:
$ 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
现在,您可以将所有* .class文件放在一个包中,并在项目中使用它:
$jar cvf com_ups_wsdl_xoltws_ship_v1.jar ./com/ups/wsdl/xoltws/ship/v1/*.class
你的新罐子:
$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