soap - CXF JaxWs Endpoint fail with 'The given SOAPAction does not match an operation' when the action contains accents -
i have issue soapaction contains accents.
from third-party wsdl, have generated java classes using cxf wsdl2java plugin. using generated classes, have developed cxf-based client , server. problem server fail client's request next error :
2014-06-19 11:45:08,423 [qtp1051344475-17] warn - interceptor {http://simulator.be.connectors.cam/}ribsoapsoapimplservice#{http://tempuri.org/}opération_1 has thrown exception, unwinding org.apache.cxf.interceptor.fault: given soapaction http://tempuri.org/rib_soap/opération_1 not match operation. @ org.apache.cxf.binding.soap.interceptor.soapactionininterceptor$soapactioninattempttwointerceptor.handlemessage(soapactionininterceptor.java:188) @ org.apache.cxf.binding.soap.interceptor.soapactionininterceptor$soapactioninattempttwointerceptor.handlemessage(soapactionininterceptor.java:163) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:272) @ org.apache.cxf.transport.chaininitiationobserver.onmessage(chaininitiationobserver.java:121) @ ...
the log of request @ client side shows right value of soapaction while request @ server side shows wrong value.
the request @ client side :
2014-06-19 11:45:08,349 [main] info - outbound message --------------------------- id: 1 address: http://localhost:17081/simulator/rib/ws encoding: utf-8 http-method: post content-type: text/xml headers: {accept=[*/*], connection=[keep-alive], soapaction=["http://tempuri.org/rib_soap/opération_1"]} payload: <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <ns3:opération_1 xmlns:ns2="http://rib_inschema" xmlns:ns3="http://tempuri.org/" xmlns:ns4="http://rib_outschema"> <ns2:root> <rib>1234567890</rib> </ns2:root> </ns3:opération_1> </soap:body> </soap:envelope> --------------------------------------
the request @ server side :
2014-06-19 11:45:08,408 [qtp1051344475-17] info - inbound message ---------------------------- id: 2 address: http://localhost:17081/simulator/rib/ws encoding: utf-8 http-method: post content-type: text/xml; charset=utf-8 headers: {accept=[*/*], cache-control=[no-cache], connection=[keep-alive], content-length=[339], content-type=[text/xml; charset=utf-8], host=[localhost:17081], pragma=[no-cache], soapaction=["http://tempuri.org/rib_soap/opération_1"], user-agent=[apache cxf 2.7.10]} payload: <?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:body> <ns3:opération_1 xmlns:ns2="http://rib_inschema" xmlns:ns3="http://tempuri.org/" xmlns:ns4="http://rib_outschema"> <ns2:root> <rib>1234567890</rib> </ns2:root> </ns3:opération_1> </soap:body> </soap:envelope> --------------------------------------
as can see logs, utf-8 used encoding @ levels. however, reason, @ server side, soapaction has been decoded using iso-8859-1.
the used wsdl :
<?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textmatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s1="http://rib_inschema" xmlns:s="http://www.w3.org/2001/xmlschema" xmlns:s2="http://rib_outschema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetnamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">biztalk assembly "bts, version=1.0.0.0, culture=neutral, publickeytoken=dab3109d17486051" published web service. </wsdl:documentation> <wsdl:types> <s:schema elementformdefault="qualified" targetnamespace="http://tempuri.org/"> <s:import namespace="http://rib_inschema" /> <s:import namespace="http://rib_outschema" /> <s:element name="opération_1"> <s:complextype> <s:sequence> <s:element minoccurs="0" maxoccurs="1" ref="s1:root" /> </s:sequence> </s:complextype> </s:element> <s:element name="opération_1response"> <s:complextype> <s:sequence> <s:element minoccurs="0" maxoccurs="1" ref="s2:root" /> </s:sequence> </s:complextype> </s:element> </s:schema> <s:schema elementformdefault="qualified" targetnamespace="http://rib_inschema"> <s:element name="root"> <s:complextype> <s:sequence> <s:element minoccurs="0" maxoccurs="1" form="unqualified" name="rib" type="s:string" /> </s:sequence> </s:complextype> </s:element> </s:schema> <s:schema elementformdefault="qualified" targetnamespace="http://rib_outschema"> <s:element name="root"> <s:complextype> <s:sequence> <s:element minoccurs="0" maxoccurs="1" form="unqualified" name="numcompte" type="s:string" /> <s:element minoccurs="0" maxoccurs="1" form="unqualified" name="nom" type="s:string" /> <s:element minoccurs="0" maxoccurs="1" form="unqualified" name="prenom" type="s:string" /> <s:element minoccurs="0" maxoccurs="1" form="unqualified" name="agence" type="s:string" /> <s:element minoccurs="0" maxoccurs="1" form="unqualified" name="agenceadresse" type="s:string" /> <s:element minoccurs="0" maxoccurs="1" form="unqualified" name="rib" type="s:string" /> </s:sequence> </s:complextype> </s:element> </s:schema> </wsdl:types> <wsdl:message name="opération_1soapin"> <wsdl:part name="parameters" element="tns:opération_1" /> </wsdl:message> <wsdl:message name="opération_1soapout"> <wsdl:part name="parameters" element="tns:opération_1response" /> </wsdl:message> <wsdl:porttype name="rib_soapsoap"> <wsdl:operation name="opération_1"> <wsdl:input message="tns:opération_1soapin" /> <wsdl:output message="tns:opération_1soapout" /> </wsdl:operation> </wsdl:porttype> <wsdl:binding name="rib_soapsoap" type="tns:rib_soapsoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="opération_1"> <soap:operation soapaction="http://tempuri.org/rib_soap/opération_1" style="document" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="rib_soapsoap12" type="tns:rib_soapsoap"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="opération_1"> <soap12:operation soapaction="http://tempuri.org/rib_soap/opération_1" style="document" /> <wsdl:input> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="rib_soap"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">biztalk assembly "bts, version=1.0.0.0, culture=neutral, publickeytoken=dab3109d17486051" published web service. </wsdl:documentation> <wsdl:port name="rib_soapsoap" binding="tns:rib_soapsoap"> <soap:address location="http://localhost/bts_proxy/rib_soap.asmx" /> </wsdl:port> <wsdl:port name="rib_soapsoap12" binding="tns:rib_soapsoap12"> <soap12:address location="http://localhost/bts_proxy/rib_soap.asmx" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
spring conf client:
<?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:p="http://www.springframework.org/schema/p" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" 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 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd " > <!--.~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~--> <!--.~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~--> <http-conf:conduit name=".*"> <http-conf:client connectiontimeout="30000" receivetimeout="30000" /> </http-conf:conduit> <jaxws:client id="ribwebserviceclient" serviceclass="org.tempuri.ribsoapsoap" address="${ws.rib.url}" > <jaxws:features> <bean class="org.apache.cxf.feature.loggingfeature" > <property name="prettylogging" value="true" /> </bean> </jaxws:features> <jaxws:properties> <entry key="exceptionmessagecauseenabled" value="true" /> <entry key="faultstacktraceenabled" value="true" /> </jaxws:properties> </jaxws:client> <!--.~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~--> </beans>
spring conf server:
<?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:p="http://www.springframework.org/schema/p" 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-servlet.xml" /> <!--.~~~~~~~~..~~~~~~~~..~~~~~~~~--> <jaxws:endpoint id="ribwebserviceendpoint" implementor="#ribwebservice" address="${ws.rib.url}" > <jaxws:features> <bean class="org.apache.cxf.feature.loggingfeature" > <property name="prettylogging" value="true" /> </bean> </jaxws:features> <jaxws:properties> <entry key="exceptionmessagecauseenabled" value="true" /> <entry key="faultstacktraceenabled" value="true" /> </jaxws:properties> </jaxws:endpoint> <!--.~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~..~~~~~~~~--> </beans>
according http spec, http headers supposed iso-8859-1. there separate spec how encode non-iso-8859-1 characters header (http://tools.ietf.org/html/rfc2047) i'm not sure if httpurlconnection object in jdk supports or not. i'm not sure if other soap client back upwards either.
i suggest making sure soapaction values iso-8859-1 compatible.
soap cxf action non-ascii-characters
No comments:
Post a Comment