0
votes

I'm using mule 3.2.0 and I'm invoking muleclient.send method in java-class which sends soap-request to a mule flow(not present here), which sends it to the http endpoint which receives request, logs it to my db with proxy pattern and propagates it to "ServiceFlow" which has Dispatcher transformer - java class, which uses invocation of MuleClient.send(String url, Object payload, Map messageProperties) method to dispatch one object of the payload array to an endpoint. Then it gets processed by cxf:jax-ws-client, logged to a db once again and transferred to another instance of Dispatcher (where incoming payload is again of type Object[]). There I have http endpoint which does the service invocation. This part works okay. But trouble appears at the receiving of the response. I've put Test1(2,3,4) transformers to print the invocation chain in my flows (They just do the System.out.println()), and saw that they're invoked in a weird sequence: I have it like 1,3 then TestTransformer (which is also the sysouter) then I get the error "NullPayload" in the caller of the main flow "Service flow" and then I receive the Test 4 and Test 2 outs. The responseTransformer-refs in patterns "1Proxy" are ignored, so as in "ServiceProxy". I've been looking for the solution for like a week now, and can't find it. In debugging, I can see that transformer called "TestTransformer" in has expected payload (Object[]) but when I receive it in my class caller, it appears as "NullPayload". I can see now that one of my endpoints has the path element instead of ref, not sure if this cause any impact on flow, but will check it. Also tried to use the "response" block to ensure my flow runs as expected. Any suggestions appreciated. Thanks

Here is what my config looks like:

<http:endpoint  name="httpService"  address="${service.soap}" exchange-pattern="request-response" responseTimeout="${timeout}" />
<vm:endpoint  name="vmService"  path="vmService" exchange-pattern="request-response"/>

<pattern:web-service-proxy 
    name="ServiceProxy" 
    inboundEndpoint-ref="httpService" 
    transformer-refs="to-string logging" 
    responseTransformer-refs="to-string logging"
    outboundEndpoint-ref="vmService" />

<flow name="ServiceFlow" >
    <inbound-endpoint ref="vmService"/>
    <cxf:jaxws-service serviceClass="pkg.ServiceImpl" wsdlLocation="${service.wsdl}" enableMuleSoapHeaders="false" validationEnabled="true"/>
  <custom-transformer class="pkg.Dispatcher">
     <spring:property name="vmFlowPath" value="vm.logService"/>
  </custom-transformer>
  <custom-transformer name="TestTransformer" class="pkg.TestTransformer"/>
</flow>

<vm:endpoint  name="vm1In"  path="vm1In" exchange-pattern="request-response"/>
<vm:endpoint  name="vm1Out"  path="vm1Out" exchange-pattern="request-response"/>

<custom-transformer name="arrayGenerator" class="pkg.ArrayGenerator"/>
<custom-transformer name="objectExtractor" class="pkg.ObjectExtractor"/>
<custom-transformer name="faultChecker" class="pkg.FaultChecker"/>  
<custom-transformer name="objectLogging" class="pkg.ObjectLogger">

<pattern:web-service-proxy 
    name="1Proxy" 
    inboundEndpoint-ref="vm1In" 
    transformer-refs="arrayGenerator objectLogging" 
    responseTransformer-refs="objectLogging objectExtractor faultChecker"
    outboundEndpoint-ref="vm1Out" />

<flow name="logService">

<vm:inbound-endpoint path="vm.logService exchange-pattern="request-response"/>

<custom-transformer class="Test1"/>

<vm:outbound-endpoint ref="vm1In">
    <cxf:jaxws-client 
        serviceClass="pkg.ServiceImpl" 
        operation="import"
        enableMuleSoapHeaders="false"/>
    <object-to-string-transformer/>

</vm:outbound-endpoint>
<object-to-xml-transformer> 

<xm:xml-to-object-transformer returnClass="pkg.WSResponseClass"/>

<custom-transformer class="Test2"/>
</flow>

<flow name="DispatcherToServiceFlow">
    <custom-transformer class="Test3"/>
    <vm:inbound-endpoint path="vm1.Out"/>

    <custom-transformer class="pkg.Dispatcher">
        <spring:property name="vmFlowPath" value="vm.import"/>
    </custom-transformer>

</flow> 

<flow name="import">
    <vm:inbound-endpoint path="vm.import" exchange-pattern="request-response"/>

    <http:outbound-endpoint address="${importService}" responseTimeout="${timeout}" exchange-pattern="request-response" />

    <object-to-string-transformer/>
<custom-transformer class="Test4"/>
</flow>
1

1 Answers

1
votes

well, my problem really was the "path" element instead of referring to an existing vm endpoint with "ref" element like

<inbound-endpoint ref="vm1Out"/>