Apache camelcxf处理裸样式WSDL

Apache camelcxf处理裸样式WSDL,apache,apache-camel,cxf,Apache,Apache Camel,Cxf,我被一个问题困扰了好一阵子。我有一个裸体风格的WSDL,我将其托管在CXF中 下面是我的soap请求示例: <?xml version="1.0" encoding="UTF-8"?> <XpgIntegratedPaymentRequest xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">

我被一个问题困扰了好一阵子。我有一个裸体风格的WSDL,我将其托管在CXF中

下面是我的soap请求示例:

<?xml version="1.0" encoding="UTF-8"?> 
<XpgIntegratedPaymentRequest 
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
  xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"> 
    <ClientId>RMHP</ClientId> 
    <InputParameters></InputParameters> 
</XpgIntegratedPaymentRequest>

我建议您使用一个工具来生成SOAP请求,比如SoapUI。显然,您没有使用如下所示的有效SOAP请求(未测试):


RMHP
注意周围的
soap:Envelope
soap:Body
标记以及
wem
前缀的正确服务特定命名空间定义(当然,您可以将前缀名称更改为您喜欢的任何值)


附加建议:如果可能,更改web服务的WSDL定义中的默认名称空间。它不应该包含
test:9090
,而是您组织的URI。

Hi我可以通过在SEI“@EndpointProperty(key=“soap.no.validate.parts”,value=“true”)上设置以下属性来使用没有命名空间的请求。但是,现在在响应中,主体以名称空间作为前缀。我也不希望名称空间出现在soap响应中。示例soap resposne”“@user1540430我看到您打开了一个新问题
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <soap:Fault>
            <faultcode>soap:Client</faultcode>
            <faultstring>Unexpected element {http://schemas.xmlsoap.org/soap/envelope/}XpgIntegratedPaymentRequest found.   Expected {http://test:9090/wsx/services/WemXpgPaymentService}XpgIntegratedPaymentRequest.</faultstring>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="ISO-8859-1"?>
<wsdl:definitions name="PWS_WEM_XPG_INTEGRATION" targetNamespace="http://test:9090/wsx/services/WemXpgPaymentService" xmlns:impl="http://test:9090/wsx/services/WemXpgPaymentService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:hc="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
  <wsdl:types>
    <hc:schema xmlns:hc="http://www.w3.org/2001/XMLSchema">         <hc:element name="XpgIntegratedPaymentRequest" type="XpgIntegratedPaymentRequestType">              <hc:annotation>                 <hc:documentation>Root Element</hc:documentation>               </hc:annotation>            </hc:element>           <hc:complexType name="XpgIntegratedPaymentRequestType">             <hc:sequence>                   <hc:element minOccurs="0" name="ClientId" type="hc:string"/>                    <hc:element maxOccurs="unbounded" minOccurs="0" name="InputParameters" type="hc:string"/>                   <hc:element minOccurs="0" name="ReceiverID" type="hc:string"/>                  <hc:element minOccurs="0" name="SecurityKey" type="hc:string"/>             </hc:sequence>          </hc:complexType>       </hc:schema>
    <hc:schema xmlns:hc="http://www.w3.org/2001/XMLSchema">         <hc:element name="XpgIntegratedPaymentResponse" type="XpgIntegratedPaymentResponseType">                <hc:annotation>                 <hc:documentation>Root Element</hc:documentation>               </hc:annotation>            </hc:element>           <hc:complexType name="XpgIntegratedPaymentResponseType">                <hc:sequence>                   <hc:element maxOccurs="unbounded" minOccurs="0" name="ResponseCode" type="hc:string"/>                  <hc:element minOccurs="0" name="ResponseMessage" type="hc:string"/>                 <hc:element minOccurs="0" name="ErrorMessages" type="hc:string"/>               </hc:sequence>          </hc:complexType>       </hc:schema>
  </wsdl:types>
  <wsdl:message name="getWemXpgPaymentRequest">
    <wsdl:part name="parameters" element="XpgIntegratedPaymentRequest">
    </wsdl:part>
  </wsdl:message>
  <wsdl:message name="getWemXpgPaymentRequestResponse">
    <wsdl:part name="parameters" element="XpgIntegratedPaymentResponse">
    </wsdl:part>
  </wsdl:message>
  <wsdl:portType name="WsTransactionImlMetroSoap11">
    <wsdl:operation name="getWemXpgPaymentRequest">
      <wsdl:input message="impl:getWemXpgPaymentRequest">
    </wsdl:input>
      <wsdl:output message="impl:getWemXpgPaymentRequestResponse">
    </wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="WsTransactionImlMetroSoap11SoapBinding" type="impl:WsTransactionImlMetroSoap11">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getWemXpgPaymentRequest">
      <soap:operation soapAction="http://test:9090/wsx/getWemXpgPaymentRequest" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="WemXpgPaymentService_PWS_WEM_XPG_INTEGRATION">
    <wsdl:port name="WsTransactionImlMetroSoap11" binding="impl:WsTransactionImlMetroSoap11SoapBinding">
      <soap:address location="https://test:7443/wsx/services/WemXpgPaymentService_PWS_WEM_XPG_INTEGRATION"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>
org.apache.cxf.interceptor.Fault: Unexpected element XpgIntegratedPaymentRequest found.   Expected {http://test:9090/wsx/services/WemXpgPaymentService}XpgIntegratedPaymentRequest.
at org.apache.cxf.interceptor.DocLiteralInInterceptor.validatePart
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
  soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
    <soap:Body xmlns:wem="http://test:9090/wsx/services/WemXpgPaymentService">
         <wem:XpgIntegratedPaymentRequest> 
             <wem:ClientId>RMHP</wem:ClientId> 
             <wem:InputParameters></wem:InputParameters> 
         </wem:XpgIntegratedPaymentRequest>
   </soap:Body>
</soap:Envelope>