2014-06-19 1 views
0

액센트가있는 SOAPAction에 문제가 있습니다.CXF JaxWs 엔드 포인트가 동작에 액센트가있을 때 '주어진 SOAPAction이 작업과 일치하지 않습니다'라는 문구가 표시됩니다.

제 3 자 WSDL에서 CXF wsdl2java 플러그인을 사용하여 Java 클래스를 생성했습니다. 생성 된 클래스를 사용하여 CXF 기반 클라이언트 및 서버를 개발했습니다. 서버 측에서 요청이 잘못을 표시하면서

2014-06-19 11:45:08,423 [qtp1051344475-17] WARN - Interceptor for {http://simulator.be.connectors.cam/}RIBSOAPSoapImplService#{http://tempuri.org/}Opération_1 has thrown exception, unwinding now 
org.apache.cxf.interceptor.Fault: The given SOAPAction http://tempuri.org/RIB_SOAP/Opération_1 does not match an operation. 
    at org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor$SoapActionInAttemptTwoInterceptor.handleMessage(SoapActionInInterceptor.java:188) 
    at org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor$SoapActionInAttemptTwoInterceptor.handleMessage(SoapActionInInterceptor.java:163) 
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272) 
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) 
    at ... 

클라이언트 측의 요청의 로그는이 SOAPAction의 올바른 값을 보여줍니다 문제는 서버가 다음과 같은 오류와 클라이언트의 요청을 얻기 위해 실패 할 것입니다 값.

클라이언트 측에서 요청은 다음과 같습니다

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> 

-------------------------------------- 

서버 측에서 요청은 다음과 같습니다

당신이 로그에서 볼 수 있듯이
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> 

-------------------------------------- 

에서, UTF-8은 사용 인코딩입니다 모든 수준에서. 그러나 어떤 이유로 서버 측에서 SOAPAction이 ISO-8859-1을 사용하여 디코딩되었습니다.

사용 된 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> 

봄의 conf : 서버에 대한

<?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> 

봄의 conf :

<?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> 

답변

1

this discussion in CXF Users Mainling List을 참조하십시오. Aki에서 언급했듯이 HTTP 사양에서는 HTTP 헤더가 US-ASCII 문자 만 사용해야합니다 (rfc2822 참조). 그리고 Daniel과 Aki에 의해 언급 되었 듯이, US-ASCII 문자가 필요없는 경우에 대비하여 rfc2047 사양을 사용해야합니다.

이 문제에 대한 해결책은 US-ASCII 문자가 아닌 문자 (악센트 부호가있는 문자 포함) 사용을 피하는 것입니다.

1

는 HTTP 스펙에 따르면, 모든이 HTTP 헤더는 ISO-8859-1으로되어 있습니다. 비 ISO-8859-1 문자를 헤더 (http://tools.ietf.org/html/rfc2047)로 인코딩하는 방법에 대한 별도의 사양이 있지만 JDK의 HTTPUrlConnection 객체가 지원하는지 여부는 확실하지 않습니다. 나는 또한 다른 비누 클라이언트가 그것을 지원할 것인지 확실하지 않다.

SOAPAction 값이 ISO-8859-1과 호환되는지 확인하는 것이 좋습니다.

+0

감사합니다. @ 다니엘. 너의 의도를 알 겠어. UTF-8을 사용하여 SOAPAction 헤더를 인코딩하는 클라이언트 측에서 HTTP 사양에 따라 ISO-8859-1을 사용해야하므로 CXF의 버그라고 생각하십니까? – Younes

관련 문제