xml - PHP Soap request tag empty -


i'm trying use php soap calls asp.net (i'm pretty sure that's server).

i have issues request being sent. believe important part of wsdl. (note i'm inexperienced soap).

<s:element name="getassetdetails"> <s:complextype> <s:sequence> <s:element minoccurs="1" maxoccurs="1" name="request" nillable="true" type="tns:assetdetailsrequest"/> </s:sequence> </s:complextype> </s:element> <s:complextype name="assetdetailsrequest"> <s:complexcontent mixed="false"> <s:extension base="tns:requestbase"> <s:sequence> <s:element minoccurs="1" maxoccurs="1" name="assetguid" nillable="true" type="s1:guid"/> <s:element minoccurs="1" maxoccurs="1" name="assetid" nillable="true" type="s:int"/> <s:element minoccurs="0" maxoccurs="1" name="assetname" type="s:string"/><s:element minoccurs="1" maxoccurs="1" name="requestedinfos" nillable="true" type="tns:assetinfos"/> </s:sequence> </s:extension> </s:complexcontent> </s:complextype> 

the following xml giving correct response (as test i've overwritten __dorequest , put full xml request)

$request = '<?xml version="1.0" encoding="utf-8"?> <soap12:envelope xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:body>   <getassetdetails xmlns="http://xxxx/...">     <request>       <assetname>arg1</assetname>       <requestedinfos>option1 option2</requestedinfos>     </request>   </getassetdetails> </soap12:body> </soap12:envelope>'; 

so don't need assetguid. seems wsdl says have (however i'm not sure if interpret correctly).

now do:

$ap_param = array(      // 'assetguid' => 'euaudyehdouidfhadhsjlkw', // tried , without this, random value     'assetname'      => 'arg1',     'requestedinfos' => 'option1 option2' ); $info = $soapclient->__call("getassetdetails", array($ap_param)); 

however in xml goes on wire request tag empty:

<?xml version="1.0" encoding="utf-8"?> <soap12:envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:ns1="http://xxx/..." <soap12:body> <getassetdetails>   <request xsi:nil="true"/> </getassetdetails></soap12:body> </soap12:envelope> 

the response is:

<?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <soap:body>   <soap:fault>     <soap:code><soap:value>soap:sender</soap:value></soap:code>     <soap:reason><soap:text xml:lang="en">unable handle request without valid action parameter. please supply valid soap action.</soap:text></soap:reason>     <soap:detail />   </soap:fault> </soap:body> </soap:envelope> 

anyone knows i'm doing wrong request element empty , doesn't hold parameters?

thanks in advance!

it seems soapclient::_call deprecated try use soapclient::_soapcall instead of it. http://www.php.net/manual/en/soapclient.soapcall.php


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -