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/[EMAIL PROTECTED]'soap_header']) > 0">
env.build();
</xsl:if>
<xsl:for-each
select="input/[EMAIL PROTECTED]'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/[EMAIL PROTECTED]'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" <[EMAIL PROTECTED]>
To: <[email protected]>; <[EMAIL PROTECTED]>
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
<[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]