PHP SOAP Object引用未设置为对象的实例

时间:2017-02-08 16:08:45

标签: php soap

我正在尝试连接的服务是与AS-Trade进行通信的Web服务程序。以下是XML格式的输入数据结构

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/ITradeService/CreateInternalMoveDoc</Action>
 </s:Header>
 <s:Body>
<CreateInternalMoveDoc xmlns="http://tempuri.org/">
  <sessionId>496378b6-1f45-4720-8fa1-a2976eaa9523</sessionId>
  <seqNumber>2</seqNumber>
  <InternalMovDocInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <DocumentNumber>ԱՏՂ154</ DocumentNumber>
    <DocumentDate>2016-02-15T00:00:00</DocumentDate>
    <Comment>Ապրանքների տեղաշարժ կենտրոնական պահեստից</Comment>
    <StorageExpenseCode>00</StorageExpenseCode>
    <StorageIncomeCode>02</StorageIncomeCode>
    <ChiefAccountantFIO />
    <Mediator />
    <Allower />
    <BookNumber />
    <BookPage>0</BookPage>
    <BookRow>0</BookRow>
    <TaxExportType />
    <TaxInvoiceSeries />
    <TaxInvoiceNumber />
    <TaxInvoiceDate i:nil="true" />
    <TransportationMethod />
    <PriceType />
    <BaseISN />
    <Specification>
      <InternalMoveSpecificationRow>
        <ProductCode>1003</ProductCode>
        <UnitCode>001</UnitCode>
        <Quantity>1</Quantity>
        <SalePrice>0</SalePrice>
        <SaleAmount>0</SaleAmount>
      </InternalMoveSpecificationRow>
    </Specification>
  </InternalMovDocInfo>
</CreateInternalMoveDoc>

这是我正在使用的代码:

  protected $_options = array(
  'uri'=>'http://schemas.xmlsoap.org/soap/envelope/',
  'style'=>SOAP_RPC,
  'use'=>SOAP_ENCODED,
  'soap_version'=>SOAP_1_1,
  'cache_wsdl'=>WSDL_CACHE_NONE,
  'connection_timeout'=>15,
  'trace'=>true,
  'encoding'=>'UTF-8',
  'exceptions'=>true,
 );


public function __construct(){
    $this->_client = new SoapClient($this->_url, $this->_options);
}


public function createInternalMoveDoc(){

$CreateInternalMoveDoc = $this->_client->CreateInternalMoveGEDoc(array(
    'sessionId'=> $this->_session,
    'seqNumber' => self::$_seqNumber,
    'InternalMovDocInfo' => array(
      'DocumentDate' => date('c',time()),
      'StorageExpenseCode' => '17',
      'StorageIncomeCode' => '06',
      'Specification' => array (
          'ProductCode' => '00145',
          'UnitCode' => '1',
          'Quantity' => '1',
          'SalePrice' => '0',
          'SaleAmount' => '0'
        )
      )

  ));
  return $CreateInternalMoveDoc;
  }
}

我收到错误:对象引用未设置为对象的实例。

0 个答案:

没有答案