WSO2 ESB未找到Operation的端点引用(EPR),以及WSA Action = urn:mediate

时间:2013-09-17 06:02:13

标签: soap wso2 wso2esb

我是WSO2 ESB的新手。我正在为基于SOAP的服务做服务代理。我的端点服务有多种方法。任何人都可以建议我如何在我的流文件中声明一个特定的操作(方法)。因为我得到了未找到的操作的Endpoint Reference。

下面是我的代理服务src

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

在我的EmployeeService中,我有多个操作。所以我需要做什么来调用服务的特定操作。即我有像getSalary,editAddress

这样的操作

5 个答案:

答案 0 :(得分:2)

您可以通过在此序列中定义操作标头来指定端点的操作,此处值应为操作名称(SOAP操作)。

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

答案 1 :(得分:0)

您可以在有效负载介体中轻松指定Soap信封,并调用您的服务

例如

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

答案 2 :(得分:0)

使用SOAP(来自Java)调用WSO2 Web服务时遇到的问题很少。一些WSO2产品仍然在1.1版中使用SOAP协议。 2003年发布了1.2版。在SOAP 1.1元素中,SOAPAction是必需的,因此如果生成java类,则在编组后请求中缺少此元素。

WSO2 ESB在版本1.2中使用了SOAP。但是,指定ACTION很重要。例如,使用Spring,您可以在回调中指定ACTION:         对象响应= getWebServiceTemplate()。marshalSendAndReceive(                 OBJ,                 新的SoapActionCallback(                         “瓮:getInstanceInfo”));

将来自Java的原始请求与来自SoapUI的请求进行比较(在服务器端)非常有用。通常从SoapUI调用工作正常,但从Java调用不行。

答案 3 :(得分:0)

我遇到了同样的问题。我通过在此页面Error accesing published WS proxy in WSO2 ESB 4.6: EPR not found

中按照1.的结尾将操作名称放在URL上来解决它

答案 4 :(得分:0)

这是一个完整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>