You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by August Visco <av...@columbia.edu> on 2007/10/09 21:55:47 UTC
[AXIS2] false SOAP Response
Has this been identified as a bug in Axis2 v1.1.1? Is it fixed in a
later version? I am experiencing the same problem using Axis2 v1.1.1,
Spring v2.0 and exposing a POJO as a web service.
Thx,
August
> Hi,
>
> sorry for cross posting also on the user mailinglist but I think I found a
> bug.
>
> I use Axis2 with a POJO and the HTTP transport session with in an AJAX
> application. The SOAP response (only the method name) is false for more than
> one request at the same time. The POJO is thread save.
>
> Eg.
> If I send (asynchron) request1 (which takes longer than request2) and than
> request2, the first child oh the SOAP Body of request2 shows the method name
> of request1. I get ns:getDatabaseResponse from the other response but the
> right response should be ns:getDataSetsResponse. If I call the method
> "alone" the response is right.
>
> ->Wrong response
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" <http://schemas.xmlsoap.org/soap/envelope/>><soapenv:Body><ns:getDatabas \
> eResponse xmlns:ns="http://webservice.Test.polo.sun/xsd" <http://webservice.Test.polo.sun/xsd>><ns:return>Base1</ns:return>< \
> ns:return>Base2</ns:return></ns:getDatabaseResponse></soapenv:Body></soapenv:Envelope> \
>
>
>
> ->Right response
> <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" <http://schemas.xmlsoap.org/soap/envelope/>><soapenv:Body><ns:getDataSet \
> sResponse xmlns:ns="http://webservice.Test.polo.sun/xsd" <http://webservice.Test.polo.sun/xsd>><ns:return>Base1</ns:return>< \
> ns:return>Base2</ns:return></ns:getDataSetsResponse></soapenv:Body></soapenv:Envelope> \
>
>
> I also attached some files for testing.
>
> Can somebody help me? Thanks a lot.
>
> Chris
>
>
> *["POJOTest.java" (application/octet-stream)]* <http://marc.info/?l=axis-dev&m=117393549420615&q=p3>
> *["services.xml" (text/xml)]* <http://marc.info/?l=axis-dev&m=117393549420615&q=p4>
>
> <service name="POJOTest" scope="transportsession">
> <description>
> POJOTest Webservice
> </description>
> <messageReceivers>
> <messageReceiver
> mep="http://www.w3.org/2004/08/wsdl/in-only" <http://www.w3.org/2004/08/wsdl/in-only>
> class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
> <messageReceiver
> mep="http://www.w3.org/2004/08/wsdl/in-out" <http://www.w3.org/2004/08/wsdl/in-out>
> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> </messageReceivers>
> <parameter name="ServiceClass">
> pojo.POJOTest
> </parameter>
> </service>
>
> *["pojo.html" (text/html)]* <http://marc.info/?l=axis-dev&m=117393549420615&q=p5>
>
> <html>
> <head>
>
> <script type="text/javascript">
> <!--
>
> var http_request1;
> var http_request2;
>
> function doRequest1(){
>
> document.getElementById('request1').innerHTML = "Loading Data";
>
> http_request1 = false;
>
> if (window.XMLHttpRequest) { // Mozilla, Safari,...
> http_request1 = new XMLHttpRequest();
>
> } else if (window.ActiveXObject) { // IE
> try {
> http_request1 = new ActiveXObject("Msxml2.XMLHTTP");
> } catch (e) {
> try {
> http_request1 = new ActiveXObject("Microsoft.XMLHTTP");
> } catch (e) {}
> }
> }
>
> if (!http_request1) {
> alert('Giving up :( Cannot create an XMLHTTP instance');
> return false;
> }
> http_request1.onreadystatechange = renderRequest1;
> http_request1.open('POST', "/axis2/services/POJOTest", true);
>
>
> var r = "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope \
> xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" <http://schemas.xmlsoap.org/soap/envelope/%5C>><soapenv:Body><ns:method1 \
> xmlns:ns=\"http://pojo/xsd\" <http://pojo/xsd%5C>><ns:param0>Hello1</ns:param0></ns:method1></soapenv:Body> \
> </soapenv:Envelope>";
>
> http_request1.send( r );
> }
>
>
> function renderRequest1(){
>
> if (http_request1.readyState == 4) {
> if (http_request1.status == 200) {
>
>
> var response = http_request1.responseXML;
> //alert( response );
> var tz = response.getElementsByTagName('method1Response').item(0).firstChild.first \
> Child.data;
>
> document.getElementById('request1').innerHTML = tz;
>
>
> } else {
> var error = http_request1.responseText;
> alert( error );
> }
> }
>
> }
>
>
> function doRequest2(){
>
> document.getElementById('request2').innerHTML = "Loading Data";
>
> http_request2 = false;
>
> if (window.XMLHttpRequest) { // Mozilla, Safari,...
> http_request2 = new XMLHttpRequest();
>
> } else if (window.ActiveXObject) { // IE
> try {
> http_request2 = new ActiveXObject("Msxml2.XMLHTTP");
> } catch (e) {
> try {
> http_request2 = new ActiveXObject("Microsoft.XMLHTTP");
> } catch (e) {}
> }
> }
>
> if (!http_request2) {
> alert('Giving up :( Cannot create an XMLHTTP instance');
> return false;
> }
> http_request2.onreadystatechange = renderRequest2;
> http_request2.open('POST', "/axis2/services/POJOTest", true);
>
>
> var r = "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope \
> xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" <http://schemas.xmlsoap.org/soap/envelope/%5C>><soapenv:Body><ns:method2 \
> xmlns:ns=\"http://pojo/xsd\" <http://pojo/xsd%5C>><ns:param0>Hello2</ns:param0></ns:method2></soapenv:Body> \
> </soapenv:Envelope>";
>
> http_request2.send( r );
> }
>
>
> function renderRequest2(){
>
> if (http_request2.readyState == 4) {
> if (http_request2.status == 200) {
>
>
> var response = http_request2.responseXML;
> //alert( response );
> var tz = response.getElementsByTagName('method2Response').item(0);
>
> if(!tz){
> alert("Response Type is wrong");
> }
>
> document.getElementById('request2').innerHTML = tz.firstChild.firstChild.data;;
>
>
> } else {
> var error = http_request2.responseText;
> alert( error );
> }
> }
>
> }
>
>
> function doRequest4(){
>
> document.getElementById('request4').innerHTML = "Loading Data";
>
> http_request4 = false;
>
> if (window.XMLHttpRequest) { // Mozilla, Safari,...
> http_request4 = new XMLHttpRequest();
>
> } else if (window.ActiveXObject) { // IE
> try {
> http_request4 = new ActiveXObject("Msxml2.XMLHTTP");
> } catch (e) {
> try {
> http_request4 = new ActiveXObject("Microsoft.XMLHTTP");
> } catch (e) {}
> }
> }
>
> if (!http_request4) {
> alert('Giving up :( Cannot create an XMLHTTP instance');
> return false;
> }
> http_request4.onreadystatechange = renderRequest4;
> http_request4.open('POST', "/axis2/services/POJOTest", true);
>
>
> var r = "<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope \
> xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" <http://schemas.xmlsoap.org/soap/envelope/%5C>><soapenv:Body><ns:method2 \
> xmlns:ns=\"http://pojo/xsd\" <http://pojo/xsd%5C>><ns:param0>Hello2</ns:param0></ns:login></method2:Body></ \
> soapenv:Envelope>";
>
> http_request4.send( r );
> }
>
>
> function renderRequest4(){
>
> if (http_request4.readyState == 4) {
> if (http_request4.status == 200) {
>
>
> var response = http_request4.responseXML;
> //alert( response );
> var tz = response.getElementsByTagName('method2Response').item(0);
>
> if(!tz){
> alert("Response Type is wrong");
> }
>
> document.getElementById('request4').innerHTML = tz.firstChild.firstChild.data;;
>
>
> } else {
> var error = http_request4.responseText;
> alert( error );
> }
> }
>
> }
>
>
> function doboth(){
>
> doRequest2();
> setTimeout("doRequest1()",1000);
>
>
> }
>
> -->
> </script>
>
> </head>
> <body>
>
> <a href="#" onClick="doRequest1()">Requet1</a>
> <p>
> <a href="#" onClick="doRequest2()">Requet2</a>
> <p>
> <a href="#" onClick="doboth()">Both - Problem</a>
>
> <p>
> <div id="request1"></div>
> <p>
> <div id="request2"></div>
>
> </body>
> </html>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org