Howto reference Application Specific elements from client

From: Date: Sun, 31 Jan 2010 16:51:08 +0000
Subject: Howto reference Application Specific elements from client
Groups: php.soap 
Request: Send a blank email to php-soap+get-3041@lists.php.net to get a copy of this message
Hi All, I need my soap request to look like this: <?xml version='1.0' encoding='UTF8'?>< soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><tns:MyCall xmlns:tns="my.sx"><tns:op>getMyInfo</tns:op><tns:args /></tns:MyCall></soapenv:Body></soapenv:Envelope> I can connect to the server using try { $client = new SoapClient(null, array( 'trace' => $trace_on, 'connection_timeout' => 5, 'soap_version' => SOAP_1_1, 'exceptions' => 0, 'location' => $hostname, 'uri' => 'urn:MyURN', 'style' => SOAP_DOCUMENT, 'use' => SOAP_ENCODED )); } catch (SoapFault $exception) { echo 'ERROR CreateSoapClient faultcode: ' . $exception->faultcode . 'faultstring: ' . $exception->faultstring . '<br>'; } if ($trace_on == 1) { echo 'CreateSoapClient<br>'; viewArray($client); } But using $client->__soapCall, I don't know how to get the namespace "tns:MyCall" to show in the body. Also I need the two elements tns:op and tns:args to show, along with the actual variables (op is MyInfo in above example, args is null). I think I need to override the __doRequest method, but I have not been able to get it to work. Can anyone point me in the right direction? Many thanks for taking a look! Any suggestions would be greatly appreciated. best regards, Bill

« previous php.soap (#3041) next »