duankeng1911 2018-12-03 04:46
浏览 50

用php显示我的fedex运输标签

I have never worked with xml and this is my first time working with an api so this is all very new to me. Essentially, I am trying to place my testing information into the FedEx api so it can print out a shipping label. I have no idea on how to save this result into a variable and put it on a clickable link where the user can click on it and it will display a pdf image for them so they can print out this shipping label.

This is my code here:

$path_to_wsdl = $_SERVER['DOCUMENT_ROOT'] . "/dashboard/website/ShipService_v23.wsdl";


$client = new SoapClient($path_to_wsdl, array('trace' => 1));


$request['WebAuthenticationDetail'] = array(
  'ParentCredential' => array (
    'Key' => 'XXXX',
    'Password' => 'XXXX'
  ),
  'UserCredential' => array(
    'Key' => 'XXXX',
    'Password' => 'XXXX'
  )
);

$request['ClientDetail'] = array(
  'AccountNumber' => 'XXXX',
  'MeterNumber' => 'XXXX'
);

$request['Version'] = array(
  'ServiceId' => 'ship',
  'Major' => '23',
  'Intermediate' => '0',
  'Minor' => '0'
);

$request['RequestedShipment'] = array(
  'ShipTimestamp' => '2017-12-14T12:34:56-06:00',
  'DropoffType' => 'REGULAR_PICKUP',
  'ServiceType' => 'STANDARD_OVERNIGHT',
  'PackagingType' => 'FEDEX_BOX',
  'Shipper' => array(
    'AccountNumber' => 'XXXX',
    'Contact' => array(
      'PersonName' => 'Bob Jones',
      'CompanyName' => 'New Company',
      'PhoneNumber' => '555-555-5555',
      'EMailAddress' => 'example@example.com'
    ),
    'Address' => array(
      'StreetLines' => '1202 Chalet Ln',
      'City' => 'Harrison',
      'StateOrProvinceCode' => 'AR',
      'PostalCode' => '72601',
      'CountryCode' => 'US'
  )
),

'Recipient' => array(
  'AccountNumber' => 'XXXX',
  'Contact' => array(
    'PersonName' => 'My Name',
    'CompanyName' => 'Another Company',
    'PhoneNumber' => '555-555-5555',
    'EMailAddress' => 'another@example.com'
  ),
  'Address' => array(
    'StreetLines' => '123 Test St',
    'City' => 'Test City',
    'StateOrProvinceCode' => 'CA',
    'PostalCode' => '12345',
    'CountryCode' => 'US'

)),
'ShippingChargesPayment' => array(
  'PaymentType' => 'SENDER',
  'Payor' => array(
    'ResponsibleParty' => array(
      'AccountNumber' => 'XXXX',
      'Contact' => array(
      'PersonName' => 'My Name',
      'EMailAddress' => 'another@example.com'
      )
    )
  )
),
'LabelSpecification' => array(
  'LabelFormatType' => 'COMMON2D',
  'ImageType' => 'ZPLII',
  'LabelStockType' => 'STOCK_4X6.75_LEADING_DOC_TAB',

  'CustomerSpecifiedDetail' => array(
    'DocTabContent' => array(
      'DocTabContentType' => 'CUSTOM',
      'Zone001' => array(
        'DocTabZoneSpecifications' => array(
          'ZoneNumber' => '201',
          'Header' => 'rapidum iaculata',
          'DataField' => 'Premere et',
          'LiteralValue' => 'Insuper altos',
          'Justification' => 'LEFT'

        )
      )
    ),

    'CustomContentPosition' => 'BELOW',
    'CustomContent' => array(
      'CoordinateUnits' => 'PIXELS',
      'GraphicEntries' => array(
        'Position' => array(
          'X' => '200',
          'Y' => '3'
        ),

        'PrinterGraphicId' => 'aeoliam venit',
        'FileGraphicFullName' => 'altos imposuit regemque'
      ),

      'BoxEntries' => array(
        'TopLeftCorner' => array(
          'X' => '200',
          'Y' => '3'
        ),

        'BottomRightCorner' => array(
          'X' => '200',
          'Y' => '3'
        )),

        'TextBoxEntries' => array(

          'TopLeftCorner' => array(
            'X' => '200',
            'Y' => '3'
          ),

          'BottomRightCorner' => array(
            'X' => '200',
            'Y' => '3'
          ),

        'Position' => array(
          'X' => '200',
          'Y' => '3'
        ),

        'Format' => 'profundum quippe',
        'DataFields' => 'premit ac vinclis',
        'ThermalFontId' => 'lunctantis ventos',
        'FontName' => 'luctantis ventos tempestateque',
        'FontSize' => '201',
        'Rotation' => 'NONE'
      ),

      'BarcodeEntries' => array(
        'Position' => array(
          'X' => '200',
          'Y' => '3'
        ),

        'Format' => 'altos imposuit',
        'DataFields' => 'sonoras imperio premit',
        'BarHeight' => '3',
        'ThinBarWidth' => '3',
        'BarcodeSymbology' => 'CODE128C'
      )

    )
  )
  ),
  'RateRequestTypes' => 'LIST',
  'PackageCount' => '1',
  'RequestedPackageLineItems' => array(
    'SequenceNumber' => '1',
    'Weight' => array(
    'Units' => 'LB',
    'Value' => '40'
  ),
  'Dimensions' => array(
    'Length' => '5',
    'Width' => '5',
    'Height' => '5',
    'Units' => 'IN',

  ),
  'PhysicalPackaging' => 'BAG',
  'ItemDescription' => 'Phone',
  'CustomerReferences' => array(
    'CustomerReferenceType' => 'CUSTOMER_REFERENCE',
    'Value' => 'NAFTA_COO'
    )
  )


);

Thanks.

展开全部

  • 写回答

0条回答 默认 最新

      编辑
      预览

      报告相同问题?

      悬赏问题

      • ¥20 流量太费!寻找便宜的app音视频SDK或平替方案。
      • ¥15 kubeasz部署遇到问题
      • ¥15 GUIDE to App Designer Migration Tool for MATLAB
      • ¥50 第三代非支配排序遗传算法(NSGA-Ⅲ)和多目标粒子群优化算法(MOPSO)的实现
      • ¥15 hbuilderx写一个这个网页🙏
      • ¥20 plant simulation与python com接口实时数据交互
      • ¥15 有关汽车的MC9S12XS128单片机实验
      • ¥15 求c语言动态链表相关课程有偿,或能将这块知识点讲明白
      • ¥15 FLKT界面刷新异常
      • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
      手机看
      程序员都在用的中文IT技术交流社区

      程序员都在用的中文IT技术交流社区

      专业的中文 IT 技术社区,与千万技术人共成长

      专业的中文 IT 技术社区,与千万技术人共成长

      关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

      关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

      客服 返回
      顶部