cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dingweilong (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CXF-2215) can't use non-English character parameter, soap encoding are not consistent
Date Wed, 13 May 2009 02:40:45 GMT

    [ https://issues.apache.org/jira/browse/CXF-2215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12708730#action_12708730
] 

dingweilong commented on CXF-2215:
----------------------------------

The service is published by Tomcat 6 container

the web.xml is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
	http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

	<listener>
		<listener-class>
			org.springframework.web.context.ContextLoaderListener
		</listener-class>
	</listener>

	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			bean.xml,WEB-INF/classes/services.xml</param-value>
	</context-param>


	<servlet>
		<servlet-name>CXFServlet</servlet-name>
		<servlet-class>
			org.apache.cxf.transport.servlet.CXFServlet
		</servlet-class>
	</servlet>

	<servlet-mapping>
		<servlet-name>CXFServlet</servlet-name>
		<url-pattern>/services/*</url-pattern>
	</servlet-mapping>


</web-app>

the cxf config file service.xml in Spring is shown below:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jaxws="http://cxf.apache.org/jaxws"
	xsi:schemaLocation="
	http://www.springframework.org/schema/beans 
	http://www.springframework.org/schema/beans/spring-beans.xsd
	http://cxf.apache.org/jaxws 
	http://cxf.apache.org/schemas/jaxws.xsd">

	<import resource="classpath:META-INF/cxf/cxf.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
	<import resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml"/>
	

	<bean id="CXFGreeter" class="cxf.CXFGreeter"></bean>

	<bean id="LoggingInInterceptor"
		class="org.apache.cxf.interceptor.LoggingInInterceptor" />

	<bean id="LoggingOutInterceptor"
		class="org.apache.cxf.interceptor.LoggingOutInterceptor" />

	<jaxws:endpoint id="CXFGreeterService" implementor="#CXFGreeter"
		address="/Greeter">

		<jaxws:features>
			<bean class="org.apache.cxf.feature.LoggingFeature" />
		</jaxws:features>
	</jaxws:endpoint>

</beans>


by the way, i find the properties in Java environment , there're 2 properties related the
encoding:
sun.jnu.encoding=GBK
file.encoding=GBK

but none of them is GB2312, I was so CONFUSED!


> can't use  non-English character parameter, soap encoding are not consistent
> ----------------------------------------------------------------------------
>
>                 Key: CXF-2215
>                 URL: https://issues.apache.org/jira/browse/CXF-2215
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2
>         Environment: windows xp, tomcat 6.0.18
>            Reporter: dingweilong
>            Priority: Critical
>
> I have use cxf 2.2 to publish a web service in tomcat 6, the only operation in which
is 
> public java.lang.String greetMe( String name);
> when invoke with a parameter in Chinese value, i couldn't get my result. 
> I use log interceptor to get the log below, you see the encoding and the charset is not
consistent
> I track the source code, and see the error when unmarshall invoked.
> you can see the inbound message is parsed allright, but the outbound message is not,
error  occurs.
> I have test there're no problem when i use English parameter.
> who can tell me the reason and fix the problem, thanks!
> Inbound Message 
> ---------------------------- 
> Encoding: GB2312 
> Content-Type: text/xml; charset=UTF-8 
> Headers: {cache-control=[no-cache], content-type=[text/xml; 
> charset=UTF-8], connection=[keep-alive], host=[10.61.0.90:8080], 
> content-length=[182], SOAPAction=[""], user-agent=[Apache CXF 2.2], 
> Accept=[*/*], pragma=[no-cache]} 
> Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/ 
> envelope/"> <soap:Body> <ns2:greetMe xmlns:ns2="http://cxf/"> <arg0>测试
</ 
> arg0> </ns2:greetMe> </soap:Body> </soap:Envelope> 
> Outbound Message 
> --------------------------- 
> Encoding: GB2312 
> Content-Type: text/xml 
> Headers: {} 
> Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/ 
> envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Client </

> faultcode> <faultstring>Unmarshalling Error: Unexpected close tag &lt;/

> ns2:greetMe>; expected &lt;/arg0>.&#xd; 
> at [row,col {unknown-source}]: [1,148] </faultstring> </soap:Fault> </

> soap:Body> </soap:Envelope> 
> and the exception is below:
> Interceptor has thrown exception, unwinding now 
> org.apache.cxf.interceptor.Fault: Unmarshalling Error: Unexpected 
> close tag </ns2:greetMe>; expected </arg0>. 
> at [row,col {unknown-source}]: [1,148] 
>         at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall 
> (JAXBEncoderDecoder.java:622) 
>         at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall 
> (JAXBEncoderDecoder.java:527) 
>         at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java: 
> 108) 
>         at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage 
> (DocLiteralInInterceptor.java:102) 
>         at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept 
> (PhaseInterceptorChain.java:236) 
>         at org.apache.cxf.transport.ChainInitiationObserver.onMessage 
> (ChainInitiationObserver.java:89) 
>         at org.apache.cxf.transport.servlet.ServletDestination.invoke 
> (ServletDestination.java:99) 
>         at 
> org.apache.cxf.transport.servlet.ServletController.invokeDestination 
> (ServletController.java:337) 
>         at org.apache.cxf.transport.servlet.ServletController.invoke 
> (ServletController.java:182) 
>         at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke 
> (AbstractCXFServlet.java:163) 
>         at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost 
> (AbstractCXFServlet.java:141) 
>         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:413) 
>         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:210) 
>         at org.apache.catalina.core.StandardContextValve.invoke 
> (StandardContextValve.java:174) 
>         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:151) 
>         at org.apache.coyote.http11.Http11Processor.process 
> (Http11Processor.java:870) 
>         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:685) 
>         at java.lang.Thread.run(Thread.java:619) 
> Caused by: javax.xml.bind.UnmarshalException 
> - with linked exception: 
> [com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </ 
> ns2:greetMe>; expected </arg0>. 
> at [row,col {unknown-source}]: [1,148]] 
>         at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.handleStreamExcep­tion 
> (UnmarshallerImpl.java:426) 
>         at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0 
> (UnmarshallerImpl.java:362) 
>         at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal 
> (UnmarshallerImpl.java:339) 
>         at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall 
> (JAXBEncoderDecoder.java:607) 
>         ... 29 more 
> Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag 
> </ns2:greetMe>; expected </arg0>. 
> at [row,col {unknown-source}]: [1,148] 
>         at com.ctc.wstx.sr.StreamScanner.constructWfcException 
> (StreamScanner.java:630) 
>         at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java: 
> 461) 
>         at com.ctc.wstx.sr.BasicStreamReader.reportWrongEndElem 
> (BasicStreamReader.java:3256) 
>         at com.ctc.wstx.sr.BasicStreamReader.readEndElem 
> (BasicStreamReader.java:3198) 
>         at com.ctc.wstx.sr.BasicStreamReader.nextFromTree 
> (BasicStreamReader.java:2830) 
>         at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java: 
> 1019) 
>         at org.apache.cxf.staxutils.DepthXMLStreamReader.next 
> (DepthXMLStreamReader.java:220) 
>         at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge 
> (StAXStreamConnector.java:225) 
>         at 
> com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0 
> (UnmarshallerImpl.java:360) 
>         ... 31 more 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message