Web services Coldfusion Web服务接收对象
我觉得自己像个傻瓜,没弄明白这件事。我有coldfusion webservice(bluedragon7)来接受合作伙伴的信息。他们在结果字段中传递xml,它只显示参数中accessionNumber的第一个元素。如果我将参数类型更改为其他类型(any、string等),它将抛出500个错误。我是不是遗漏了什么 以下是函数的一个片段:Web services Coldfusion Web服务接收对象,web-services,coldfusion,bluedragon,Web Services,Coldfusion,Bluedragon,我觉得自己像个傻瓜,没弄明白这件事。我有coldfusion webservice(bluedragon7)来接受合作伙伴的信息。他们在结果字段中传递xml,它只显示参数中accessionNumber的第一个元素。如果我将参数类型更改为其他类型(any、string等),它将抛出500个错误。我是不是遗漏了什么 以下是函数的一个片段: <cffunction access="remote" name="result" output="false" returntype="any" hin
<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>
彼得265974
pwd265974
0572854881
000010
气动控制
2537353350
HEALTHFORCE合作伙伴公司
000804
100154550查看公司的测试
太太
我也有同样的问题。我试图在检查元素是否仍然有“xmlchild”时遍历所有元素。也许我的朋友能帮上忙 但是您必须更改行,您的身体内容将保存在一个var中
<cfset var body = xmlsearch(cont, "//SOAP-ENV:Body")[1] />
只需插入“soapenv:Body”而不是“SOAP-ENV:Body”我认为您需要对CFC进行建模以匹配XML结构,而不仅仅是将结果定义为XML变量。按照CF指南使用复杂对象,或者如果可以,切换到简单的JSON Web服务,而不是SOAP:)Henry,我发布的不是消费,不幸的是,我找不到任何关于处理这些类型的信息……您能提供任何参考或其他信息吗?谢谢我认为XML总是需要一个根元素。因此,请尝试传递结果(accessionNumber、accountLocationCode,…)并用
…
或类似内容包围。不幸的是,它们是标准的,无法更改。他们正在使用java并将其作为对象传递……那么,我如何在coldfusion中接收该对象呢?