简体   繁体   中英

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

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

PS thanks to Ratha for his help

This is the flow i can tell you.. You have to point your 2nd service as the endpoint of your fist service..In the above configuration

http://localhost:8280/services/RandomNumbers --->2nd service url
ClientAskNumber -->1st service..

Now you can send the request which is needed to execute the 2nd service(ie:to retrive the random number) So the proxy will forwrad to that endpoint and return the response to the outsequence..You should see that in the console/log since you used a log mediator.

In the error response you are getting i hope you are getting that from your second service. Check whether you are sending correct request to your endpoint

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