为什么我的SOAP调用中需要字段?

时间:2013-07-29 20:01:02

标签: php soap soap-client

这是我的WSDLhttps://secure-wms.com/webserviceexternal/contracts.asmx?WSDL以及相应的文档:http://app02.3plcentral.com/WebServiceExternal/Contracts.asmx?op=CreateOrders

我正在尝试使用CreateOrders在PHP中提交SoapClient SOAP调用,但它一直告诉我要包含越来越多的字段:

Fatal error: SOAP-ERROR: Encoding: object has no 'FulfillmentSalePrice' property

FulfillmentSalePrice不是必需的,为什么要让我提交?

我的电话如下:

$createOrderArray = array(
  'Order'    =>  array(
    'TransInfo'       =>  array(
      'ReferenceNum'    =>  '123',
      'PONum'           =>  '1234',
      'EarliestShipDate' => time(),
      'ShipCancelDate' => time() + 60000,
    ),
    'ShipTo'          =>  array(
      'Name'            =>  "John Smith",
      'Address'         =>  array(
        'Address1'        =>  '123 Main Street',
        'Address2'        =>  '',
        'City'            =>  'Monroe',
        'State'           =>  'NJ',
        'Zip'             =>  '08831',
        'Country'         =>  'USA',
      ),
      'PhoneNumber'   =>  '732-1234-2408',
      'EmailAddress1' =>  'email@address.com',
      'CustomerName'  =>  'John Smith',
      'RetailerID'    =>  ''
    ),
    'ShippingInstructions'  =>  array(
      'Carrier'               =>  "USPS",
      'Mode'                  =>  "First Class Mail",
      'BillingCode'           =>  "Prepaid"
    ),
    'PalletCount'     =>  1,
    'Notes'           =>  '',
    'OrderLineItems'  =>  array(
      'OrderLineItem'   =>  array(
        'SKU'             =>  "1234",
        'Qualifier'       =>  '',
        'Qty'             =>  1,

        'Packed'          =>  '',
        'CuFtPerCarton'   =>  '',
        'ExpirationDate'   =>  '',
      )
    )
  ),
);


$session = $client->CreateOrders($extLoginData, $createOrderArray);

1 个答案:

答案 0 :(得分:1)

FulfillmentSalePrice在wsdl中设置了minOccurs="1",因此是必需的。

如果您遇到任何其他错误,请告诉我们,我们会一起排查问题。