复杂数据类型的Coldfusion Web服务错误 [英] Coldfusion Webservice errors for complex data types
问题描述
我正在尝试为测试 Bloomberg网络服务 > getFields 操作,但抛出错误。
I'm trying to test the Bloomberg webservice for the getFields operation but its throwing an error.
在提供的参数中找不到Web服务参数名称参数{CRITERIA} 。
Web service parameter name parameters cannot be found in the provided parameters {CRITERIA}.
到目前为止的代码。
<cfset FieldSearchCriteria = structNew()>
<cfset FieldSearchCriteria.mnemonic = "NAME">
<cfset GetFieldsRequest = structNew()>
<cfset getFieldsRequest.criteria = FieldSearchCriteria>
<cfinvoke
webservice="https://service.bloomberg.com/assets/dl/dlws.wsdl"
proxyserver="***"
proxyport="***"
proxyuser="***"
proxypassword="***"
method="getFields"
refreshwsdl="false"
wsVersion="1"
argumentcollection="#getFieldsRequest#"
returnvariable="aTemp">
<cfdump var="#aTemp#">
下面是有效的相应soapUI请求
Below is the corresponding soapUI request which worked
<soapenv:Body>
<ns:getFieldsRequest>
<ns:criteria>
<!--Optional:-->
<ns:mnemonic>NAME</ns:mnemonic>
</ns:criteria>
</ns:getFieldsRequest>
是否有指针?
更新1: createobject()在参数变化方面发挥了一定作用。但是现在抛出握手错误。
Update 1: createobject() worked to an extent with the change in arguments. But now throwing the handshake error.
javax.net.ssl.SSLHandshakeException:收到致命警报:handshake_failure
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
代码:
<cfscript>
ws = createObject("webservice", "https://service.bloomberg.com/assets/dl/dlws.wsdl",{refreshwsdl=true,proxyserver="***",proxyport="***",proxyuser="***",proxypassword="***",wsversion=1});
//show web service methods for debugging purposes
//writeDump(ws);
// construct arguments
args = {parameters={criteria={mnemonic="NAME"}}
};
writeDump(args);
// call the method
result = ws.getFields(argumentCollection=args);
writeDump(result)
</cfscript>
我们获得了x.509 .p12证书,并已使用OpenSSL编码为DER。
目前,不确定存储的证书是否有问题。
We were given a x.509 .p12 certificate and have encoded to DER using OpenSSL. At the moment, not sure if the stored certificate has an issue.
最终更新:
最后,设法使用cfhttp调用来使Web服务运行。
Ben的博客文章是一个很好的指南。我无法解决 cfinvoke
密钥库的证书问题。
Final Update:
Finally, managed to make the webservice run using the cfhttp call instead.
Ben's blog post was an excellent guide. I was unable to resolve the certificate issues with the keystore for cfinvoke
.
<cfsavecontent variable="soapBody">
<soapenv:Envelope
xxmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns="http://services.bloomberg.com/datalicense/dlws/ps/20071001">
<soapenv:Header/>
<soapenv:Body>
<ns:getFieldsRequest>
<ns:criteria>
<!--Optional:-->
<ns:mnemonic>NAME</ns:mnemonic>
</ns:criteria>
</ns:getFieldsRequest>
</soapenv:Body>
</soapenv:Envelope>
<cfhttp
url="https://dlws.bloomberg.com/dlps"
method="post"
result="httpResponse"
clientcert="#ExpandPath(".")#\cert.p12"
clientcertpassword="****">
<!---
Most SOAP action require some sort of SOAP Action header
to be used.
--->
<cfhttpparam
type="header"
name="SOAPAction"
value="""getFields"""
/>
<cfhttpparam
type="xml"
value="#trim( soapBody )#"
/>
</cfhttp>
<cfdump var="#XmlParse(httpResponse.filecontent)#">
推荐答案
设法使Web服务使用<$ c运行而是调用$ c> cfhttp 。 Ben的博客文章是很好的指南。我无法使用 cfinvoke
方法解决密钥库的证书问题。
Managed to make the webservice run using the cfhttp
call instead. Ben's blog post was an excellent guide. I was unable to resolve the certificate issues with the keystore for cfinvoke
method.
<cfsavecontent variable="soapBody">
<soapenv:Envelope
xxmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns="http://services.bloomberg.com/datalicense/dlws/ps/20071001">
<soapenv:Header/>
<soapenv:Body>
<ns:getFieldsRequest>
<ns:criteria>
<!--Optional:-->
<ns:mnemonic>NAME</ns:mnemonic>
</ns:criteria>
</ns:getFieldsRequest>
</soapenv:Body>
</soapenv:Envelope>
<cfhttp
url="https://dlws.bloomberg.com/dlps"
method="post"
result="httpResponse"
clientcert="#ExpandPath(".")#\cert.p12"
clientcertpassword="****">
<!---
Most SOAP action require some sort of SOAP Action header
to be used.
--->
<cfhttpparam
type="header"
name="SOAPAction"
value="""getFields""" <!--- Note : extra pair of quotes are required --->
/>
<cfhttpparam
type="xml"
value="#trim( soapBody )#"
/>
这篇关于复杂数据类型的Coldfusion Web服务错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!