0
votes

I've recently started working on a project which uses Mule ESB and have started to work on a mule flow.

I am using Jax-ws to consume a request then use xsl to transform a request which I then try to use jax-ws client to sent a request.

I get the following

wrong number of arguments. Failed to route event via endpoint: org.mule.module.cxf.CxfOutboundMessageProcessor. Message payload is of type: byte[]

Mule flow is as a follow.

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

Please not on my xslt transformation I create a soap request.

1
If you consume a web service why do you use <cxf:jaxws-service instead of <cxf:jaxws-client ??? You need to use <cxf:proxy-service and <cxf:proxy-clientAnirban Sen Chowdhary

1 Answers

0
votes

You need to use Proxy service intead of your code if you need to transform respone by XSLT tranformer ... Some thing like the following :-

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

and please put the XSL in a separate file like transform-outer2inner.xslt and call it through your XSLT Transformer as I shown above and not as code ... And one more thing .. instead of specifying like service="com.store.cs" in <cxf:proxy-service just put the service name directly ... the service name and all other details you will get from wsdl