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 joinville <in...@phoros.co.uk> on 2007/06/13 16:01:28 UTC

[AXIS2] Third party client issues

Hi All,

I have a third party application which is connecting to my Axis web service,
but I have come across two issues.

1. StringIndexOutOfBoundsException

When the client message arrives at the Axis 2 application, it fails with a
StringIndexOutOfBoundsException:

13 Jun 2007 10:02:10,368 ERROR [AxisServlet:114] 
java.lang.StringIndexOutOfBoundsException: String index out of range: 0

I captured the request using tcpmon:

POST /axis2/services/OTAMessageService HTTP/1.1

SOAPAction: 

Content-Type: text/xml; charset="utf-8"

Content-Length: 7996

Cache-Control: no-cache

Pragma: no-cache

User-Agent: Java/1.4.2_09

Host: 192.168.2.2:8088

Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

Connection: keep-alive



<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body>
<message body here />
</SOAP-ENV:Body></SOAP-ENV:Envelope>

However, when I send this message from my test client it works fine. Tcpmon
capture here:

POST /axis2/services/OTAMessageService HTTP/1.1

SOAPAction: "urn:anonOutInOp"

User-Agent: Axis2

Host: 192.168.2.2:8088

Transfer-Encoding: chunked

Content-Type: text/xml; charset=UTF-8



f9c

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header
/><soapenv:Body><SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
	<SOAP-ENV:Header />
	<SOAP-ENV:Body>
<message body here>
		</SOAP-ENV:Body>
</SOAP-ENV:Envelope></soapenv:Body></soapenv:Envelope>

0


I am fairly new to Axis, and can see no reason why this message fails from
the external client, yet succeeds from the internal, Axis2 client. Any ideas
would be appreciated.

2. External client requires SOAP Version 1.1

The external client requires a content-type of text/xml. In the above
example, Axis2 sent a failure message to the external client due to the
StringIndexOutOfBoundsException: 

HTTP/1.1 500 Internal Server Error

Server: Apache-Coyote/1.1

X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA
date=200605151000)/Tomcat-5.5

Content-Type: application/soap+xml;charset=UTF-8

Transfer-Encoding: chunked

Date: Wed, 13 Jun 2007 09:02:32 GMT

Connection: close



300

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Header><wsa:ReplyTo><wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address></wsa:ReplyTo><wsa:MessageID>urn:uuid:6985CE8B9EB1E52A7F1181725352765</wsa:MessageID><wsa:Action>http://www.w3.org/2005/08/addressing/soap/fault</wsa:Action></soapenv:Header><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Sender</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text
xml:lang="en-US">java.lang.StringIndexOutOfBoundsException: String index out
of range:
0</soapenv:Text></soapenv:Reason><soapenv:Detail></soapenv:Detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

0

However, the external client cannot deal with this due to the content-type
(application/soap+xml); it fails with this error:

Jun 11 17:53:22] [65328] ERROR [SOAP_] (MessageClientSAAJ.java:117) - Error
invoking web service: java.security.PrivilegedActionException:
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to inter

nalize message

com.sun.xml.messaging.saaj.SOAPExceptionImpl:
java.security.PrivilegedActionException:
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message

        at
com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:128)

        at
com.openjaw.messaging.MessageClientSAAJ.call(MessageClientSAAJ.java:114)

        at
com.openjaw.messaging.MessageClientSAAJ.sendMessage(MessageClientSAAJ.java:236)

        at
com.openjaw.messaging.MessageClientBase.sendMessage(MessageClientBase.java:249)

        at
com.openjaw.connection.soap.SOAPThread.process(SOAPThread.java:74)

        at com.openjaw.connection.ThreadBase.run(ThreadBase.java:201)

        at java.lang.Thread.run(Thread.java:534)

Caused by: java.security.PrivilegedActionException:
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message

        at java.security.AccessController.doPrivileged(Native Method)

        at
com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)

        ... 6 more

Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to
internalize message

        at
com.sun.xml.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:194)

        at
com.sun.xml.messaging.saaj.soap.ver1_1.Message1_1Impl.<init>(Message1_1Impl.java:43)

        at
com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl.createMessage(SOAPMessageFactory1_1Impl.java:32)

        at
com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:357)

        at
com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:151)

        ... 8 more

Caused by: com.sun.xml.messaging.saaj.soap.SOAPVersionMismatchException:
Cannot create message: incorrect content-type for SOAP version. Got:
application/soap+xml; charset=UTF-8 Expected: text/xml

        at
com.sun.xml.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:136)

        ... 12 more

I am trying to understand how to set the response SOAP Version or
content-type explicitly. 

In this instance the response is generated by Axis itself. I also get
content issues when returning a success message is generated by my service.

When I send a reply to my internal client I get:

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA
date=200605151000)/Tomcat-5.5

Content-Type: text/xml;charset=UTF-8

Transfer-Encoding: chunked

Date: Wed, 13 Jun 2007 10:02:51 GMT

However, when I send a reply to a browser request for this service (it;s
just to test the response, it does nothing) I get:

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

X-Powered-By: Servlet 2.4; JBoss-4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA
date=200605151000)/Tomcat-5.5

Content-Type: application/xml;charset=UTF-8

Transfer-Encoding: chunked

Date: Wed, 13 Jun 2007 12:56:01 GMT

So I have three different content-types being sent in three different
scenarios:

a. error message from Axis 2 is application/soap+xml
b. success message to internal Axis2 client in text/xml
c. success message to browser test call is application/xml

Can anyone point me to the correct place to understand these differences? I
have searched the various forums and sites to no avail.

Thanks and Regards,

Chris Bowman
(info at phoros dot co dot uk)
 


-- 
View this message in context: http://www.nabble.com/-AXIS2--Third-party-client-issues-tf3914880.html#a11100141
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