Mule ESB JAX-WS客户端 - 参数数量错误且Payload为byte []

时间:2014-06-16 10:44:19

标签: jax-ws mule esb

我最近开始研究一个使用Mule ESB的项目,并开始研究骡子流。

我正在使用Jax-ws来使用请求,然后使用xsl转换请求,然后尝试使用jax-ws客户端发送请求。

我得到以下

  

错误的参数数量。无法通过端点路由事件:org.mule.module.cxf.CxfOutboundMessageProcessor。消息有效负载的类型为:byte []

骡子流如下。

<flow name="createFolder" doc:name="createFolder">
    <http:inbound-endpoint exchange-pattern="request-response"
        doc:name="HTTP" host="${url}" path="cc" port="8088" mimeType="multipart/related"/>
    <cxf:jaxws-service namespace="http://tempuri.org/"
        service="com.store.cs" 
        doc:name="Proxy Service" enableMuleSoapHeaders="false" serviceClass="com.store.cs" validationEnabled="true">
        <cxf:schemaLocations>
            <cxf:schemaLocation>store/store.xsd</cxf:schemaLocation>
        </cxf:schemaLocations>
    </cxf:jaxws-service>
    <mulexml:xslt-transformer maxIdleTransformers="2" maxActiveTransformers="5"  doc:name="XSLT" xsl-file="xslt/cmsToStore/cmsToStore.xslt">
        <mulexml:xslt-text></mulexml:xslt-text>
           <mulexml:context-property key="repository_id" value="${repositoryId}"/>
            <mulexml:context-property key="cf_workspace" value="${casefileWorkspace}"/> 
    </mulexml:xslt-transformer>
    <cxf:jaxws-client operation="createFolder"  port="ObjectServicePort" mtomEnabled="true" doc:name="Proxy Client" wsdlLocation="alfresco/cmis_ws.wsdl" clientClass="com.alfresco.cmis.ws.ObjectService"/>
    <http:outbound-endpoint exchange-pattern="request-response" host="${a_url}}" port="8080" path="alfresco/cmisws/ObjectService" method="POST" doc:name="HTTP" mimeType="multipart/related"/>
</flow>

请不要在我的xslt转换中创建一个soap请求。

1 个答案:

答案 0 :(得分:0)

如果您需要通过XSLT转换器转换respone,则需要使用代码的代理服务intead ......如下所示: -

<flow name="SOAP2SOAPFlow2" doc:name="SOAP-2-SOAP proxy using CXF">
    <http:inbound-endpoint exchange-pattern="request-response" 
        host="localhost" port="8081" path="cc" doc:name="HTTP"/>
    <cxf:proxy-service namespace="urn:greeter:GreeterResponder:1" 
        service="GreeterResponderService" payload="body" 
        wsdlLocation="schemas/interactions/GreeterInteraction/GreeterInteraction_1.0.wsdl" 
        enableMuleSoapHeaders="false" doc:name="SOAP"/>        
<mulexml:xslt-transformer 
        maxIdleTransformers="2" maxActiveTransformers="5" 
        outputEncoding="UTF-8" doc:name="Transform from outer to inner" 
        xsl-file="transform-outer2inner.xslt" encoding="UTF-8" 
        returnClass="java.lang.String"/>
<cxf:proxy-client payload="body" enableMuleSoapHeaders="true"/ >
    <http:outbound-endpoint exchange-pattern="request-response" 
        address="http://localhost:8080/alfresco/cmisws/ObjectService" doc:name="HTTP" />
</flow>

并且请将XSL放在一个单独的文件中,例如 transform-outer2inner.xslt ,然后通过您的XSLT Transformer调用它,如上所示,而不是代码...还有一件事......在service="com.store.cs"中指定<cxf:proxy-service只是直接放置服务名称...服务名称以及您将从wsdl获得的所有其他详细信息