Re: PHP5 SOAP...
| From: | Tom Rogers | Date: | Tue, 16 Jun 2009 23:06:39 +0000 |
| Subject: | Re: PHP5 SOAP... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-294133@lists.php.net to get a copy of this message | ||
Hi,
Wednesday, June 17, 2009, 1:21:47 AM, you wrote:
RJ> I'm working on a project using SOAP and WS-Security in which I am failing
RJ> miserably.
RJ> Is there a way to inspect the actual XML, header, etc. that is actually
RJ> being sent. I feel like I am constructing the call correctly, and I know
RJ> exactly what needs to be sent, but I dont know how to see exactly what is
RJ> sent - all I get back are useless errors like "not enough information sent",
RJ> etc...
RJ> Any ideas? Any SOAP pros out there?
RJ> Russell Jones
RJ> CTO Virante, Inc.
RJ> russ@virante.com
RJ> 919-459-1035
Not a pro but...
Try something like this:
//object to pass function variables
class requestObject {
function requestObject($list) {
foreach($list as $key=>$val)
$this->$key = $val;
}
}
$client = new SoapClient("wsdl.xml", array('login'=> "login",
'password'=> "password", 'trace'=>true));
$soapstruct = new requestObject(array('clientId'=>12342, 'leagueId'=>0));
//use whatever variables are needed
try {
$info = $client->soapFunction($soapstruct);
echo "REQUEST:\n" . $client->__getLastRequest() . ""<br
/>\n";
print_r($info);
} catch (SoapFault $e) {
echo "SOAP Fault: ".$e->getMessage()."<br />\n";
echo "REQUEST:\n" . $client->__getLastRequest() . ""<br
/>\n";
}
--
regards,
Tom