簡體   English   中英

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

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM