快递发货php,用php显示我的联邦快递发货标签

我从未使用过XML,这是我第一次使用API,所以这对我来说是非常新的。本质上,我试图将我的测试信息放入联邦快递api中,这样它就可以打印出运输标签我不知道如何将这个结果保存到一个变量中,并把它放在一个可点击的链接上,用户可以点击它,它会为他们显示一个pdf图像,这样他们就可以打印出这个发货标签。

这是我的代码:

$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'

)

)

);

谢谢。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值