You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Je...@cox.com on 2009/03/03 22:48:00 UTC

Logging/Debugging Question

To All,

I have enabled Log4j logging in my CXF application which works nicely. As you can see below the logging is working and I can see my inbound and outbound SOAP messages.

I don't see a unique message ID in the SOAP messages that would tie the response to the request.

Is there a unique "id" in the request message that is returned in the response message that I can use to tie the response to a specific request.
Maybe I am just not showing it in my log file. I see the wsu:Id="UsernameToken-23612966" which might be unique for the request but the SOAP header is not in the response.

Any thoughts are gratefully appreciated.

Thanks,

Jeff


LOG SAMPLE:

13:11:36,540 INFO LoggingInInterceptor:132 - Inbound Message
----------------------------
Encoding: UTF-8
Headers:
{content-length=[1031], connection=[keep-alive],
cache-control=[no-cache], host=[localhost:8080],
user-agent=[Java/1.5.0_16], SOAPAction=[""], pragma=[no-cache],
content-type=[text/xml; charset=UTF-8], Accept=[*]}
Messages:
Message:

Payload:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
                <wsse:Security
                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                        soap:mustUnderstand="1">
                        <wsse:UsernameToken
                                xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
                                wsu:Id="UsernameToken-23612966">
                                <wsse:Username
                                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">xxxxx</wsse:Username>
                                <wsse:Password
                                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                                        Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxx</wsse:Password>
                        </wsse:UsernameToken>
                </wsse:Security>
        </soap:Header>
        <soap:Body>
                <ns2:addCustomer xmlns:ns2="http://server.cxf.asi.cox.com/">
                        <arg0>
                                <name>CXF</name>
                        </arg0>
                </ns2:addCustomer>
        </soap:Body>
</soap:Envelope>
--------------------------------------

13:11:36,610 INFO
LoggingOutInterceptor:131 - Outbound Message
---------------------------
Encoding: UTF-8
Headers: {}
Messages:
Payload:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
                <ns2:addCustomerResponse xmlns:ns2="http://server.cxf.asi.cox.com/">
                        <return>
                                <id>4</id>
                                <name>CXF</name>
                        </return>
                </ns2:addCustomerResponse>
        </soap:Body>
</soap:Envelope>



Jeffrey M. Constantin | Cox Communications Inc.
Data Product Services (DPS) | Architecture & Systems Integration (ASI)
Desk: 404-269-3111 | Mobile: 678.643.6528





Re: Logging/Debugging Question

Posted by Daniel Kulp <dk...@apache.org>.
I just added a simple atomically incrementing integer "ID" to the the logging 
interceptors to make this work easier without resorting to using ws-
addressing.   Also made it log the URI of the request on the incoming requests 
so you can tell which service it's intended for.

Dan


On Tue March 3 2009 4:48:00 pm Jeffrey.Constantin@cox.com wrote:
> To All,
>
> I have enabled Log4j logging in my CXF application which works nicely. As
> you can see below the logging is working and I can see my inbound and
> outbound SOAP messages.
>
> I don't see a unique message ID in the SOAP messages that would tie the
> response to the request.
>
> Is there a unique "id" in the request message that is returned in the
> response message that I can use to tie the response to a specific request.
> Maybe I am just not showing it in my log file. I see the
> wsu:Id="UsernameToken-23612966" which might be unique for the request but
> the SOAP header is not in the response.
>
> Any thoughts are gratefully appreciated.
>
> Thanks,
>
> Jeff
>
>
> LOG SAMPLE:
>
> 13:11:36,540 INFO LoggingInInterceptor:132 - Inbound Message
> ----------------------------
> Encoding: UTF-8
> Headers:
> {content-length=[1031], connection=[keep-alive],
> cache-control=[no-cache], host=[localhost:8080],
> user-agent=[Java/1.5.0_16], SOAPAction=[""], pragma=[no-cache],
> content-type=[text/xml; charset=UTF-8], Accept=[*]}
> Messages:
> Message:
>
> Payload:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>         <soap:Header>
>                 <wsse:Security
>                        
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
>ity-secext-1.0.xsd" soap:mustUnderstand="1">
>                         <wsse:UsernameToken
>                                
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
>ity-secext-1.0.xsd"
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
>ty-utility-1.0.xsd" wsu:Id="UsernameToken-23612966">
>                                 <wsse:Username
>                                        
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
>ity-secext-1.0.xsd">xxxxx</wsse:Username> <wsse:Password
>                                        
> xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
>ity-secext-1.0.xsd"
> Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-toke
>n-profile-1.0#PasswordText">xxxxx</wsse:Password> </wsse:UsernameToken>
>                 </wsse:Security>
>         </soap:Header>
>         <soap:Body>
>                 <ns2:addCustomer
> xmlns:ns2="http://server.cxf.asi.cox.com/"> <arg0>
>                                 <name>CXF</name>
>                         </arg0>
>                 </ns2:addCustomer>
>         </soap:Body>
> </soap:Envelope>
> --------------------------------------
>
> 13:11:36,610 INFO
> LoggingOutInterceptor:131 - Outbound Message
> ---------------------------
> Encoding: UTF-8
> Headers: {}
> Messages:
> Payload:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>         <soap:Body>
>                 <ns2:addCustomerResponse
> xmlns:ns2="http://server.cxf.asi.cox.com/"> <return>
>                                 <id>4</id>
>                                 <name>CXF</name>
>                         </return>
>                 </ns2:addCustomerResponse>
>         </soap:Body>
> </soap:Envelope>
>
>
>
> Jeffrey M. Constantin | Cox Communications Inc.
> Data Product Services (DPS) | Architecture & Systems Integration (ASI)
> Desk: 404-269-3111 | Mobile: 678.643.6528

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

RE: Logging/Debugging Question

Posted by Je...@cox.com.
Thanks, 

That worked great.

Jeff

-----Original Message-----
From: Eoghan Glynn [mailto:eoglynn@progress.com] 
Sent: Tuesday, March 03, 2009 5:05 PM
To: users@cxf.apache.org; users@cxf.apache.org
Subject: RE: Logging/Debugging Question



Hi Jeff,

If you enable WS-Addressing (see the samples/ws_addressing demo for guidance) then you'll see <wsa:MessageId> headers in the outgoing requests and <wsa:RelatesTo> headers in the corresponding responses. 

These headers should enable you to correlate responses with requests. 

In fact, these headers are used internally by CXF to do the correlation in the decoupled case (i.e. where a separate server->client connection is used to carry the response back to the client).

Cheers,
Eoghan

-----Original Message-----
From: Jeffrey.Constantin@cox.com [mailto:Jeffrey.Constantin@cox.com]
Sent: Tue 03/03/2009 21:48
To: users@cxf.apache.org
Subject: Logging/Debugging Question
 
To All,

I have enabled Log4j logging in my CXF application which works nicely. As you can see below the logging is working and I can see my inbound and outbound SOAP messages.

I don't see a unique message ID in the SOAP messages that would tie the response to the request.

Is there a unique "id" in the request message that is returned in the response message that I can use to tie the response to a specific request.
Maybe I am just not showing it in my log file. I see the wsu:Id="UsernameToken-23612966" which might be unique for the request but the SOAP header is not in the response.

Any thoughts are gratefully appreciated.

Thanks,

Jeff


LOG SAMPLE:

13:11:36,540 INFO LoggingInInterceptor:132 - Inbound Message
----------------------------
Encoding: UTF-8
Headers:
{content-length=[1031], connection=[keep-alive],
cache-control=[no-cache], host=[localhost:8080],
user-agent=[Java/1.5.0_16], SOAPAction=[""], pragma=[no-cache],
content-type=[text/xml; charset=UTF-8], Accept=[*]}
Messages:
Message:

Payload:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
                <wsse:Security
                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                        soap:mustUnderstand="1">
                        <wsse:UsernameToken
                                xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
                                wsu:Id="UsernameToken-23612966">
                                <wsse:Username
                                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">xxxxx</wsse:Username>
                                <wsse:Password
                                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                                        Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxx</wsse:Password>
                        </wsse:UsernameToken>
                </wsse:Security>
        </soap:Header>
        <soap:Body>
                <ns2:addCustomer xmlns:ns2="http://server.cxf.asi.cox.com/">
                        <arg0>
                                <name>CXF</name>
                        </arg0>
                </ns2:addCustomer>
        </soap:Body>
</soap:Envelope>
--------------------------------------

13:11:36,610 INFO
LoggingOutInterceptor:131 - Outbound Message
---------------------------
Encoding: UTF-8
Headers: {}
Messages:
Payload:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
                <ns2:addCustomerResponse xmlns:ns2="http://server.cxf.asi.cox.com/">
                        <return>
                                <id>4</id>
                                <name>CXF</name>
                        </return>
                </ns2:addCustomerResponse>
        </soap:Body>
</soap:Envelope>



Jeffrey M. Constantin | Cox Communications Inc.
Data Product Services (DPS) | Architecture & Systems Integration (ASI)
Desk: 404-269-3111 | Mobile: 678.643.6528






RE: Logging/Debugging Question

Posted by Eoghan Glynn <eo...@progress.com>.

Hi Jeff,

If you enable WS-Addressing (see the samples/ws_addressing demo for guidance) then you'll see <wsa:MessageId> headers in the outgoing requests and <wsa:RelatesTo> headers in the corresponding responses. 

These headers should enable you to correlate responses with requests. 

In fact, these headers are used internally by CXF to do the correlation in the decoupled case (i.e. where a separate server->client connection is used to carry the response back to the client).

Cheers,
Eoghan

-----Original Message-----
From: Jeffrey.Constantin@cox.com [mailto:Jeffrey.Constantin@cox.com]
Sent: Tue 03/03/2009 21:48
To: users@cxf.apache.org
Subject: Logging/Debugging Question
 
To All,

I have enabled Log4j logging in my CXF application which works nicely. As you can see below the logging is working and I can see my inbound and outbound SOAP messages.

I don't see a unique message ID in the SOAP messages that would tie the response to the request.

Is there a unique "id" in the request message that is returned in the response message that I can use to tie the response to a specific request.
Maybe I am just not showing it in my log file. I see the wsu:Id="UsernameToken-23612966" which might be unique for the request but the SOAP header is not in the response.

Any thoughts are gratefully appreciated.

Thanks,

Jeff


LOG SAMPLE:

13:11:36,540 INFO LoggingInInterceptor:132 - Inbound Message
----------------------------
Encoding: UTF-8
Headers:
{content-length=[1031], connection=[keep-alive],
cache-control=[no-cache], host=[localhost:8080],
user-agent=[Java/1.5.0_16], SOAPAction=[""], pragma=[no-cache],
content-type=[text/xml; charset=UTF-8], Accept=[*]}
Messages:
Message:

Payload:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
                <wsse:Security
                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                        soap:mustUnderstand="1">
                        <wsse:UsernameToken
                                xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                                xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
                                wsu:Id="UsernameToken-23612966">
                                <wsse:Username
                                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">xxxxx</wsse:Username>
                                <wsse:Password
                                        xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                                        Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxx</wsse:Password>
                        </wsse:UsernameToken>
                </wsse:Security>
        </soap:Header>
        <soap:Body>
                <ns2:addCustomer xmlns:ns2="http://server.cxf.asi.cox.com/">
                        <arg0>
                                <name>CXF</name>
                        </arg0>
                </ns2:addCustomer>
        </soap:Body>
</soap:Envelope>
--------------------------------------

13:11:36,610 INFO
LoggingOutInterceptor:131 - Outbound Message
---------------------------
Encoding: UTF-8
Headers: {}
Messages:
Payload:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Body>
                <ns2:addCustomerResponse xmlns:ns2="http://server.cxf.asi.cox.com/">
                        <return>
                                <id>4</id>
                                <name>CXF</name>
                        </return>
                </ns2:addCustomerResponse>
        </soap:Body>
</soap:Envelope>



Jeffrey M. Constantin | Cox Communications Inc.
Data Product Services (DPS) | Architecture & Systems Integration (ASI)
Desk: 404-269-3111 | Mobile: 678.643.6528