2011-10-20 21 views
1

我有一個簡單的字符串作爲輸入,並調用Web服務,將字符串到array.Now我必須陣列到輸出(我已設置爲一個字符串分配之後分配陣列數組在模式中)。企業管理器給出了一個錯誤,並說結果包含給定的XPath表達式的多個節點。Assign活動顯示爲pending.So基本上,我如何將一個數組或列表分配給輸出變量還設置爲用於一個array.The WSDL文件是:如何在BPEL過程

<?xml version = '1.0' encoding = 'UTF-8'?> 

<definitions 
    name="ReturnTypeService" 
    targetNamespace="http://examples2/" 
    xmlns="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:tns="http://examples2/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    > 
    <types> 
     <xsd:schema> 
      <xsd:import namespace="http://examples2/" schemaLocation="http://localhost:7101/Examples2-Examples2-context-root/ReturnTypePort?xsd=1"/> 
     </xsd:schema> 
    </types> 
    <message name="display"> 
     <part name="parameters" element="tns:display"/> 
    </message> 
    <message name="displayResponse"> 
     <part name="parameters" element="tns:displayResponse"/> 
    </message> 
    <portType name="ReturnType"> 
     <operation name="display"> 
      <input message="tns:display"/> 
      <output name="displayResponse" 
      message="tns:displayResponse"/> 
     </operation> 
    </portType> 
    <binding name="ReturnTypePortBinding" type="tns:ReturnType"> 
     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
     <operation name="display"> 
      <soap:operation soapAction=""/> 
      <input> 
       <soap:body use="literal"/> 
      </input> 
      <output> 
       <soap:body use="literal"/> 
      </output> 
     </operation> 
    </binding> 
    <service name="ReturnTypeService"> 
     <port name="ReturnTypePort" binding="tns:ReturnTypePortBinding"> 
      <soap:address location="http://localhost:7101/Examples2-Examples2-context-root/ReturnTypePort"/> 
     </port> 
    </service> 
</definitions> 

@vanto是否有分配從輸入變量數組變量invoke_input方式的親? blem是有我的web服務的多個輸入,所以我不能夠在輸入變量纏繞元件複製到調用variable.Will包裹變量複製代碼這裏的片段:

<assign name="Assign1"> 
      <copy> 
       <from variable="inputVariable" part="payload" 
         query="/ns2:process/ns2:dsaName"/> 
       <to variable="Invoke1_processList_InputVariable" 
        part="parameters" query="/ns1:processList/dsaName"/> 
      </copy> 
      <copy> 
       <from variable="inputVariable" part="payload" 
         query="/ns2:process/ns2:linesOfData"/> 
       <to variable="Invoke1_processList_InputVariable" 
        part="parameters" query="/ns1:processList/linesOfData"/> 
      </copy> 
      <copy> 
       <from variable="inputVariable" part="payload" 
         query="/ns2:process/ns2:description"/> 
       <to variable="Invoke1_processList_InputVariable" 
        part="parameters" query="/ns1:processList/description"/> 
      </copy> 
      <copy> 
       <from variable="inputVariable" part="payload" 
         query="/ns2:process/ns2:application"/> 
       <to variable="Invoke1_processList_InputVariable" 
        part="parameters" query="/ns1:processList/application"/> 
      </copy> 
     </assign> 

的問題是隻一個是列表類型,其他都是字符串類型。對此的XML是:

<element name="process"> 
      <complexType> 
       <sequence> 
        <element name="dsaName" type="string" minOccurs="0"/> 
        <element name="linesOfData" type="string" minOccurs="0" maxOccurs="unbounded"/> 

        <element name="description" type="string" minOccurs="0"/> 
      </sequence> 
    </complexType> 
     </element> 
    <element name="processResponse"> 
     <complexType> 
      <sequence> 
       <element name="result" type="string" minOccurs="0" maxOccurs="unbounded"/> 
      </sequence> 
     </complexType> 
    </element> 
</schema> 
+0

很難說沒有看到''和XSD內容。 – vanto

+0
+0

^這在xsd.The 是: <分配名稱= 「的Assign2」> <從變量= 「Invoke1_display_OutputVariable」 一部分= 「參數」 查詢= 「/ NS1:displayResponse /返回」/> <變量= 「outputVariable」 部分= 「有效載荷」 查詢= 「/ NS2:processResponse/NS2:結果」/> user1004779

回答

1

從規範和規範不能選擇多個元素或屬性。在你的情況下,它似乎選擇變量部分中的所有<return>元素(即數組的項目)。嘗試複製包裝項目的元素(即ns1:displayResponse元素),並將此元素複製到ns2:processResponse(to-variable中的包裝元素)。

由於源元素和目標元素似乎位於不同的名稱空間並且屬於不同的類型,因此您可能需要通過XSLT腳本(使用doXSLTransform)將其運行以將其從源模式轉換爲目標模式。

+0

它worked.Thanks @vanto – user1004779

+0

大聽到。你需要更多的幫助來解決這個問題嗎? – vanto