سؤال

I have a question about php and soap calls. I have to call a soap function with two parameters: sessionId and Targa First I prepared my paramArray like this:

$targaParam = array(
    'sessionId' => $session,
    'Targa' => 'EG031NX'
    );

There was an error, so I read the wsdl:

<s:element name="GetRTCompletoDaTargaMinInfocarList">
   <s:complexType>
      <s:sequence>
         <s:element minOccurs="0" maxOccurs="1" name="sessionId" type="s:string"/>
         <s:element minOccurs="0" maxOccurs="1" name="context" type="tns:RTDaTargaParamContext"/>
      </s:sequence>
   </s:complexType>
</s:element>

So I changed my Array:

$targaParam = array(
    'sessionId' => $session,
    'context' => 'EG031NX'
    );

There was no errors but if I print the result of the call I have an Object reference not set to an instance of an object.

The type of 'context' element is RTDaTargaParamContext, I paste the code:

<s:complexType name="RTDaTargaParamContext">
   <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="Targa" type="s:string"/>
   </s:sequence>
</s:complexType>

I have to change the way of passing parameters to the function?

هل كانت مفيدة؟

المحلول

Solution:

$targaParam = array(
  'sessionId' => $session,
  'context' => array('Targa' => 'EG031NX')
);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top