2017-05-22 110 views
1

我爲Web服務調用和響應創建了一個實例。Orbeon將實例數據發送到Web服務

<xf:instance id="ws-request-instance">       
          <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.estat.zzi.si/"> 
           <soapenv:Header/> 
           <soapenv:Body> 
            <ws:orbeonGet> 
            <dokumentId/> 
            <type/> 
            <formData/> 
            </ws:orbeonGet> 
           </soapenv:Body> 
          </soapenv:Envelope> 
</xf:instance> 

<xf:instance id="ws-response-instance">      
          <soapenv:Envelope> 
          </soapenv:Envelope> 
</xf:instance> 

的提交函數調用像這樣創建的服務:

<xf:submission id="submit" action="http://was7test.zzi.si:8081/EStat-RO-WS-91-XX/orbeon" method="post" ref="instance('ws-request-instance')" replace="instance" mediatype="application/soap+xml" instance="ws-response-instance"> 
       <xf:message ev:event="xforms-submit-done" level="modal">Done Result:<xf:output value="instance('ws-response-instance')"/> 
       <xf:output value="event('error-type')"/>; Status: <xf:output value="event('response-status-code')"/>; URI: <xf:output value="event('resource-uri')"/>; Headers: <xf:output value="event('response-headers')"/>; Body: <xf:output value="event('response-body')"/> 
       </xf:message> 

       <xf:message ev:event="xforms-submit-error" level="modal"> 
       A submission error occurred: <xf:output value="event('error-type')"/>; Status: <xf:output value="event('response-status-code')"/>; URI: <xf:output value="event('resource-uri')"/>; Headers: <xf:output value="event('response-headers')"/>; Body: <xf:output value="event('response-body')"/> 
       </xf:message> 
      </xf:submission> 

當點擊提交按鈕,我們填寫參數這樣的Web服務調用:

<xf:action ev:event="submit-form"> 
      <xf:setvalue ref="instance('ws-request-instance')//type" value="xxf:get-request-parameter('type')"/> 
      <xf:setvalue ref="instance('ws-request-instance')//dokumentId" value="xxf:get-request-parameter('documentId')"/> 
      <xf:setvalue ref="instance('ws-request-instance')//formData" value="instance('fr-form-instance')"/> 
      <xf:send submission="submit"/> 
</xf:action> 

在formData參數中,我想獲取fr-form-instance的「XML」數據。例如,實例是「X」,我只獲取X,而不是XML中的整個「實例」。

這是否可能?你能指導我走向正確的方向嗎?

回答

1

發現瞭如何;)我只是用 「撒克遜人」 寫道:

<xf:setvalue 
    ref="instance('ws-request-instance-get')//formData" 
    value="saxon:serialize(instance('fr-form-instance'), 'xml')"/>