Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/242.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 为什么在我的SOAP调用中需要字段?_Php_Soap_Soap Client - Fatal编程技术网

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

Php 为什么在我的SOAP调用中需要字段?,php,soap,soap-client,Php,Soap,Soap Client,这是我的WSDL:和相应的文档: 我试图使用SoapClient在PHP中提交CreateOrdersSOAP调用,但它不断告诉我要包含越来越多的字段: Fatal error: SOAP-ERROR: Encoding: object has no 'FulfillmentSalePrice' property FulfillmentSalePrice不是必需的,为什么要我提交 我的电话看起来像: $createOrderArray = array( 'Order' =>

这是我的
WSDL
:和相应的文档:

我试图使用
SoapClient
在PHP中提交
CreateOrders
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);

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


如果您遇到任何其他错误,请告诉我,我们将一起排除故障。

因此,如果我使用WSDL的本地副本,我可以将其设置为“不需要”?根据他们的支持,这不是一个必需的字段,WSDL实际上被用作API端点期望的参考。您可以将
FulfillmentSalePrice
作为空参数添加到$createOrderArray变量中。试一试,让我知道你的进展如何。然后我必须将每个字段都添加为空参数,不是吗?在你的
OrderLineItem
中,为
FulfillmentSalePrice
添加一个新的key=>值对,比如
FulfillmentSalePrice=>'
。我错过什么了吗?据我所知,您需要包括minOccurs=1集的每个属性。