[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-user
Subject:    Re: Re[4]: Raw SOAP XML response
From:       Martin Gainty <mgainty () hotmail ! com>
Date:       2016-11-16 1:07:55
Message-ID: DM5PR14MB17708599005AC1B6882AEFB1AEBE0 () DM5PR14MB1770 ! namprd14 ! prod ! outlook ! com
[Download RAW message or body]

Martin Gainty
______________________________________________

 _____ _          _____             _          _____     ___ _                        \
_____               _     _   _          |_   _| |_ ___   |  _  |___ ___ ___| |_ ___  \
|   __|___|  _| |_ _ _ _ ___ ___ ___   |   __|___ _ _ ___ _| |___| |_|_|___ ___    | \
| |   | -_|  |     | . | .'|  _|   | -_|  |__   | . |  _|  _| | | | .'|  _| -_|  |   \
__| . | | |   | . | .'|  _| | . |   |   |_| |_|_|___|  |__|__|  _|__,|___|_|_|___|  \
|_____|___|_| |_| |_____|__,|_| |___|  |__|  |___|___|_|_|___|__,|_| |_|___|_|_|      \
|_|



________________________________
From: Martin Gainty <mgainty@hotmail.com>
Sent: Tuesday, November 15, 2016 6:46 AM
To: java-user@axis.apache.org; Sterpu Victor
Subject: Re: Re[4]: Raw SOAP XML response


if you dont have axis2.xml in server config do you have annotations defined in server \
code?

http://www.ibm.com/developerworks/library/j-jws8/

Java Web services: JAXB and JAX-WS in \
Axis2<http://www.ibm.com/developerworks/library/j-jws8/> www.ibm.com
Apache Axis2 supports a range of data-binding technologies, including the official \
Java standard, JAXB 2.x. Axis2 also supports the Java standard for Web service \
configuration, JAX-WS 2.x, as an alternative to its own custom configuration \
technique. Dennis Sosnoski continues his Java Web services column series by \
demonstrating how you can use each of these Java standards with Axis2 and discussing \
some of the limitations of Axis2's current support for them.




do you have a Axis2 Server fully operational.. what does Axis Happiness page say?


http://localhost:8080/axis2-web/HappyAxis.jsp


MG>http://ServerHostName:ServerPortNumber/axis2/axis2-web/HappyAxis.jsp


Martin
______________________________________________



________________________________
From: Sterpu Victor <victor@caido.ro>
Sent: Monday, November 14, 2016 4:58 PM
To: Martin Gainty; java-user@axis.apache.org
Subject: Re[4]: Raw SOAP XML response

I tired your code but I got a problem. This is what I wrote(I don't have a axis2.xml \
file, I just create the stub with wsdl2java and used the class): ConfigurationContext \
configContext = ConfigurationContextFactory.createDefaultConfigurationContext(); \
ServiceClient sender = new ServiceClient(configContext, null); OperationClient \
mepClient = sender.createClient(ServiceClient.ANON_OUT_IN_OP); MessageContext \
response=mepClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE); String \
response_xml = response.getEnvelope().toString();

These lines are executed immediatly after the succesful SOAP call and I receive a \
java.lang.NullPointerException at the line "String response_xml = \
response.getEnvelope().toString();". I traced the SOAP response with Fiddler and the \
answer is "<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope \
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><dlwmin:storeClinicalDocumentSResponse \
xmlns:dlwmin="core.des.uti.ro" \
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><return></return></dlwmin:storeClinicalDocumentSResponse></soapenv:Body></soapenv:Envelope>"


Thank you.

------ Original Message ------
From: "Martin Gainty" <mgainty@hotmail.com<mailto:mgainty@hotmail.com>>
To: "java-user@axis.apache.org" \
<java-user@axis.apache.org<mailto:java-user@axis.apache.org>>; "Sterpu Victor" \
                <victor@caido.ro<mailto:victor@caido.ro>>
Sent: 2/11/2016 9:28:48 PM
Subject: Re: Re[2]: Raw SOAP XML response



________________________________
From: Sterpu Victor <victor@caido.ro<mailto:victor@caido.ro>>
Sent: Wednesday, November 2, 2016 11:57 AM
To: Martin Gainty; java-user@axis.apache.org<mailto:java-user@axis.apache.org>
Subject: Re[2]: Raw SOAP XML response

It didn't work.
This is what I did: I deleted from the directory of Axis2\lib 4 files: \
axiom-jaxb-1.2.19.jar, axiom-api-1.2.19.jar, axiom-dom-1.2.19.jar, \
axiom-impl-1.2.19.jar and I added these 4 files: \
axiom-api-1.2.20.jar,axiom-dom-1.2.20.jar,axiom-impl-1.2.20.jar,axiom-jaxb-1.2.20.jar.
 I use Axis embeded so I also deleted from my netbeans libraries the old jars and \
added the new ones. I recompiled and the error remained.


------ Original Message ------
From: "Martin Gainty" <mgainty@hotmail.com<mailto:mgainty@hotmail.com>>
To: "java-user@axis.apache.org<mailto:java-user@axis.apache.org>" \
<java-user@axis.apache.org<mailto:java-user@axis.apache.org>>; "Sterpu Victor" \
                <victor@caido.ro<mailto:victor@caido.ro>>
Sent: 2/11/2016 4:58:09 PM
Subject: Re: Raw SOAP XML response


possible outdated version of axiom


     * In Axiom versions prior to 1.2.9, the sequence of events was inconsistent if \
                the
     * underlying stream is XOP encoded and caching is disabled (see WSCOMMONS-485).
     * This made it necessary for the caller to (partially) handle the XOP processing \
                and to use
     * {@link OMAttachmentAccessor#getDataHandler(String)} to retrieve the binary \
                content.
     * Starting with 1.2.9 this is no longer be the case: as specified above,
     * the sequence of events is *independent of the state of the object model*
     * and the value of the <code>cache</code> parameter,
     * and ALL binary content is reported through the
     * {@link org.apache.axiom.ext.stax.datahandler.DataHandlerReader} (embedded in \
axiom-api) extension.


upgrade axiom to 1.2.9 a recompile, package, deploy and run with 1.2.9 should \
mitigate the error you are now receiving

*please keep us apprised*


Martin
______________________________________________


________________________________
From: Sterpu Victor <victor@caido.ro<mailto:victor@caido.ro>>
Sent: Wednesday, November 2, 2016 9:37 AM
To: java-user@axis.apache.org<mailto:java-user@axis.apache.org>
Subject: Raw SOAP XML response

Hello

I need to save the raw SOAP XML response from Axis2(I use axis 2 1.7.3).
When Axis2 call retusrns an error this code works:
String response = sc.getLastOperationContext().getMessageContext("In").getEnvelope().toString();


MG>//build configurationContext from location of repo and name of axis2.xml
MG> ConfigurationContext configContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem("../../repository",  //exact location of \
repository "axis2.xml");                           //exact filename of axis2.xml

MG>establish new ServiceClient implementing attributes from ConfigurationContext
MG> ServiceClient sender = new ServiceClient(configContext, null);

MG>you will need to supply a QName for incoming request and SOAP response output
/**
     * Operation name used for an anonymous in-out operation (meaning we sent a \
                message and receive
     * a response, equivalent to a WSDL In-Out operation).

    public static final QName ANON_OUT_IN_OP = new \
QName(Constants.AXIS2_NAMESPACE_URI,  "anonOutInOp",
                                                         \
                Constants.AXIS2_NAMESPACE_PREFIX);
*/
MG>OperationClient mepClient = sender.createClient(ServiceClient.ANON_OUT_IN_OP);

MG>ask client to contact axis2 server and pull a response back
MG>MessageContext response=mepClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE));
 /**
     *MESSAGE_LABEL_IN_VALUE Constant to represent the message label "In" which is \
                used by the
     * following WSDL 2.0 defined MEPs: In-Only, Robust In-Only, In-Out, //Hint: \
                In-Out is your Message Exchange
     * In-Optional-Out, Out-In, Out-Optional-In.
    public static final byte MESSAGE_LABEL_IN = 0;
    public static final String MESSAGE_LABEL_IN_VALUE = "In";
*/

MG>convert soapEnvelope to String
MG>String response =response.getEnvelope().toString();

MG>?
But when I run a succesful Axis2 call the same code gives the following error: \
"java.lang.IllegalStateException: Can't process next node because caching is \
disabled"

I tryed to enable cache like this, but it didn't work:

                                ServiceClient sc = \
                (ServiceClient)method_getServiceClient.invoke(objectReflect);
                                ServiceContext srv_context = sc.getServiceContext();
                                srv_context.setCachingOperationContext(true);
                                OperationContext oc= new OperationContext();
                                oc.setComplete(true);
                                srv_context.setLastOperationContext(oc);

Thank you


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} \
--></style> </head>
<body dir="ltr">
<div id="divtagdefaultwrapper" \
style="font-size:12pt;color:#000000;font-family:Arial,Helvetica,sans-serif;" \
dir="ltr"> <p><br>
</p>
<p><br>
</p>
<div id="Signature">Martin Gainty <br>
______________________________________________ <br>
<pre style=""> _____ _          _____             _          _____     ___ _          \
_____               _     _   _          |_   _| |_ ___   |  _  |___ ___ ___| |_ ___  \
|   __|___|  _| |_ _ _ _ ___ ___ ___   |   __|___ _ _ ___ _| |___| |_|_|___ ___    | \
| |   | -_|  |     | . | .'|  _|   | -_|  |__   | . |  _|  _| | | | .'|  _| -_|  |   \
__| . | | |   | . | .'|  _| | . |   |   |_| |_|_|___|  |__|__|  _|__,|___|_|_|___|  \
|_____|___|_| |_| |_____|__,|_| |___|  |__|  |___|___|_|_|___|__,|_| |_|___|_|_|      \
|_|                                                                                   \
</pre> <br>
</div>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" \
style="font-size:11pt"><b>From:</b> Martin Gainty &lt;mgainty@hotmail.com&gt;<br> \
<b>Sent:</b> Tuesday, November 15, 2016 6:46 AM<br> <b>To:</b> \
java-user@axis.apache.org; Sterpu Victor<br> <b>Subject:</b> Re: Re[4]: Raw SOAP XML \
response</font> <div>&nbsp;</div>
</div>
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; \
font-family:Arial,Helvetica,sans-serif"> <p>if you dont have axis2.xml in server \
config&nbsp;do you have annotations defined in server code?</p> <p><a \
href="http://www.ibm.com/developerworks/library/j-jws8/" class="OWAAutoLink" \
id="LPlnk174824" previewremoved="true">http://www.ibm.com/developerworks/library/j-jws8/</a></p>
 <div id="LPBorder_GT_14792103362050.8479515569546496" style="margin-bottom:20px; \
overflow:auto; width:100%; text-indent:0px"> <table \
id="LPContainer_14792103361970.40646678448246387" cellspacing="0" style="width:90%; \
background-color:rgb(255,255,255); overflow:auto; padding-top:20px; \
padding-bottom:20px; margin-top:20px; border-top:1px dotted rgb(200,200,200); \
border-bottom:1px dotted rgb(200,200,200)"> <tbody>
<tr valign="top" style="border-spacing:0px">
<td id="TextCell_14792103362000.5114553852866455" colspan="2" style="vertical-align: \
top; padding: 0px; display: table-cell; position: relative;"> <div \
id="LPRemovePreviewContainer_14792103362010.4146717409795426"></div> <div \
id="LPTitle_14792103362010.8196131050809576" style="top:0px; color:rgb(0,120,215); \
font-weight:normal; font-size:21px; font-family:wf_segoe-ui_light,&quot;Segoe UI \
Light&quot;,&quot;Segoe WP Light&quot;,&quot;Segoe UI&quot;,&quot;Segoe \
WP&quot;,Tahoma,Arial,sans-serif; line-height:21px"> <a \
id="LPUrlAnchor_14792103362020.6236794780630481" \
href="http://www.ibm.com/developerworks/library/j-jws8/" target="_blank" \
style="text-decoration:none">Java Web services: JAXB and JAX-WS in Axis2</a></div> \
<div id="LPMetadata_14792103362030.9501971119642743" style="margin:10px 0px 16px; \
color:rgb(102,102,102); font-weight:normal; \
font-family:wf_segoe-ui_normal,&quot;Segoe UI&quot;,&quot;Segoe \
WP&quot;,Tahoma,Arial,sans-serif; font-size:14px; line-height:14px"> \
www.ibm.com</div> <div id="LPDescription_14792103362040.044494058800585545" \
style="display:block; color:rgb(102,102,102); font-weight:normal; \
font-family:wf_segoe-ui_normal,&quot;Segoe UI&quot;,&quot;Segoe \
WP&quot;,Tahoma,Arial,sans-serif; font-size:14px; line-height:20px; max-height:100px; \
overflow:hidden"> Apache Axis2 supports a range of data-binding technologies, \
including the official Java standard, JAXB 2.x. Axis2 also supports the Java standard \
for Web service configuration, JAX-WS 2.x, as an alternative to its own custom \
configuration technique. Dennis  Sosnoski continues his Java Web services column \
series by demonstrating how you can use each of these Java standards with Axis2 and \
discussing some of the limitations of Axis2's current support for them.</div> </td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
<br>
do you have a&nbsp;Axis2 Server fully operational..&nbsp;<span \
style="font-size:12pt">what does Axis Happiness page say?</span> <p></p>
<p><br>
</p>
<p>http://localhost:8080/axis2-web/HappyAxis.jsp</p>
<p><br>
</p>
<p>MG&gt;http://ServerHostName:ServerPortNumber/axis2/axis2-web/HappyAxis.jsp</p>
<p><br>
</p>
<div id="Signature">Martin <br>
______________________________________________ <br>
<pre style=""><br></pre>
</div>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" \
style="font-size:11pt"><b>From:</b> Sterpu Victor &lt;victor@caido.ro&gt;<br> \
<b>Sent:</b> Monday, November 14, 2016 4:58 PM<br> <b>To:</b> Martin Gainty; \
java-user@axis.apache.org<br> <b>Subject:</b> Re[4]: Raw SOAP XML response</font>
<div>&nbsp;</div>
</div>
<div>
<div>I tired your code but I got a problem. This is what I wrote(I don't have a \
axis2.xml file, I just create the stub with wsdl2java and used the class):</div> \
<div><font size="2">ConfigurationContext configContext = \
ConfigurationContextFactory.createDefaultConfigurationContext();<br> ServiceClient \
sender = new ServiceClient(configContext, null);<br> OperationClient mepClient = \
sender.createClient(ServiceClient.ANON_OUT_IN_OP); <br> MessageContext \
response=mepClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);<br> \
String response_xml = response.getEnvelope().toString();<br> <br>
</font>These lines are executed immediatly after the succesful SOAP call and I \
receive a java.lang.NullPointerException at the line &quot;<span \
id="x8c1ec7b793214058b00410576a27c8a9" style="font-size:12pt; \
font-family:Tahoma"><font size="2">String response_xml =  \
response.getEnvelope().toString();</font></span>&quot;.</div> <div>I traced the SOAP \
response with Fiddler and the answer is &quot;<span lang="EN"><font size="2">&lt;?xml \
version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;soapenv:Envelope \
xmlns:soapenv=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;&lt;soapenv:Body&gt;&lt;dlwmin:storeClinicalDocumentSResponse
  xmlns:dlwmin=&quot;core.des.uti.ro&quot; \
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;&lt;return&gt;&lt;/ \
return&gt;&lt;/dlwmin:storeClinicalDocumentSResponse&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;</font></span>&quot;</div>
 <div>&nbsp;</div>
<div><span id="x8043681d83df4ff996210f1c755c564d">
<div>Thank you.</div>
<div>&nbsp;</div>
<div>------ Original Message ------</div>
</span></div>
<div>From: &quot;Martin Gainty&quot; &lt;<a \
href="mailto:mgainty@hotmail.com">mgainty@hotmail.com</a>&gt;</div> <div>To: \
&quot;java-user@axis.apache.org&quot; &lt;<a \
href="mailto:java-user@axis.apache.org">java-user@axis.apache.org</a>&gt;; \
&quot;Sterpu Victor&quot; &lt;<a \
href="mailto:victor@caido.ro">victor@caido.ro</a>&gt;</div> <div>Sent: 2/11/2016 \
9:28:48 PM</div> <div>Subject: Re: Re[2]: Raw SOAP XML response</div>
<div>&nbsp;</div>
<div id="x0d2087a625724b6985e04b020311850e">
<blockquote type="cite" style="margin-top:3px; padding-top:0px; padding-left:10px; \
margin-left:5px; border-left:1px solid rgb(204,204,204); padding-right:0px; \
margin-right:0px"> <div id="divtagdefaultwrapper" style="font-size:12pt; \
font-family:Arial,Helvetica,sans-serif; color:#000000"> <p><br>
</p>
<div style="color:rgb(0,0,0)">
<div>
<hr tabindex="-1" style="width:98%; display:inline-block">
</div>
<div id="divRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" \
style="font-size:11pt"><b>From:</b> Sterpu Victor &lt;<a \
href="mailto:victor@caido.ro">victor@caido.ro</a>&gt;<br> <b>Sent:</b> Wednesday, \
November 2, 2016 11:57 AM<br> <b>To:</b> Martin Gainty; <a \
href="mailto:java-user@axis.apache.org">java-user@axis.apache.org</a><br> \
<b>Subject:</b> Re[2]: Raw SOAP XML response</font> <div>&nbsp;</div>
</div>
<div>
<div>It didn't work. </div>
<div>This is what I did: I deleted from the directory of Axis2\lib 4 files: \
axiom-jaxb-1.2.19.jar, axiom-api-1.2.19.jar, axiom-dom-1.2.19.jar, \
axiom-impl-1.2.19.jar </div>
<div>and I added these 4 files: \
axiom-api-1.2.20.jar,axiom-dom-1.2.20.jar,axiom-impl-1.2.20.jar,axiom-jaxb-1.2.20.jar.</div>
 <div>I use Axis embeded so I also deleted from my netbeans libraries the old jars \
and added the new ones. </div>
<div>I recompiled and the error remained.</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>------ Original Message ------</div>
<div>From: &quot;Martin Gainty&quot; &lt;<a \
href="mailto:mgainty@hotmail.com">mgainty@hotmail.com</a>&gt;</div> <div>To: &quot;<a \
href="mailto:java-user@axis.apache.org">java-user@axis.apache.org</a>&quot; &lt;<a \
href="mailto:java-user@axis.apache.org">java-user@axis.apache.org</a>&gt;; \
&quot;Sterpu Victor&quot; &lt;<a \
href="mailto:victor@caido.ro">victor@caido.ro</a>&gt;</div> <div>Sent: 2/11/2016 \
4:58:09 PM</div> <div>Subject: Re: Raw SOAP XML response</div>
<div>&nbsp;</div>
<div id="x7cd54d921d72412595d35d385adfd4bb">
<blockquote type="cite" style="margin-top:3px; padding-top:0px; padding-left:10px; \
margin-left:5px; border-left:1px solid rgb(204,204,204); padding-right:0px; \
margin-right:0px"> <div id="divtagdefaultwrapper" style="font-size:12pt; \
font-family:Arial,Helvetica,sans-serif; color:#000000"> <p>possible outdated version \
of axiom</p> <p><br>
</p>
<p></p>
<div>&nbsp;&nbsp;&nbsp;&nbsp; * In Axiom versions prior to 1.2.9, the sequence of \
events was inconsistent if the<br> &nbsp;&nbsp;&nbsp;&nbsp; * underlying stream is \
XOP encoded and caching is disabled (see WSCOMMONS-485). <br>
&nbsp;&nbsp;&nbsp;&nbsp; * This made it necessary for the caller to (partially) \
handle the XOP processing and to use<br> &nbsp;&nbsp;&nbsp;&nbsp; * {@link \
OMAttachmentAccessor#getDataHandler(String)} to retrieve the binary content. <br>
&nbsp;&nbsp;&nbsp;&nbsp; * Starting with 1.2.9 this is no longer be the case: as \
specified above,<br> &nbsp;&nbsp;&nbsp;&nbsp; * the sequence of events is \
*independent of the state of the object model*<br> &nbsp;&nbsp;&nbsp;&nbsp; * and the \
value of the &lt;code&gt;cache&lt;/code&gt; parameter, <br> &nbsp;&nbsp;&nbsp;&nbsp; \
* and ALL binary content is reported through the<br> &nbsp;&nbsp;&nbsp;&nbsp; * \
{@link org.apache.axiom.ext.stax.datahandler.DataHandlerReader} (embedded in \
axiom-api) extension.</div> <br>
<p></p>
<p>upgrade axiom to 1.2.9 a recompile, package, deploy and run with 1.2.9 should \
mitigate the error you are now receiving<br> <br>
*please keep us apprised*</p>
<p><br>
</p>
<div id="Signature">Martin <br>
______________________________________________ <br>
<br>
</div>
<br>
<div style="color:rgb(0,0,0)">
<div>
<div>
<hr tabindex="-1" style="width:98%; display:inline-block">
</div>
</div>
<div id="divRplyFwdMsg" dir="ltr"><font color="#000000" face="Calibri, sans-serif" \
style="font-size:11pt"><b>From:</b> Sterpu Victor &lt;<a \
href="mailto:victor@caido.ro">victor@caido.ro</a>&gt;<br> <b>Sent:</b> Wednesday, \
November 2, 2016 9:37 AM<br> <b>To:</b> <a \
href="mailto:java-user@axis.apache.org">java-user@axis.apache.org</a><br> \
<b>Subject:</b> Raw SOAP XML response</font> <div>&nbsp;</div>
</div>
<div>
<div>Hello</div>
<div>&nbsp;</div>
<div>I&nbsp;need to save the raw SOAP XML response from Axis2(I use axis 2 \
1.7.3).</div> <div>When Axis2 call retusrns an error this code works:&nbsp;</div>
<div>String response = \
sc.getLastOperationContext().getMessageContext(&quot;In&quot;).getEnvelope().toString();</div>
 <div><br>
</div>
<div>MG&gt;//build configurationContext from location of repo and name of \
axis2.xml</div> <div>
<div>MG&gt;<span class="Apple-tab-span" style="white-space:pre"> \
</span>ConfigurationContext configContext = ConfigurationContextFactory</div> \
<div><span class="Apple-tab-span" \
style="white-space:pre"></span>.createConfigurationContextFromFileSystem(&quot;../../repository&quot;,&nbsp; \
//exact location of repository</div> <div><span class="Apple-tab-span" \
style="white-space:pre"></span>&quot;axis2.xml&quot;); &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //exact filename of \
axis2.xml</div> <div><br>
</div>
<div>MG&gt;establish new ServiceClient implementing attributes from \
ConfigurationContext</div> <div>MG&gt;<span class="Apple-tab-span" \
style="white-space:pre"> </span>ServiceClient sender = new \
ServiceClient(configContext, null);</div> <div><br>
</div>
MG&gt;you will&nbsp;need to supply a QName for&nbsp;incoming&nbsp;request and SOAP \
response output</div> <div>
<div>/**</div>
<div>&nbsp; &nbsp; &nbsp;* Operation name used for an anonymous in-out operation \
(meaning we sent a message and receive</div> <div>&nbsp; &nbsp; &nbsp;* a response, \
equivalent to a WSDL In-Out operation).</div> <div>&nbsp; &nbsp; &nbsp;</div>
<div>&nbsp; &nbsp; public static final QName ANON_OUT_IN_OP = new \
QName(Constants.AXIS2_NAMESPACE_URI,</div> <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;&quot;anonOutInOp&quot;,</div> <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp;Constants.AXIS2_NAMESPACE_PREFIX);</div> </div>
<div>*/</div>
<div>MG&gt;<span style="font-size:12pt">OperationClient mepClient = \
sender</span><span style="font-size:12pt">.createClient(ServiceClient.<span>ANON_OUT_IN_OP</span>);&nbsp;</span></div>
 <div><span style="font-size:12pt"><br>
</span></div>
<div><span style="font-size:12pt">MG&gt;ask client to contact axis2 server and pull a \
response back</span></div> <div>MG&gt;MessageContext \
response=mepClient.getMessageContext(<span>WSDLConstants.MESSAGE_LABEL_IN_VALUE)</span>);</div>
 <div><span>
<div>/**</div>
<div>&nbsp; &nbsp; &nbsp;*<span \
style="font-size:12pt">MESSAGE_LABEL_IN_VALUE&nbsp;</span><span \
style="font-size:12pt">Constant to represent the message label &quot;In&quot; which \
is used by the</span></div> <div>&nbsp; &nbsp; &nbsp;* following WSDL 2.0 defined \
MEPs: In-Only, Robust In-Only, In-Out, //Hint:&nbsp;In-Out is your Message \
Exchange</div> <div>&nbsp; &nbsp; &nbsp;* In-Optional-Out, Out-In, \
Out-Optional-In.</div> <div>&nbsp; &nbsp; public static final byte MESSAGE_LABEL_IN = \
0;</div> <div>&nbsp; &nbsp; public static final String MESSAGE_LABEL_IN_VALUE = \
&quot;In&quot;;</div> <div>*/</div>
<div><br>
</div>
</span><span></span></div>
<div>MG&gt;convert soapEnvelope to String</div>
<div>MG&gt;<span style="font-size:12pt">String response \
=response.getEnvelope().toString();</span></div> <div><br>
</div>
<div>MG&gt;?</div>
<div>But when I run a succesful Axis2 call the same code gives the following error: \
&quot;java.lang.IllegalStateException: Can't process next node because caching is \
disabled&quot;</div> <div>&nbsp;</div>
<div>I tryed to enable cache like this, but it didn't work:</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb \
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
ServiceClient sc = (ServiceClient)method_getServiceClient.invoke(objectReflect);<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
ServiceContext srv_context = sc.getServiceContext();<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
srv_context.setCachingOperationContext(true);<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
OperationContext oc= new OperationContext();&nbsp;<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
<span id="x2b23cd8b7a56428da63985ba57beba28" style="font-size:12pt; \
font-family:Tahoma"> oc</span>.setComplete(true);&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
srv_context.setLastOperationContext(<span id="x4f6857c6d2334e5584bd4a0c606490ee" \
style="font-size:12pt; font-family:Tahoma">oc</span>);</div> <div>&nbsp;</div>
<div>Thank you</div>
<div><br>
&nbsp;</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic