This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes Getting error on sending chinese text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Getting error on sending chinese text" Watch "Getting error on sending chinese text" New topic
Author

Getting error on sending chinese text

Suchi Choudhary
Greenhorn

Joined: Jan 20, 2009
Posts: 9
we have project divided into two parts, one is the client and other one act as a server.
we have to call the web services running on the server from the client.

now when i send the chinese text from client to the server then following error has been thrown on the server side with a pop-up at client side "unknown",


java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:414)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
[21-Jan-2009 12:39:13] ERROR :
org.apache.axis2.AxisFault
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:161)
at org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:414)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalArgumentException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102)
... 25 more


when i add <parameter name="enableMTOM">true</parameter> to our services.xml file, the text has been accepted and futher processed with no errors but at the client side a pop-up appears stating

"Client found response content type of multipart/related;boundary=MIMEBoundaryurn_uui"

Do anyone have any idea? please help?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2921
    
    5
Welcome to the CodeRanch!

Given the context of your problem this may be an issue with a mismatch of character encodings somewhere. XML-via-HTTP has the opportunity of a character set/encoding mismatch between the HTTP Content-Type header and the XML declaration. If there is a mismatch the HTTP Content-Type header is used and the encoding in the XML declaration is ignored (see XML on the web has failed).

Another possibility is that somehow a raw XML document fragment parameter/element with an encoding different from the one used in the SOAP envelope got included in the SOAP request making it impossible for the server to process the contents of the request. All of this is of course just a guess because the stack trace isn't all that informative.

How to Get Help with SOAP web services
Suchi Choudhary
Greenhorn

Joined: Jan 20, 2009
Posts: 9
Thanks dear for your reply.


i need to explain a bit more about my problem.

Our client is written in .net while the server in java.
also when we diabled the security header on both the sides, we are able to send chinese character from our client to server.
but if security is enabled on both the side, exception is being thrown on both the client as well as on server side.

i think that may need to work on the security header for this or may be smthing else.

do anyone have any idea for this?
Suchi Choudhary
Greenhorn

Joined: Jan 20, 2009
Posts: 9
one more thing......

On client side:
now we have made the encoding on the client side as unicode, and able to send message to the server.

On server side:
able to receive the message from client and process it, but the message received is not the original one.

for e.g message sent from client is 给主要受理人发送邮件
but message received on server is 给;要受人发邮件

which is quite different.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2921
    
    5
Suchi Choudhary wrote:now we have made the encoding on the client side as unicode, and able to send message to the server.


Which character encoding are you using? For Unicode UTF-8 is the one that usually has the best support.
Suchi Choudhary
Greenhorn

Joined: Jan 20, 2009
Posts: 9
yes we are using UTF-8 as encoding on the client side.
But the message received on server side not the one sent from client, some characters getting replaced or missing as said in my earlier posts.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2921
    
    5
You may want to use something like Apache TCPMon (Tutorial) or java.net tcpmon to capture/view the HTTP request/response pairs so that you can determine whether the characters are lost during client or server processing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting error on sending chinese text
 
Similar Threads
org.apache.axis2.AxisFault: A required header representing a Message Addressing Property is not pres
AxisFault - RPCMessageReceiver
Unable to test my webservice written in java showing Class Not Found Exception
[AXIS2] what's the problem with parameter useOriginalwsdl ?
javax.xml.bind.JAXBException in Axis2 Web Service