3

私はこれを理解していないため、気が狂ったように感じます. パートナーからの情報を受け入れるコールドフュージョン Web サービス (bluedragon7) があります。結果フィールドに xml を渡していますが、引数には accessionNumber の最初の要素のみが表示されます。引数の型を他のもの (任意、文字列など) に変更すると、500 エラーがスローされます。ここで何か不足していますか?

関数のスニペットを次に示します。

<cffunction access="remote" name="result" output="false" returntype="any" hint="">
<cfargument name="userid" type="string" required="yes" hint="userid">
<cfargument name="password" type="string" required="yes" hint="password">
<cfargument name="result" type="xml" required="Yes" default="result">
</cffunction>  

以下は彼らの投稿のサンプルです。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header />
<soapenv:Body>
    <result xmlns="http://cws.ots.labcorp.com">
        <userId>peter265974</userId>
        <password>pwd265974</password>
        <result>
            <accessionNumber>0572854881</accessionNumber>
            <accountLocationCode>000010</accountLocationCode>
            <accountLocationName>AERO CONTROL</accountLocationName>
            <accountLocationPhone>2537353350</accountLocationPhone>
            <accountName>HEALTHFORCE PARTNERS CORPORATE</accountName>
            <accountNumber>000804</accountNumber>
            <collectorCOCcomments>
                <abbreviation />
                <commentText>100154550. TEST OF VIEWING CO</commentText>
                <commentType>MS</commentType>
            </collectorCOCcomments>
        </result>
    </result>
</soapenv:Body>

4

1 に答える 1

0

私はちょうど同じ問題を抱えていました。要素にまだ「xmlchild」があるかどうかを確認しながら、すべての要素をループしようとしました。多分私のスレッドがここで役立つかもしれません。

ただし、本文の内容が var に保存される行を変更する必要があります

<cfset var body = xmlsearch(cont, "//SOAP-ENV:Body")[1] />

「SOAP-ENV:Body」の代わりに「soapenv:Body」を挿入するだけです

于 2012-07-04T11:20:18.000 に答える