You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by satish madanwad <sa...@yahoo.com> on 2008/06/06 15:18:25 UTC

How to dump SOAP message contents?

Hi,

&nbsp; I am using WebServices with Apache Axis in my programs. I have generated client stubs and can prepare and&nbsp; send the WebService request properly.

&nbsp; I am trying to dump SOAP message (XML format) which is sent to WebServer for processing (to examine exact message being sent). I am not able to find any APIs for the same.

&nbsp; Can you please suggest, if there is any API to dump SOAP messages sent from Apache Axis to WebServer?

Thanks in advance,
Satish





      Bring your gang together. Do your thing. Find your favourite Yahoo! group at http://in.promos.yahoo.com/groups/

RE: How to dump SOAP message contents?

Posted by Martin Gainty <mg...@hotmail.com>.
glad to hear  
PropertyConfigurator.configure("c:/path/to/log4j.properties"); 
worked with log4j!

http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PropertyConfigurator.html

Thanks Ryan
Martin
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 


> Subject: RE: How to dump SOAP message contents?
> Date: Mon, 9 Jun 2008 23:46:09 -0600
> From: rmccullough@rightnow.com
> To: axis-user@ws.apache.org; mgainty@hotmail.com; satish_madanwad@yahoo.com; gary.weaver@duke.edu
> 
> Enabling log4j was relatively painless.
> 
> Just create the log4j.properties text file with these contents:
> # Set root category priority to INFO and its only appender to CONSOLE.
> log4j.rootCategory=ERROR, LOGFILE
> log4j.logger.org.apache.axis.transport.http.HTTPSender=DEBUG
> 
> # LOGFILE is set to be a File appender using a PatternLayout.
> log4j.appender.LOGFILE=org.apache.log4j.FileAppender
> log4j.appender.LOGFILE.File=axis.log
> log4j.appender.LOGFILE.Append=true
> log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
> log4j.appender.LOGFILE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}
> [%t] %-5p %c %x - %m%n
> 
> I have had mixed success with placing this file in the classpath, but adding
> this code works:
> import org.apache.log4j.PropertyConfigurator;
> import org.apache.log4j.Logger;
> PropertyConfigurator.configure("c:/path/to/log4j.properties");
> 
> The log output loosk like this:
> 
> 2008-05-20 10:18:25,707 [invoke] DEBUG
> org.apache.axis.transport.http.HTTPSender  - Enter:  HTTPSender::invoke
> 2008-05-20 10:18:25,816 [writeToSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  - XML sent:
> 2008-05-20 10:18:25,816 [writeToSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  -
> ---------------------------------------------------
> 2008-05-20 10:18:25,816 [writeToSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  - POST
> /cgi-bin/XXXXXXXX.cfg/php/xml_api/soap_api.php HTTP/1.0
> Content-Type: text/xml; charset=utf-8
> Accept: application/soap+xml, application/dime, multipart/related, text/*
> User-Agent: Axis/#axisVersion#
> Host: teton
> Cache-Control: no-cache
> Pragma: no-cache
> SOAPAction: "urn:Service/exec"
> Content-Length: 581
> 
> <-xml version="1.0" encoding="UTF-8"-><soapenv:Envelope 
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <soapenv:Header>
> <SessionHeader><ClientType>Toolkit-Java</ClientType><RequestTime>2008-05-20T
> 16:18:23.363Z</RequestTime></SessionHeader>
> </soapenv:Header>
> <soapenv:Body>
> <exec xmlns="urn:obj.api.rightnow.com"><transaction>
> <account_login><login>XXXXXXXX</login><opt>0</opt><password>XXXXXXXX</passwo
> rd></account_login>
> </transaction></exec></soapenv:Body></soapenv:Envelope>
> 2008-05-20 10:18:26,019 [readHeadersFromSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  - HTTP/1.1 200 OK
> 2008-05-20 10:18:26,019 [readHeadersFromSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  - Date Tue, 20 May 2008 16:18:25
> GMT
> 2008-05-20 10:18:26,019 [readHeadersFromSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  - Server Apache/2.2.6 (Unix)
> 2008-05-20 10:18:26,035 [readHeadersFromSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  - Connection close
> 2008-05-20 10:18:26,035 [readHeadersFromSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  - Content-Type text/xml;
> charset=UTF-8
> 2008-05-20 10:18:26,035 [readFromSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  - 
> no Content-Length
> 2008-05-20 10:18:26,051 [readFromSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  - 
> XML received:
> 2008-05-20 10:18:26,051 [readFromSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  -
> -----------------------------------------------
> 2008-05-20 10:18:26,098 [readFromSocket] DEBUG
> org.apache.axis.transport.http.HTTPSender  - <soap:Envelope 
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> <soap:Header><ResponseHeader
> xmlns="urn:obj.api.rightnow.com"><Version>8.8.0.47</Version></ResponseHeader
> ></soap:Header>
> <soap:Body><exec_rv xmlns="urn:obj.api.rightnow.com">
> <transaction_rv errlog_cnt="0">
> <account_login_rv><acct_id>X</acct_id>
> <session_id>XXXXXXXXXX</session_id>
> </account_login_rv>
> 
> </transaction_rv>
>     </exec_rv></soap:Body></soap:Envelope>
> 2008-05-20 10:18:26,098 [invoke] DEBUG
> org.apache.axis.transport.http.HTTPSender  - Exit:
> HTTPDispatchHandler::invoke
> 
> Notice the http header for both the request and response are present.
> 
> -Ryan
> 
> -----Original Message-----
> From: Martin [mailto:mgainty@hotmail.com] 
> Sent: Friday, June 06, 2008 2:07 PM
> To: satish_madanwad@yahoo.com; gary.weaver@duke.edu
> Cc: axis-user@ws.apache.org
> Subject: Re: How to dump SOAP message contents?
> 
> Satish/Gary
> Take a look at InterfaceImplementationTemplate.xsl which WSDL2Java uses to 
> generate Service and Stub.java
> which could be modified to log the discovered soap_headers
> 
>         // create SOAP envelope with that payload
>         org.apache.axiom.soap.SOAPEnvelope env = null;
> 
> //initialise
>        <xsl:choose>
>           <xsl:when test="(($isbackcompatible='true') and 
> (string-length(normalize-space($inputElementComplexType)) > 0))">
>                                    <xsl:if 
> test="count(input/param[@location='soap_header']) &gt; 0">
>                                                env.build();
>                                     </xsl:if>
>                                     <xsl:for-each 
> select="input/param[@location='soap_header']">
>                                         // add the children only if the 
> parameter is not null
>                                         if (<xsl:value-of 
> select="@name"/>!=null){
>                                             <xsl:choose>
>                                                 <xsl:when 
> test="@mustUnderstand = 'true'">
>  
> org.apache.axiom.om.OMElement 
> omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of 
> select="@name"/>, optimizeContent(new 
> javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", 
> "<xsl:value-of select="$method-name"/>")));
>  
> addHeader(omElement<xsl:value-of 
> select="@name"/>,env,true);
>                                                 </xsl:when>
>                                                 <xsl:otherwise>
>  
> org.apache.axiom.om.OMElement 
> omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of 
> select="@name"/>, optimizeContent(new 
> javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", 
> "<xsl:value-of select="$method-name"/>")));
>  
> addHeader(omElement<xsl:value-of 
> select="@name"/>,env);
>                                                 </xsl:otherwise>
>                                             </xsl:choose>
>                                         }
>                                     </xsl:for-each>
> 
>                                     <xsl:for-each 
> select="input/param[@location='http_header']">
>                                         // add the children only if the 
> parameter is not null
>                                         if (<xsl:value-of 
> select="@name"/>!=null){
>  
> addHttpHeader(_messageContext,"<xsl:value-of 
> select="@headername"/>",<xsl:value-of select="@name"/>);
>                                         }
>                                     </xsl:for-each>
>                                 </xsl:when>
>                                 <xsl:otherwise>
>                                     //Unknown style detected !! No code is 
> generated
>                                 </xsl:otherwise>
> 
>         //adding SOAP soap_headers
>          _serviceClient.addHeadersToEnvelope(env);
>         // set the message context with that soap envelope
>         _messageContext.setEnvelope(env);
> 
>         // add the message contxt to the operation client
>         _operationClient.addMessageContext(_messageContext);
> 
>         //execute the operation client
>         _operationClient.execute(true);
> 
> HTH
> Martin
> ----- Original Message ----- 
> From: "Gary Weaver" <ga...@duke.edu>
> To: <ax...@ws.apache.org>; <sa...@yahoo.com>
> Sent: Friday, June 06, 2008 1:36 PM
> Subject: Re: How to dump SOAP message contents?
> 
> 
> > In addition to using tcp tunnel or tcpmon you can just use logging to log 
> > the request and response:
> >
> > log4j.logger.httpclient.wire.content=DEBUG
> >
> > (within log4j.properties file in classpath (or within common/classes/, 
> > shared/classes/, or (webapp)/WEB-INF/classes/, etc.)
> >
> > That won't print the HTTPHeaders though, although the only thing in the 
> > header that seems of much importance is SOAPAction.
> >
> > Hope this helps,
> > Gary
> >
> > -- 
> > Gary Weaver
> > Internet Framework Services
> > Office of Information Technology
> > Duke University
> >
> >
> >
> >
> > Juergen Weber wrote:
> >> see http://articles.techrepublic.com.com/5100-10878_11-1049605.html
> >>
> >> On Fri, Jun 6, 2008 at 3:18 PM, satish madanwad
> >> <sa...@yahoo.com> wrote:
> >>
> >>> Hi,
> >>>
> >>>   I am using WebServices with Apache Axis in my programs. I have 
> >>> generated
> >>> client stubs and can prepare and  send the WebService request properly.
> >>>
> >>>   I am trying to dump SOAP message (XML format) which is sent to 
> >>> WebServer
> >>> for processing (to examine exact message being sent). I am not able to 
> >>> find
> >>> any APIs for the same.
> >>>
> >>>   Can you please suggest, if there is any API to dump SOAP messages sent
> >>> from Apache Axis to WebServer?
> >>>
> >>> Thanks in advance,
> >>> Satish
> >>>
> >>>
> >>>
> >>> ________________________________
> >>> Download prohibited? No problem. CHAT from any browser, without 
> >>> download.
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: axis-user-help@ws.apache.org
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 

_________________________________________________________________
It’s easy to add contacts from Facebook and other social sites through Windows Live™ Messenger. Learn how.
https://www.invite2messenger.net/im/?source=TXT_EML_WLH_LearnHow

RE: How to dump SOAP message contents?

Posted by "McCullough, Ryan" <rm...@rightnow.com>.
Enabling log4j was relatively painless.

Just create the log4j.properties text file with these contents:
# Set root category priority to INFO and its only appender to CONSOLE.
log4j.rootCategory=ERROR, LOGFILE
log4j.logger.org.apache.axis.transport.http.HTTPSender=DEBUG

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=axis.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS}
[%t] %-5p %c %x - %m%n

I have had mixed success with placing this file in the classpath, but adding
this code works:
import org.apache.log4j.PropertyConfigurator;
import org.apache.log4j.Logger;
PropertyConfigurator.configure("c:/path/to/log4j.properties");

The log output loosk like this:

2008-05-20 10:18:25,707 [invoke] DEBUG
org.apache.axis.transport.http.HTTPSender  - Enter:  HTTPSender::invoke
2008-05-20 10:18:25,816 [writeToSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  - XML sent:
2008-05-20 10:18:25,816 [writeToSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  -
---------------------------------------------------
2008-05-20 10:18:25,816 [writeToSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  - POST
/cgi-bin/XXXXXXXX.cfg/php/xml_api/soap_api.php HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/#axisVersion#
Host: teton
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: "urn:Service/exec"
Content-Length: 581

<-xml version="1.0" encoding="UTF-8"-><soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<SessionHeader><ClientType>Toolkit-Java</ClientType><RequestTime>2008-05-20T
16:18:23.363Z</RequestTime></SessionHeader>
</soapenv:Header>
<soapenv:Body>
<exec xmlns="urn:obj.api.rightnow.com"><transaction>
<account_login><login>XXXXXXXX</login><opt>0</opt><password>XXXXXXXX</passwo
rd></account_login>
</transaction></exec></soapenv:Body></soapenv:Envelope>
2008-05-20 10:18:26,019 [readHeadersFromSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  - HTTP/1.1 200 OK
2008-05-20 10:18:26,019 [readHeadersFromSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  - Date Tue, 20 May 2008 16:18:25
GMT
2008-05-20 10:18:26,019 [readHeadersFromSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  - Server Apache/2.2.6 (Unix)
2008-05-20 10:18:26,035 [readHeadersFromSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  - Connection close
2008-05-20 10:18:26,035 [readHeadersFromSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  - Content-Type text/xml;
charset=UTF-8
2008-05-20 10:18:26,035 [readFromSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  - 
no Content-Length
2008-05-20 10:18:26,051 [readFromSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  - 
XML received:
2008-05-20 10:18:26,051 [readFromSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  -
-----------------------------------------------
2008-05-20 10:18:26,098 [readFromSocket] DEBUG
org.apache.axis.transport.http.HTTPSender  - <soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Header><ResponseHeader
xmlns="urn:obj.api.rightnow.com"><Version>8.8.0.47</Version></ResponseHeader
></soap:Header>
<soap:Body><exec_rv xmlns="urn:obj.api.rightnow.com">
<transaction_rv errlog_cnt="0">
<account_login_rv><acct_id>X</acct_id>
<session_id>XXXXXXXXXX</session_id>
</account_login_rv>

</transaction_rv>
    </exec_rv></soap:Body></soap:Envelope>
2008-05-20 10:18:26,098 [invoke] DEBUG
org.apache.axis.transport.http.HTTPSender  - Exit:
HTTPDispatchHandler::invoke

Notice the http header for both the request and response are present.

-Ryan

-----Original Message-----
From: Martin [mailto:mgainty@hotmail.com] 
Sent: Friday, June 06, 2008 2:07 PM
To: satish_madanwad@yahoo.com; gary.weaver@duke.edu
Cc: axis-user@ws.apache.org
Subject: Re: How to dump SOAP message contents?

Satish/Gary
Take a look at InterfaceImplementationTemplate.xsl which WSDL2Java uses to 
generate Service and Stub.java
which could be modified to log the discovered soap_headers

        // create SOAP envelope with that payload
        org.apache.axiom.soap.SOAPEnvelope env = null;

//initialise
       <xsl:choose>
          <xsl:when test="(($isbackcompatible='true') and 
(string-length(normalize-space($inputElementComplexType)) > 0))">
                                   <xsl:if 
test="count(input/param[@location='soap_header']) &gt; 0">
                                               env.build();
                                    </xsl:if>
                                    <xsl:for-each 
select="input/param[@location='soap_header']">
                                        // add the children only if the 
parameter is not null
                                        if (<xsl:value-of 
select="@name"/>!=null){
                                            <xsl:choose>
                                                <xsl:when 
test="@mustUnderstand = 'true'">
 
org.apache.axiom.om.OMElement 
omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of 
select="@name"/>, optimizeContent(new 
javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", 
"<xsl:value-of select="$method-name"/>")));
 
addHeader(omElement<xsl:value-of 
select="@name"/>,env,true);
                                                </xsl:when>
                                                <xsl:otherwise>
 
org.apache.axiom.om.OMElement 
omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of 
select="@name"/>, optimizeContent(new 
javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", 
"<xsl:value-of select="$method-name"/>")));
 
addHeader(omElement<xsl:value-of 
select="@name"/>,env);
                                                </xsl:otherwise>
                                            </xsl:choose>
                                        }
                                    </xsl:for-each>

                                    <xsl:for-each 
select="input/param[@location='http_header']">
                                        // add the children only if the 
parameter is not null
                                        if (<xsl:value-of 
select="@name"/>!=null){
 
addHttpHeader(_messageContext,"<xsl:value-of 
select="@headername"/>",<xsl:value-of select="@name"/>);
                                        }
                                    </xsl:for-each>
                                </xsl:when>
                                <xsl:otherwise>
                                    //Unknown style detected !! No code is 
generated
                                </xsl:otherwise>

        //adding SOAP soap_headers
         _serviceClient.addHeadersToEnvelope(env);
        // set the message context with that soap envelope
        _messageContext.setEnvelope(env);

        // add the message contxt to the operation client
        _operationClient.addMessageContext(_messageContext);

        //execute the operation client
        _operationClient.execute(true);

HTH
Martin
----- Original Message ----- 
From: "Gary Weaver" <ga...@duke.edu>
To: <ax...@ws.apache.org>; <sa...@yahoo.com>
Sent: Friday, June 06, 2008 1:36 PM
Subject: Re: How to dump SOAP message contents?


> In addition to using tcp tunnel or tcpmon you can just use logging to log 
> the request and response:
>
> log4j.logger.httpclient.wire.content=DEBUG
>
> (within log4j.properties file in classpath (or within common/classes/, 
> shared/classes/, or (webapp)/WEB-INF/classes/, etc.)
>
> That won't print the HTTPHeaders though, although the only thing in the 
> header that seems of much importance is SOAPAction.
>
> Hope this helps,
> Gary
>
> -- 
> Gary Weaver
> Internet Framework Services
> Office of Information Technology
> Duke University
>
>
>
>
> Juergen Weber wrote:
>> see http://articles.techrepublic.com.com/5100-10878_11-1049605.html
>>
>> On Fri, Jun 6, 2008 at 3:18 PM, satish madanwad
>> <sa...@yahoo.com> wrote:
>>
>>> Hi,
>>>
>>>   I am using WebServices with Apache Axis in my programs. I have 
>>> generated
>>> client stubs and can prepare and  send the WebService request properly.
>>>
>>>   I am trying to dump SOAP message (XML format) which is sent to 
>>> WebServer
>>> for processing (to examine exact message being sent). I am not able to 
>>> find
>>> any APIs for the same.
>>>
>>>   Can you please suggest, if there is any API to dump SOAP messages sent
>>> from Apache Axis to WebServer?
>>>
>>> Thanks in advance,
>>> Satish
>>>
>>>
>>>
>>> ________________________________
>>> Download prohibited? No problem. CHAT from any browser, without 
>>> download.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: How to dump SOAP message contents?

Posted by Martin <mg...@hotmail.com>.
Satish/Gary
Take a look at InterfaceImplementationTemplate.xsl which WSDL2Java uses to 
generate Service and Stub.java
which could be modified to log the discovered soap_headers

        // create SOAP envelope with that payload
        org.apache.axiom.soap.SOAPEnvelope env = null;

//initialise
       <xsl:choose>
          <xsl:when test="(($isbackcompatible='true') and 
(string-length(normalize-space($inputElementComplexType)) > 0))">
                                   <xsl:if 
test="count(input/param[@location='soap_header']) &gt; 0">
                                               env.build();
                                    </xsl:if>
                                    <xsl:for-each 
select="input/param[@location='soap_header']">
                                        // add the children only if the 
parameter is not null
                                        if (<xsl:value-of 
select="@name"/>!=null){
                                            <xsl:choose>
                                                <xsl:when 
test="@mustUnderstand = 'true'">
                                                    org.apache.axiom.om.OMElement 
omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of 
select="@name"/>, optimizeContent(new 
javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", 
"<xsl:value-of select="$method-name"/>")));
                                                    addHeader(omElement<xsl:value-of 
select="@name"/>,env,true);
                                                </xsl:when>
                                                <xsl:otherwise>
                                                    org.apache.axiom.om.OMElement 
omElement<xsl:value-of select="@name"/> = toOM(<xsl:value-of 
select="@name"/>, optimizeContent(new 
javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", 
"<xsl:value-of select="$method-name"/>")));
                                                    addHeader(omElement<xsl:value-of 
select="@name"/>,env);
                                                </xsl:otherwise>
                                            </xsl:choose>
                                        }
                                    </xsl:for-each>

                                    <xsl:for-each 
select="input/param[@location='http_header']">
                                        // add the children only if the 
parameter is not null
                                        if (<xsl:value-of 
select="@name"/>!=null){
                                            addHttpHeader(_messageContext,"<xsl:value-of 
select="@headername"/>",<xsl:value-of select="@name"/>);
                                        }
                                    </xsl:for-each>
                                </xsl:when>
                                <xsl:otherwise>
                                    //Unknown style detected !! No code is 
generated
                                </xsl:otherwise>

        //adding SOAP soap_headers
         _serviceClient.addHeadersToEnvelope(env);
        // set the message context with that soap envelope
        _messageContext.setEnvelope(env);

        // add the message contxt to the operation client
        _operationClient.addMessageContext(_messageContext);

        //execute the operation client
        _operationClient.execute(true);

HTH
Martin
----- Original Message ----- 
From: "Gary Weaver" <ga...@duke.edu>
To: <ax...@ws.apache.org>; <sa...@yahoo.com>
Sent: Friday, June 06, 2008 1:36 PM
Subject: Re: How to dump SOAP message contents?


> In addition to using tcp tunnel or tcpmon you can just use logging to log 
> the request and response:
>
> log4j.logger.httpclient.wire.content=DEBUG
>
> (within log4j.properties file in classpath (or within common/classes/, 
> shared/classes/, or (webapp)/WEB-INF/classes/, etc.)
>
> That won't print the HTTPHeaders though, although the only thing in the 
> header that seems of much importance is SOAPAction.
>
> Hope this helps,
> Gary
>
> -- 
> Gary Weaver
> Internet Framework Services
> Office of Information Technology
> Duke University
>
>
>
>
> Juergen Weber wrote:
>> see http://articles.techrepublic.com.com/5100-10878_11-1049605.html
>>
>> On Fri, Jun 6, 2008 at 3:18 PM, satish madanwad
>> <sa...@yahoo.com> wrote:
>>
>>> Hi,
>>>
>>>   I am using WebServices with Apache Axis in my programs. I have 
>>> generated
>>> client stubs and can prepare and  send the WebService request properly.
>>>
>>>   I am trying to dump SOAP message (XML format) which is sent to 
>>> WebServer
>>> for processing (to examine exact message being sent). I am not able to 
>>> find
>>> any APIs for the same.
>>>
>>>   Can you please suggest, if there is any API to dump SOAP messages sent
>>> from Apache Axis to WebServer?
>>>
>>> Thanks in advance,
>>> Satish
>>>
>>>
>>>
>>> ________________________________
>>> Download prohibited? No problem. CHAT from any browser, without 
>>> download.
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: How to dump SOAP message contents?

Posted by "Vinh Nguyen (vinguye2)" <vi...@cisco.com>.
Or, you can install the attached Perl CGI script to a server like Apache
or IIS.  I initially wrote it to test WS-Notification messages, but it
can also be used for general testing.  Just send your SOAP request to
the CGI as the "endpoint", and it'll dump the HTTP headers and SOAP
content to a temp file.  This way, you can see exactly what was sent by
your client.

-Vinh


-----Original Message-----
From: Gary Weaver [mailto:gary.weaver@duke.edu] 
Sent: Friday, June 06, 2008 10:37 AM
To: axis-user@ws.apache.org; satish_madanwad@yahoo.com
Subject: Re: How to dump SOAP message contents?

In addition to using tcp tunnel or tcpmon you can just use logging to
log the request and response:

log4j.logger.httpclient.wire.content=DEBUG

(within log4j.properties file in classpath (or within common/classes/,
shared/classes/, or (webapp)/WEB-INF/classes/, etc.)

That won't print the HTTPHeaders though, although the only thing in the
header that seems of much importance is SOAPAction.

Hope this helps,
Gary

--
Gary Weaver
Internet Framework Services
Office of Information Technology
Duke University




Juergen Weber wrote:
> see http://articles.techrepublic.com.com/5100-10878_11-1049605.html
>
> On Fri, Jun 6, 2008 at 3:18 PM, satish madanwad
> <sa...@yahoo.com> wrote:
>   
>> Hi,
>>
>>   I am using WebServices with Apache Axis in my programs. I have
generated
>> client stubs and can prepare and  send the WebService request
properly.
>>
>>   I am trying to dump SOAP message (XML format) which is sent to
WebServer
>> for processing (to examine exact message being sent). I am not able
to find
>> any APIs for the same.
>>
>>   Can you please suggest, if there is any API to dump SOAP messages
sent
>> from Apache Axis to WebServer?
>>
>> Thanks in advance,
>> Satish
>>
>>
>>
>> ________________________________
>> Download prohibited? No problem. CHAT from any browser, without
download.
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>   



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: How to dump SOAP message contents?

Posted by George Stanchev <Gs...@serena.com>.
log4j.logger.httpclient.wire.content=DEBUG
log4j.logger.httpclient.wire.header=DEBUG # for HTTP headers

Best Regards,
George

-----Original Message-----
From: Gary Weaver [mailto:gary.weaver@duke.edu] 
Sent: Friday, June 06, 2008 11:37 AM
To: axis-user@ws.apache.org; satish_madanwad@yahoo.com
Subject: Re: How to dump SOAP message contents?

In addition to using tcp tunnel or tcpmon you can just use logging to
log the request and response:

log4j.logger.httpclient.wire.content=DEBUG

(within log4j.properties file in classpath (or within common/classes/,
shared/classes/, or (webapp)/WEB-INF/classes/, etc.)

That won't print the HTTPHeaders though, although the only thing in the
header that seems of much importance is SOAPAction.

Hope this helps,
Gary

--
Gary Weaver
Internet Framework Services
Office of Information Technology
Duke University




Juergen Weber wrote:
> see http://articles.techrepublic.com.com/5100-10878_11-1049605.html
>
> On Fri, Jun 6, 2008 at 3:18 PM, satish madanwad
> <sa...@yahoo.com> wrote:
>   
>> Hi,
>>
>>   I am using WebServices with Apache Axis in my programs. I have
generated
>> client stubs and can prepare and  send the WebService request
properly.
>>
>>   I am trying to dump SOAP message (XML format) which is sent to
WebServer
>> for processing (to examine exact message being sent). I am not able
to find
>> any APIs for the same.
>>
>>   Can you please suggest, if there is any API to dump SOAP messages
sent
>> from Apache Axis to WebServer?
>>
>> Thanks in advance,
>> Satish
>>
>>
>>
>> ________________________________
>> Download prohibited? No problem. CHAT from any browser, without
download.
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>   



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


**********************************************************************
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. 
**********************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: How to dump SOAP message contents?

Posted by Gary Weaver <ga...@duke.edu>.
In addition to using tcp tunnel or tcpmon you can just use logging to 
log the request and response:

log4j.logger.httpclient.wire.content=DEBUG

(within log4j.properties file in classpath (or within common/classes/, 
shared/classes/, or (webapp)/WEB-INF/classes/, etc.)

That won't print the HTTPHeaders though, although the only thing in the 
header that seems of much importance is SOAPAction.

Hope this helps,
Gary

-- 
Gary Weaver
Internet Framework Services
Office of Information Technology
Duke University




Juergen Weber wrote:
> see http://articles.techrepublic.com.com/5100-10878_11-1049605.html
>
> On Fri, Jun 6, 2008 at 3:18 PM, satish madanwad
> <sa...@yahoo.com> wrote:
>   
>> Hi,
>>
>>   I am using WebServices with Apache Axis in my programs. I have generated
>> client stubs and can prepare and  send the WebService request properly.
>>
>>   I am trying to dump SOAP message (XML format) which is sent to WebServer
>> for processing (to examine exact message being sent). I am not able to find
>> any APIs for the same.
>>
>>   Can you please suggest, if there is any API to dump SOAP messages sent
>> from Apache Axis to WebServer?
>>
>> Thanks in advance,
>> Satish
>>
>>
>>
>> ________________________________
>> Download prohibited? No problem. CHAT from any browser, without download.
>>     
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>   



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: How to dump SOAP message contents?

Posted by Juergen Weber <we...@gmail.com>.
see http://articles.techrepublic.com.com/5100-10878_11-1049605.html

On Fri, Jun 6, 2008 at 3:18 PM, satish madanwad
<sa...@yahoo.com> wrote:
> Hi,
>
>   I am using WebServices with Apache Axis in my programs. I have generated
> client stubs and can prepare and  send the WebService request properly.
>
>   I am trying to dump SOAP message (XML format) which is sent to WebServer
> for processing (to examine exact message being sent). I am not able to find
> any APIs for the same.
>
>   Can you please suggest, if there is any API to dump SOAP messages sent
> from Apache Axis to WebServer?
>
> Thanks in advance,
> Satish
>
>
>
> ________________________________
> Download prohibited? No problem. CHAT from any browser, without download.

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: How to dump SOAP message contents?

Posted by jbolger <jo...@gmail.com>.
Hi Satish,

I know that there is a soapmonitor jar file included in distribution but i
actually used a freee program called wireshark which you can google that
monitors all of your network activity and displays the requests you are
making including all header info and handshakes etc.. 

Very good program, would recommend trying it.

John


satish madanwad wrote:
> 
> Hi,
> 
> &nbsp; I am using WebServices with Apache Axis in my programs. I have
> generated client stubs and can prepare and&nbsp; send the WebService
> request properly.
> 
> &nbsp; I am trying to dump SOAP message (XML format) which is sent to
> WebServer for processing (to examine exact message being sent). I am not
> able to find any APIs for the same.
> 
> &nbsp; Can you please suggest, if there is any API to dump SOAP messages
> sent from Apache Axis to WebServer?
> 
> Thanks in advance,
> Satish
> 
> 
> 
> 
> 
>       Bring your gang together. Do your thing. Find your favourite Yahoo!
> group at http://in.promos.yahoo.com/groups/
> 

-- 
View this message in context: http://www.nabble.com/How-to-dump-SOAP-message-contents--tp17691977p17772233.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: How to dump SOAP message contents?

Posted by Enaganti M Naidu <em...@hotmail.com>.
There are multiple ways to do that. One is to log the payload before calling sendReceive. But if you do not have means of making those changes, then you can do either of the following
a) Use Apache TCPMON to listen for your messages
   Here is how to do this. Suppose your endpoint is http://localhost:8080/axis2/yourServiceURI, then you can set TCPMON to listen on 8090 and set the target port to 8080. Then change the endpoint in your client to use port 8090. You should start seeing the messages
 
b) If you have access to the service side and SOAPMonitor is enable and deployed right, you can access the URL http://localhost:port/axis2/SOAPMonitor which should list the SOAP requests and responses.
 
I believe you can also create a handler (even on the client side) that can log the message. I am not 100% certain on this however.
 
Hope this helps
Madhav
 


From: skilburn@geopraxis.caTo: axis-user@ws.apache.org; satish_madanwad@yahoo.comSubject: RE: How to dump SOAP message contents?Date: Fri, 6 Jun 2008 16:28:14 -0400






Hi Satish,
 
Not quite what you are asking for, but are you aware of the following?
 
https://tcpmon.dev.java.net/
 
It’s absolutely invaluable for debugging.
 
_____________________________________________________________Stephen Kilburn, GeoPraxis Inc.
 

From: satish madanwad [mailto:satish_madanwad@yahoo.com] Sent: June 6, 2008 09:18To: axis-user@ws.apache.orgSubject: How to dump SOAP message contents?
 




Hi,  I am using WebServices with Apache Axis in my programs. I have generated client stubs and can prepare and  send the WebService request properly.  I am trying to dump SOAP message (XML format) which is sent to WebServer for processing (to examine exact message being sent). I am not able to find any APIs for the same.  Can you please suggest, if there is any API to dump SOAP messages sent from Apache Axis to WebServer?Thanks in advance,Satish
 



Download prohibited? No problem. CHAT from any browser, without download.
_________________________________________________________________
Search that pays you back! Introducing Live Search cashback.
http://search.live.com/cashback/?&pkw=form=MIJAAF/publ=HMTGL/crea=srchpaysyouback

RE: How to dump SOAP message contents?

Posted by Stephen Kilburn <sk...@geopraxis.ca>.
Hi Satish,

 

Not quite what you are asking for, but are you aware of the following?

 

https://tcpmon.dev.java.net/

 

It’s absolutely invaluable for debugging.

 

_____________________________________________________________
Stephen Kilburn, GeoPraxis Inc.

 

From: satish madanwad [mailto:satish_madanwad@yahoo.com] 
Sent: June 6, 2008 09:18
To: axis-user@ws.apache.org
Subject: How to dump SOAP message contents?

 


Hi,

  I am using WebServices with Apache Axis in my programs. I have generated client stubs and can prepare and  send the WebService request properly.

  I am trying to dump SOAP message (XML format) which is sent to WebServer for processing (to examine exact message being sent). I am not able to find any APIs for the same.

  Can you please suggest, if there is any API to dump SOAP messages sent from Apache Axis to WebServer?

Thanks in advance,
Satish



 

  _____  

Download prohibited? No problem. CHAT <http://in.rd.yahoo.com/tagline_webmessenger_1/*http:/in.messenger.yahoo.com/webmessengerpromo.php>  from any browser, without download.