2013-03-07 3 views
1

현재 시나리오는 사용자의 이름을 알려주면 사용자의 전자 메일 주소를 반환하는 데이터 서비스로부터 웹 서비스를 공개합니다. 이제 ESB에서이 웹 서비스를 사용하고 속성에서이 웹 서비스의 전자 메일 ID를 가져 와서 LOG 중재자를 사용하여 콘솔에 표시하려고합니다. 지금 어떻게해야하며 어떻게해야합니까?wso2 DSS server와 wso2를 통합하는 방법 ESB

죄송하지만이 바보 같은 질문에 대해 wso2 esb의 최신 회원입니다. 그러니 제발 도와주세요.

Now ihave a response like: 
<brs:getRecipientKeyResponse xmlns:brs="http://brs.carbon.wso2.org"> 
<brs:MailRecipient xsi:type="ax2338:MailRecipient" xmlns:ax2338="http://email.samples/xsd" xmlns:ax2337="http://email.samples/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <ax2337:recipient>kevin</ax2337:recipient> 
</brs:MailRecipient> 
</brs:getRecipientKeyResponse> 

Ihave to get the recipient element from this response and put this in payload. My complete sequence for this is: 
<sequence xmlns="http://ws.apache.org/ns/synapse" name="receiveSeq"> 
    <log> 
     <property name="getRecipient" value="------------Trying to get data Fom BRS Response----------------------------"/> 
     <property xmlns:ns="http://org.apache.synapse/xsd" xmlns:ax2337="http://email.samples/xsd" name="Recipient" expression="//ax2337:recipient"/> 
    </log> 
    <payloadFactory> 
     <format> 
     <p:GetEmailDetails xmlns:p="http://ws.wso2.org/dataservice"> 
      <xs:name xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:name> 
     </p:GetEmailDetails> 
     </format> 
     <args> 
     <arg xmlns:ns="http://org.apache.synapse/xsd" xmlns:ax2337="http://email.samples/xsd" expression="//ax2337:recipient"/> 
     </args> 
    </payloadFactory> 
    <log> 
     <property xmlns:ns="http://org.apache.synapse/xsd" name="getName" expression="get-property('Recipient')"/> 
    </log> 
    <send receive="DBSeq"> 
     <endpoint key="emailServiceEP"/> 
    </send> 
</sequence> 

<!--this part is not able to get data ---> 
<property xmlns:ns="http://org.apache.synapse/xsd" name="getName" expression="get-property('Recipient')"/> 

답변

0

Dataservice가 구현되었으므로이를 wso2esb에서 만들 수있는 프록시에 대한 끝점 URL로 제공하십시오. 귀하가 귀하의 프록시에 요청을 보내면, 귀하는 귀하의 데이터 서비스에 대한 응답을 받게됩니다. "level = full"로 로그하면 전체 응답을 볼 수 있습니다. 속성 중재자를 사용하고 xpath를 사용하여 필요한 값을 선택하십시오. 샘플의 conf : 여기

<proxy name="StockQuoteProxy"> 
     <target> 
      <endpoint> 
       <address uri="DS endpoint"/> 
      </endpoint> 
      <outSequence> 
       <log level="full"> 
        <property name="email" expression="xpath from the email attribute in the rseponse"/> 
       </log> 
       <send/> 
      </outSequence> 
     </target> 

    </proxy> 

은 프록시를 생성하는 방법에 대한 ESB 샘플 가이드;

http://docs.wso2.org/wiki/display/ESB460/Proxy+Service+Samples

+0

다른 문제가 있습니다. 수취인이라는 건물에 이름을 붙였습니다. 이제 이것을 페이로드 팩토리에 전달하고 싶습니다. 이 작업을 수행하는 방법? – Roy

+0

내 코드는 다음과 같습니다. Roy

+0

얻을 재산권 ('수신자') Roy

1

유 단지 payloadfactory에 요청하는 측 코드 복사에서 당신의 wso2dss의 tryit 서비스의 insted (가) "?"가 $ 1이 ..like $ 2 계속 사용하고 UR에 따라 위 아래 인수를 전달 주문 주문은이 응답에 중요한 역할을합니다. 나는 그것이 도움이 될 것이라고 생각합니다.

<payloadFactory> 
      <format> 
       <p:insert_emp_operation xmlns:p="http://ws.wso2.org/dataservice"> 
        <xs:eno xmlns:xs="http://ws.wso2.org/dataservice">$1</xs:eno> 
        <xs:ename xmlns:xs="http://ws.wso2.org/dataservice">$2</xs:ename> 
        <xs:esal xmlns:xs="http://ws.wso2.org/dataservice">$3</xs:esal> 
       </p:insert_emp_operation> 
      </format> 
      <args> 
       <arg expression="get-property('eno')"/> 
       <arg expression="get-property('ename')"/> 
       <arg expression="get-property('esal')"/> 
      </args> 
     </payloadFactory> 
     <send receive="Error_Seq"> 
      <endpoint> 
       <address uri="http://localhost:9764/services/emp_DataService/" format="soap11"/> 
      </endpoint> 
     </send>