WSO2 ESB The endpoint reference (EPR) for the Operation not found, and the WSA Action = urn:mediate

StackOverflow https://stackoverflow.com/questions/18842319

  •  28-06-2022
  •  | 
  •  

Frage

I am a newbie in WSO2 ESB. I am doing service proxy for a SOAP based service. In which my endpoint service has multiple methods. can anyone suggest me how i can declare a specific operation(method) in my flow file. as i am getting Endpoint Reference for the operation not found.

below is my proxy service src

 <target>
      <inSequence>
         <log level="full"/>
         <log/>
         <send>
            <endpoint>
               <address uri="http://10.203.60.249:9768/services/EmployeeService/"/>
            </endpoint>
         </send>
      </inSequence>
   </target>

Here in my EmployeeService i have multiple operations. So what i need to do to call a specific operation of the service. i.e i have operations like getSalary, editAddress

War es hilfreich?

Lösung

You can specify the operation of the endpoint by defining an action header in your in sequence like this,here the value should be operation name(SOAP Action).

 <header name="Action" value="urn:getSalary"/>

Andere Tipps

You can easily specify the Soap envelope itself in the payload mediator and call your service

for example

 <payloadFactory media-type="xml">
        <format>
           <p:insert_persons_operation xmlns:p="http://ws.wso2.org/dataservice">
              <xs:P_Id xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:P_Id>
              <xs:LastName xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:LastName>
              <xs:FirstName xmlns:xs="http://ws.wso2.org/dataservice">$3</xs:FirstName>
              <xs:City xmlns:xs="http://ws.wso2.org/dataservice">$4</xs:City>
              <xs:Country xmlns:xs="http://ws.wso2.org/dataservice">$5</xs:Country>
              <xs:Phone xmlns:xs="http://ws.wso2.org/dataservice">$6</xs:Phone>
              <xs:Email xmlns:xs="http://ws.wso2.org/dataservice">$7</xs:Email>
           </p:insert_persons_operation>
        </format>
        <args>
           <arg xmlns:m="http://ws.wso2.org/dataservice"
                evaluator="xml"
                expression="//m:P_Id/text()"/>
           <arg xmlns:m="http://ws.wso2.org/dataservice"
                evaluator="xml"
                expression="//m:LastName/text()"/>
           <arg xmlns:m="http://ws.wso2.org/dataservice"
                evaluator="xml"
                expression="//m:FirstName/text()"/>
           <arg xmlns:m="http://ws.wso2.org/dataservice"
                evaluator="xml"
                expression="//m:City/text()"/>
           <arg xmlns:m="http://ws.wso2.org/dataservice"
                evaluator="xml"
                expression="//m:Country/text()"/>
           <arg xmlns:m="http://ws.wso2.org/dataservice"
                evaluator="xml"
                expression="//m:Phone/text()"/>
           <arg xmlns:m="http://ws.wso2.org/dataservice"
                evaluator="xml"
                expression="//m:Country/text()"/>
        </args>
     </payloadFactory>
     <send>
        <endpoint>
           <address uri="http://localhost:9764/services/MyPostgreDS/"/>
        </endpoint>
     </send>

I experienced few problems while calling WSO2 web services using SOAP (from Java). Some WSO2 products still use SOAP protocol in version 1.1. In 2003 version 1.2 was published. In SOAP 1.1 element SOAPAction was mandatory so if you generate your java classes this element is missing in request after marshalling.

WSO2 ESB uses already SOAP in version 1.2. However it is important to specify ACTION. For example using Spring you specify ACTION in callback: Object response = getWebServiceTemplate().marshalSendAndReceive( obj, new SoapActionCallback( "urn:getInstanceInfo"));

It is useful to compare (on server side) raw request from Java with request from SoapUI. Often calling from SoapUI works alright but calling from Java does not.

I was getting the same issue. I solved it by putting th operation name on the end of the URL as per 1. in this page Error accesing published WS proxy in WSO2 ESB 4.6: EPR not found

here is an example with the full api

<?xml version="1.0" encoding="UTF-8"?>
<api context="/users" name="TestUserAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET">
        <inSequence>
            <header name="Action" scope="default" value="urn:selectAll"/>
            <send>
                <endpoint key="UserEP"/>
            </send>
        </inSequence>
        <outSequence>
            <send/>
        </outSequence>
        <faultSequence/>
    </resource>
</api>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top