Php soap client + getting null response
I am trying to call wcf ws from php client
WSDL https://ws-web.test.nhn.no/v1/AR?wsdl
$url = 'https://ws-web.test.nhn.no/v1/AR?wsdl';
$params = array('login' => '*****',
'password' => '######',
'soap_version' => SOAP_1_2,
'trace' => TRUE);
$client = new SoapClient($url, $params);
var_dump($client->__soapCall("Ping"));
With the above code, I always get a response null
and I cannot call other functions fromwsdl
If I try this with a different syntax, sometimes I get action mismatch error
and I also get a response null
in the Soap UI.
+3
source to share
1 answer
Based on WSDL, the Ping function has an input message.
<wsdl:operation name="Ping">
<wsdl:input wsam:Action="http://register.nhn.no/CommunicationParty/ICommunicationPartyService/Ping" message="tns:ICommunicationPartyService_Ping_InputMessage"/>
<wsdl:output wsam:Action="http://register.nhn.no/CommunicationParty/ICommunicationPartyService/PingResponse" message="tns:ICommunicationPartyService_Ping_OutputMessage"/>
</wsdl:operation>
The input message consists of the parameters defined here ...
<wsdl:message name="ICommunicationPartyService_Ping_InputMessage">
<wsdl:part name="parameters" element="tns:Ping"/>
</wsdl:message>
Finally, the Ping object is not like properties. Weird.
<xs:element name="Ping">
<xs:complexType>
<xs:sequence/>
</xs:complexType>
</xs:element>
So give it a try.
$pingObj = new stdClass();
$client->__soapCall("Ping", [$pingObj]);
0
source to share