dongyipa0028 2017-02-08 16:08
浏览 112

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

The service I'm trying to connect to is the Web-service program to communicate with AS-Trade. Below is the structure of the input data in the XML format

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

Here's the code I'm using:

  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;
  }
}

I got the error: Object reference not set to an instance of an object.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
    • ¥15 下图接收小电路,谁知道原理
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭