Re: [PHP] PHP5 SOAP...

[email protected] (Tom Rogers)
Newsgroups php.general
Organization Perfect Web Site Designs
Message-ID <[email protected]>
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> [email protected]
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.