printing SOAP response

View: New views
8 Messages — Rating Filter:   Alert me  

printing SOAP response

by Kevin Steves :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there a way to print the SOAP response message in a client (as a
string) for debugging purposes?  I've been digging through the
archives and didn't find anything.  I'm using the service client API.
tcpmon isn't an option because the service is https-only.

Re: printing SOAP response

by Rajika Kumarasiri-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Sat, Sep 5, 2009 at 1:20 AM, Kevin Steves <stevesk@...> wrote:
hi Kevin,
Try  axis2_char_t * axiom_node_to_string(axiom_node_t *, axis2_env_t *);

Is there a way to print the SOAP response message in a client (as a
string) for debugging purposes?  I've been digging through the
archives and didn't find anything.
The samples distribute with the source should help.

-Rajika

 
 I'm using the service client API.
tcpmon isn't an option because the service is https-only.



--
http://wso2.org
http://llvm.org
http://www.minix3.org

Re: printing SOAP response

by Kevin Steves :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Sep 05, 2009 at 01:35:19AM +0530, Rajika Kumarasiri wrote:
: On Sat, Sep 5, 2009 at 1:20 AM, Kevin Steves <stevesk@...> wrote:
: hi Kevin,
: Try  axis2_char_t * axiom_node_to_string(axiom_node_t *, axis2_env_t *);
:
: Is there a way to print the SOAP response message in a client (as a
: > string) for debugging purposes?  I've been digging through the
: > archives and didn't find anything.
:
: The samples distribute with the source should help.

thanks, I've looked at those, and was already using
axiom_node_to_string().  however I'm not seeing an expected element in
the response and I'm not sure why, so I wanted to see the SOAP message
in the client to confirm it's what I think it is.

given the SOAP response message below, I only see publisher-id when
I convert the return node to a string.

output from axiom_node_to_string():

Received OM: <ifmap:publisher-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">10.136.244.254</ifmap:publisher-id>

SOAP response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ifmap:publisher-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">10.136.244.254</ifmap:publisher-id><ifmap:session-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">2093d57c226b0000c9e739fd24169a36</ifmap:session-id></soap:Header><soap:Body><ifmap:publisher-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">10.136.244.254</ifmap:publisher-id><ifmap:session-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">2093d57c226b0000c9e739fd24169a36</ifmap:session-id></soap:Body></soap:Envelope>

Re: printing SOAP response

by Rajika Kumarasiri-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Sat, Sep 5, 2009 at 1:54 AM, Kevin Steves <stevesk@...> wrote:
On Sat, Sep 05, 2009 at 01:35:19AM +0530, Rajika Kumarasiri wrote:
: On Sat, Sep 5, 2009 at 1:20 AM, Kevin Steves <stevesk@...> wrote:
: hi Kevin,
: Try  axis2_char_t * axiom_node_to_string(axiom_node_t *, axis2_env_t *);
:
: Is there a way to print the SOAP response message in a client (as a
: > string) for debugging purposes?  I've been digging through the
: > archives and didn't find anything.
:
: The samples distribute with the source should help.

thanks, I've looked at those, and was already using
axiom_node_to_string().  however I'm not seeing an expected element in
the response and I'm not sure why, so I wanted to see the SOAP message
in the client to confirm it's what I think it is.

given the SOAP response message below, I only see publisher-id when
I convert the return node to a string.

output from axiom_node_to_string():

Received OM: <ifmap:publisher-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">10.136.244.254</ifmap:publisher-id>

This is the correct behaviour. It'll only show the payload.  May be you need to try
axiom_soap_envelope_t *AXIS2_CALL
    axis2_svc_client_get_last_response_soap_envelope(
        const axis2_svc_client_t * svc_client,
        const axutil_env_t * env)  

in client API?

-Rajika

SOAP response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header><ifmap:publisher-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">10.136.244.254</ifmap:publisher-id><ifmap:session-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">2093d57c226b0000c9e739fd24169a36</ifmap:session-id></soap:Header><soap:Body><ifmap:publisher-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">10.136.244.254</ifmap:publisher-id><ifmap:session-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">2093d57c226b0000c9e739fd24169a36</ifmap:session-id></soap:Body></soap:Envelope>



--
http://wso2.org
http://llvm.org
http://www.minix3.org

Re: printing SOAP response

by Kevin Steves :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Sep 05, 2009 at 09:36:53AM +0530, Rajika Kumarasiri wrote:
: On Sat, Sep 5, 2009 at 1:54 AM, Kevin Steves <stevesk@...> wrote:
: > output from axiom_node_to_string():
: >
: > Received OM: <ifmap:publisher-id xmlns:ifmap="
: > http://www.trustedcomputinggroup.org/2006/IFMAP/1
: > ">10.136.244.254</ifmap:publisher-id>
: >
:
: This is the correct behaviour. It'll only show the payload.  May be you need

is payload the SOAP body?  it contains 2 elements.  is it
correct to only see the first with axiom_node_to_string()?

<soap:Body><ifmap:publisher-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">10.136.244.254</ifmap:publisher-id><ifmap:session-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">2093d57c226b0000c9e739fd24169a36</ifmap:session-id></soap:Body>

: to try
: axiom_soap_envelope_t *AXIS2_CALL
:     axis2_svc_client_get_last_response_soap_envelope(
:         const axis2_svc_client_t * svc_client,
:         const axutil_env_t * env)
:
: in client API?

Re: printing SOAP response

by Selvaratnam Uthaiyashankar :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, Sep 5, 2009 at 9:40 PM, Kevin Steves<stevesk@...> wrote:

> On Sat, Sep 05, 2009 at 09:36:53AM +0530, Rajika Kumarasiri wrote:
> : On Sat, Sep 5, 2009 at 1:54 AM, Kevin Steves <stevesk@...> wrote:
> : > output from axiom_node_to_string():
> : >
> : > Received OM: <ifmap:publisher-id xmlns:ifmap="
> : > http://www.trustedcomputinggroup.org/2006/IFMAP/1
> : > ">10.136.244.254</ifmap:publisher-id>
> : >
> :
> : This is the correct behaviour. It'll only show the payload.  May be you need
>
> is payload the SOAP body?  it contains 2 elements.  is it
> correct to only see the first with axiom_node_to_string()?

Normally a SOAP body should have only one element. Having more than
one element cases might not work correctly with many scenarios,
specially security scenarios. Is it a service written by you? Is it
possible to change the service to return only one element (by wrapping
existing 2 elements by another element)?

If that is not possible, can you try axiom_node_get_next_sibling() to
get the next element.

For your original question (how to log soap envelop in the client
side), you can engage logging module and enable log level = debug.
(You can engage it globally by inserting the following line into
axis2.xml)
<module ref="logging"/>

Regards,
Shankar

>
> <soap:Body><ifmap:publisher-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">10.136.244.254</ifmap:publisher-id><ifmap:session-id xmlns:ifmap="http://www.trustedcomputinggroup.org/2006/IFMAP/1">2093d57c226b0000c9e739fd24169a36</ifmap:session-id></soap:Body>
>
> : to try
> : axiom_soap_envelope_t *AXIS2_CALL
> :     axis2_svc_client_get_last_response_soap_envelope(
> :         const axis2_svc_client_t * svc_client,
> :         const axutil_env_t * env)
> :
> : in client API?
>



--
S.Uthaiyashankar
Software Architect
WSO2 Inc.
http://wso2.com/ - "The Open Source SOA Company"

Re: printing SOAP response

by Kevin Steves :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Sep 07, 2009 at 08:17:40AM +0530, Selvaratnam Uthaiyashankar wrote:
: On Sat, Sep 5, 2009 at 9:40 PM, Kevin Steves<stevesk@...> wrote:
: > is payload the SOAP body?  it contains 2 elements.  is it
: > correct to only see the first with axiom_node_to_string()?
:
: Normally a SOAP body should have only one element. Having more than
: one element cases might not work correctly with many scenarios,
: specially security scenarios. Is it a service written by you? Is it
: possible to change the service to return only one element (by wrapping
: existing 2 elements by another element)?

The protocol is not defined by me.  I think this may be the only
response that doesn't have one outer element.

: If that is not possible, can you try axiom_node_get_next_sibling() to
: get the next element.

That works, thanks.

: For your original question (how to log soap envelop in the client
: side), you can engage logging module and enable log level = debug.
: (You can engage it globally by inserting the following line into
: axis2.xml)
: <module ref="logging"/>

That works as well.  Is this documented (just so I know where I
may have missed it)?

Thanks again.

Re: printing SOAP response

by Kevin Steves :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Sep 07, 2009 at 08:17:40AM +0530, Selvaratnam Uthaiyashankar wrote:
: Normally a SOAP body should have only one element. Having more than
: one element cases might not work correctly with many scenarios,
: specially security scenarios.

can you expand on this and the problem scenarios?

it doesn't appear to be a SOAP requirement.

http://www.w3.org/TR/2000/NOTE-SOAP-20000508/

says:

"Immediate child elements of the SOAP Body element MAY be
namespace-qualified."

note 'elements'

thanks.