1

入力として単純な文字列があり、その文字列を配列に追加する Web サービスを呼び出した後、配列を出力 (スキーマで文字列配列として設定したもの) に割り当てる必要があります。エンタープライズ マネージャーは、エラーが発生し、指定された XPath 式の複数のノードが結果に含まれていると表示されます。Assign アクティビティは保留中として表示されます。基本的に、配列またはリストを、配列としても設定されている出力変数に割り当てるにはどうすればよいですか。使用される wsdl ファイルは次のとおりです。 :

<?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変数に配列を割り当てる方法はありますか?問題は、Webサービスに複数の入力があるため、入力変数のラッピング要素を呼び出し変数のラッピング変数にコピーできないことです。ここにコードのスニペットがあります:

<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>

問題は、1 つだけがリスト型であり、他のすべてが文字列型であることです。この 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>
4

1 に答える 1

1

from-specおよびto-specは、複数の要素または属性を選択してはなりません。あなたの場合、変数の部分のすべての<return>要素(つまり配列の項目)を選択しているように見えます。アイテムをラップする要素(つまり、ns1:displayResponse要素)をコピーして、この要素をns2:processResponse(to-variableのラップ要素)にコピーしてみてください。

ソース要素とターゲット要素の両方が異なる名前空間にあり、タイプも異なるためdoXSLTransform、ソーススキーマからターゲットスキーマに変換するには、おそらくXSLTスクリプト(を使用して)を実行する必要があります。

于 2011-10-20T09:42:34.847 に答える