简体   繁体   中英

WSO2 Service Chaining Request to Service not send to server but ends in default fail sequence without details

I am performing a PoC with WSO2 ESB.

I have 3 service stubs, 1 is de request to Personen and it sends back a CSV list of persons with their organisation.

Then two services for each organisatie (Organisation1 and Organisation2) that accepts this CSV string in it's addPersoon method.

Very straight forward, iteration stuff. But when I created the SOAP message and send it to the services it is not received but instead ends in the default "fault" sequence and there's no hint as to what is wrong:

TID: [0] [ESB] [2015-03-12 09:25:38,295]  INFO {org.apache.synapse.mediators.builtin.LogMediator} -  To: http://127.0.0.1:8080/Organisatie2/Organisatie2, WSAction: addPersoon, SOAPAction: addPersoon, MessageID: urn:uuid:368f931c-2b26-48cc-a84c-1cd27175154e, Direction: response, MESSAGE = Executing default "fault" sequence, ERROR_CODE = null, ERROR_MESSAGE = null, ERROR_DETAIL = null, ERROR_EXCEPTION = null, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns2:addPersoon xmlns:ns2="http://services.esb.phonax.com/"><persoon>ORG2, Verbaan, Georgina</persoon></ns2:addPersoon></soapenv:Body></soapenv:Envelope> {org.apache.synapse.mediators.builtin.LogMediator}

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://ws.apache.org/ns/synapse">
   <registry provider="org.wso2.carbon.mediation.registry.WSO2Registry">
    <parameter name="cachableDuration">15000</parameter>
   </registry>
 <proxy name="Distributor"
        transports="http"
        startOnLoad="true"
        trace="enable"
        statistics="enable">
    <description/>
    <target>
       <inSequence>
          <send receive="PersonenLijst">
             <endpoint key="Personen"/>
          </send>
       </inSequence>
       <outSequence>
          <aggregate>
             <completeCondition>
                <messageCount/>
             </completeCondition>
             <onComplete xmlns:s12="http://www.w3.org/2003/05/soap-envelope"
                         xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/"
                         expression="/s11:Envelope/s11:Body/child::*[position()=1] | /s12:Envelope/s12:Body/child::*[position()=1]">
                <drop/>
             </onComplete>
          </aggregate>
          <send/>
       </outSequence>
    </target>
    <publishWSDL uri="http://192.168.178.23:8080/Personen/Personen?wsdl"/>
 </proxy>
 <endpoint name="Organisatie2">
    <wsdl service="Organisatie2"
          port="Organisatie2Port"
          uri="http://192.168.178.23:8080/Organisatie2/Organisatie2?wsdl"/>
 </endpoint>
 <endpoint name="Personen">
    <wsdl service="Personen"
          port="PersonenPort"
          uri="http://192.168.178.23:8080/Personen/Personen?wsdl"/>
 </endpoint>
 <endpoint name="Organisatie1">
    <wsdl service="Organisatie1"
          port="Organisatie1Port"
          uri="http://192.168.178.23:8080/Organisatie1/Organisatie1?wsdl"/>
 </endpoint>
 <sequence name="DistributePerson">
    <payloadFactory media-type="xml">
       <format>
          <ns2:addPersoon xmlns:ns2="http://services.esb.phonax.com/">
             <persoon xmlns="">$1</persoon>
          </ns2:addPersoon>
       </format>
       <args>
          <arg evaluator="xml" expression="//return[1]"/>
       </args>
    </payloadFactory>
    <header name="Action" value="addPersoon"/>
    <log level="full"/>
    <switch xmlns:m0="http://services.samples" source="//persoon[1]">
       <case regex="    ORG1.*">
          <header name="To" value="http://127.0.0.1:8080/Organisatie1/Organisatie1"/>
          <log level="full">
             <property name="MSG" value="ORG1 BABY!"/>
          </log>
          <send>
             <endpoint key="Organisation1"/>
          </send>
       </case>
       <case regex="    ORG2.*">
          <header name="To" value="http://127.0.0.1:8080/Organisatie2/Organisatie2"/>
          <log level="full">
             <property name="MSG" value="ORG2 BABY!"/>
          </log>
          <send>
             <endpoint key="Organisation2"/>
          </send>
       </case>
       <default>
          <log>
             <property name="symbol" expression="fn:concat('NO CASE FOR - ', //persoon[1])"/>
          </log>
          <drop/>
       </default>
    </switch>
    <send/>
 </sequence>
 <sequence name="PersonenLijst">
    <log level="full"/>
    <iterate xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
             xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"
             id="personID"
             expression="//return">
       <target sequence="DistributePerson"/>
    </iterate>
 </sequence>
 <sequence name="fault">
    <log level="full">
       <property name="MESSAGE" value="Executing default &#34;fault&#34; sequence"/>
       <property name="ERROR_CODE" expression="get-property('ERROR_CODE')"/>
       <property name="ERROR_MESSAGE" expression="get-property('ERROR_MESSAGE')"/>
       <property name="ERROR_DETAIL" expression="get-property('ERROR_DETAIL')"/>
       <property name="ERROR_EXCEPTION" expression="get-property('ERROR_EXCEPTION')"/>
    </log>
    <drop/>
 </sequence>
 <sequence name="main">
    <log/>
    <drop/>
 </sequence>

Any suggestions for this newbie are welcome Thanks!

When you say

"... and send it to the services it is not received but instead ends in the default "fault" sequence"

Do you mean you sent the message to the proxy service , or the individual services? If the latter , you need to get the correct endpoint's of the PROXY SERVICE (by clicking on the service in the consoleUI->services tab). The proxy will chain your services.

Also , if the message flow hits a < drop > mediator anywhere , it will immediatley stop processing of message.

And by the default fault sequence do you mean the esb's default fault sequence or the fault sequence you specified?

And can you paste some logs and the soap request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM