[英]The endpoint reference (EPR) for the Operation not found when invoking proxy service in WSO2 ESB
[英]WSO2 ESB The endpoint reference (EPR) for the Operation not found, and the WSA Action = urn:mediate
我是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这样的操作
您可以通过在此序列中定义操作标头来指定端点的操作,此处值应为操作名称(SOAP操作)。
<header name="Action" value="urn:getSalary"/>
您可以在有效负载介体中轻松指定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>
我在使用SOAP(来自Java)调用WSO2 Web服务时遇到了一些问题。 一些WSO2产品仍然在1.1版中使用SOAP协议。 2003年发布了1.2版。 在SOAP 1.1元素中,SOAPAction是必需的,因此如果生成java类,则在编组后请求中缺少此元素。
WSO2 ESB在版本1.2中使用了SOAP。 但是,指定ACTION很重要。 例如,使用Spring在回调中指定ACTION:Object response = getWebServiceTemplate()。marshalSendAndReceive(obj,new SoapActionCallback(“urn:getInstanceInfo”));
将来自Java的原始请求与来自SoapUI的请求进行比较(在服务器端)非常有用。 通常从SoapUI调用工作正常,但从Java调用不行。
我遇到了同样的问题。 我通过在URL的末尾添加操作名称来解决它。在此页面中错误访问WSO2中的已发布WS代理ESB 4.6:未找到EPR
这是一个完整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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.