Search code examples
soapwso2apache-axiswso2-esb

WSO2 ESB mediate SOAP services


I am struggling to make work my message flow in the wso2 esb so I would need some help to implement a basic communication:

Service1 wants to receive an integer number Service2 Generates random numbers

Service1 has InSequence: log, send (to addresspoint specified). OutSequence: log, send

this looks like:

 <proxy name="ClientAskNumber" transports="https http" startOnLoad="true"
        trace="disable">
        <target faultSequence="fault">
            <inSequence>
                <log level="full">
                    <property name="Insequence" value="***" />
                </log>
                <send>
                    <endpoint>
                        <address uri="http://localhost:8280/services/RandomNumbers" />
                    </endpoint>
                </send>
            </inSequence>
            <outSequence>
                <log level="full">
                    <property name="Outsequence" value="***" />
                </log>
                <send />
            </outSequence>
        </target>
    </proxy>

I have this response: <faultstring>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: urn:mediate. at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()....etc

What it means? Am I missing something else? Please help. Thank you

EDIT:

I am studying the Wso2 ESB and I just need to understand how to make work a message communication, after it I will try to add different kind of mediation. I am just breaking down the problem, because I am new to this technology and as you can see I am really struggling to make it work...

EDIT2:*

<proxy xmlns="http://ws.apache.org/ns/synapse" name="ClientAskNumber" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target endpoint="RandomNumbers">
      <inSequence>
         <log>
            <property name="CLIENTASKS" value="******C_ASKS" />
         </log>
         <send>
            <endpoint key="RandomNumbers" />
         </send>
      </inSequence>
      <outSequence>
         <log>
            <property name="CLIENTRECEIVES" value="*******C_RECEIVES" />
         </log>
      </outSequence>
   </target>
</proxy>

Solution

  • In the case this helps someone else: the problem with "Server did not recognize the value of HTTP Header SOAPAction: urn:mediate..." is that I needed to add an Header mediator in order to call my webservice method "getNumbers", into my InSequence as follows:

     <inSequence>
             <log>
                <property name="CLIENTASKS" value="******C_ASKS" />
             </log>
             <header name="Action" value="http://tempuri.org/getNumbers" />
             <send>
                <endpoint key="RandomNumbers" />
             </send>
          </inSequence>
    

    and send this request via soapUI:

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <Numbers xmlns="http://tempuri.org/" />
      </soap:Body>
    </soap:Envelope>
    

    I hope this can be useful to other persons who are using .Net Solutions with WSO2ESB (unfortunately there are not many examples out there...)

    P.S. thanks to Ratha for his help