Re: WS-Security and SOAP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Russell Jones wrote:
Thanks for the tip - I am actually running SOAPui which has been very helpful. The problem is that I dont know how to see what PHP is sending. I feel like I am setting everything up correctly, but then I get these meaningless-to-my-newbie-self messages. I wish there were a way to just do something like echo $soapClient->rawxml; that would just print out exactly what you are about to send the SOAP service, just like I can click on the raw XML tab on SOAPui... Then I could compare the two.

Im about to get to the point though where Im just gonna have to pay someone to figure out the authentication part, project is getting too delayed on this one bug.

do the following to debug the input and output:

try {

$client = new SoapClient("http://WSDL_URL";, array("trace" => true, "exceptions" => true, 'soap_version' => SOAP_1_1));


       // Do your SOAP call here

	echo("<br />REQUEST :<br />" . htmlspecialchars($client->__getLastRequest()) . "<br />");
	echo("<br />RESPONSE:<br />" .htmlspecialchars($client->__getLastResponse()) . "<br />");

}
catch (SoapFault $ex)
{
	echo "Error:<br />" . nl2br($ex->faultcode) . '<br /><br />Error Details:<br />'. nl2br($ex->faultstring) . '<br />';
	
	echo("<br />REQUEST :<br />" . htmlspecialchars($client->__getLastRequest()) . "<br />");
	echo("<br />RESPONSE:<br />" .htmlspecialchars($client->__getLastResponse()) . "<br />");	
}


Please CC the mailing list in your responses.

cheers,
Jeffery

Russell Jones
CTO Virante, Inc.
russ@virante.com <mailto:russ@virante.com>
919-459-1035


On Tue, Jun 16, 2009 at 9:40 PM, Jeffery Fernandez <jeffery@ivt.com.au <mailto:jeffery@ivt.com.au>> wrote:

    Russell Jones wrote:

        I am running into a persistent issue trying to
        authenticate/consume a SOAP
        service. I am pretty new to this, especially WS-Security...

        I am sending the following WS-Security header as I can tell,
        but I am
        getting the response "Not enough message parts were received
        for the
        operation", which seems to me about the most useless
        fault/error response I
        have ever received :) I am using the WSSecurity.class.php found on
        phpclasses.org <http://phpclasses.org> to help with the
        WS-Security

        Anyway, there are a couple of questions that could help...

        1. Is there a way to see the raw SOAP call that was sent?
        envelope, headers,
        body and all? That way I could compare it with what I know to
        be a correct
        call.
    Search for a tool called SoapUI. It will help you analyse the raw
    soap data.

    cheers,
    Jeffery

        2. Is there anything obvious that I am missing, or not so obvious?
        3. How over my head am I?

        THANKS!!!

        /// HEADER SENT ///

        <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="
        http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
        ">
        <wsse:UsernameToken wsu:Id="UsernameToken-6482120" xmlns:wsu="
        http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
        ">
        <wsse:Username>***</wsse:Username>
        <wsse:Password Type="
        http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText
        ">****</wsse:Password>
        <wsse:Nonce>GDZAIHA=</wsse:Nonce>
        <wsu:Created xmlns:wsu="
        http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
        ">2009-06-16T15:26:25Z</wsu:Created>
        </wsse:UsernameToken>
        </wsse:Security>
        <customerId
        xmlns="http://echo.ws.smi.fsecure.com";>***</customerId>

        ///

        Fatal error: Uncaught SoapFault exception: [soap:Client] Not
        enough message
        parts were received for the operation. in
        /var/www/html/soap/WSSecurity.class.php:70 Stack trace:

        #0 /var/www/html/soap/WSSecurity.class.php(70):
        SoapClient->__soapCall('sendEcho', Array, NULL,
        Object(SoapHeader))
        #1 /var/www/html/soap/echo.php(26):
        WSSoapClient->__soapCall('sendEcho',
        Array)
        #2 /var/www/html/soap/soap-client.php(7):
        include('/var/www/html/s...')
        #3 {main} thrown in /var/www/html/soap/WSSecurity.class.php on
        line 70



        Russell Jones
        CTO Virante, Inc.
        russ@virante.com <mailto:russ@virante.com>
        919-459-1035



-- Internet Vision Technologies
    Level 1, 520 Dorset Road
    Croydon South
    Victoria 3136
    Phone: +61 3 9723 9399


-- PHP Soap Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php




--
Internet Vision Technologies
Level 1, 520 Dorset Road
Croydon South
Victoria 3136
Phone: +61 3 9723 9399


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux