【问题标题】:UPS developer API missing jaUPS 开发人员 API 缺少 ja
【发布时间】:2012-06-02 05:13:30
【问题描述】:

我正在寻找要导入我的软件的 jar 库。我正在使用 ups 的 Shipping_Pkg_Gnd.zip 作为弹簧板来生成运输标签。但是,他们没有在他们提供的任何示例代码中提供 .jar 库。有谁知道在哪里可以得到这个库。

以下是无法使用的导入,因为我没有所需的开发人员 API 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipmentErrorMessage; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.BillShipperType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.InternationalFormType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.LabelImageFormatType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.LabelSpecificationType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.PackageType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.PackageWeightType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.PackagingType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.PaymentInfoType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ProductType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ProductWeightType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.RequestType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ServiceAccessToken_type0; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ServiceType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipAddressType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipFromType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipPhoneType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipToAddressType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipToType; 导入 com.ups.www.wsdl.xoltws.ship.v1_1.ShipServiceStub.ShipUnitOfMeasurementType;

【问题讨论】:

    标签: api jar ups


    【解决方案1】:

    我遇到了类似的问题,解决方法是使用 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-09-09
      • 2017-01-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-25
      相关资源
      最近更新 更多