我有一个WCF WebService我想使用ColdFusion消费.常规过程是使用CFHTTP在WSDL中使用SOAP请求.通常,这是有效的,一切正常.
<cfsavecontent variable="xmlBody" >
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
<soap:Header/>
<soap:Body>
<tem:GetVersion/>
</soap:Body>
</soap:Envelope>
</cfsavecontent>
Run Code Online (Sandbox Code Playgroud)
<cfhttp url="https://www.example.com/OtherService.svc?wsdl" method="post" timeout="1200" username="myUsername" password="myPassword" >
<cfhttpparam type="header" name="Content-Type" value="application/soap+xml;charset=UTF-8">
<cfhttpparam type="header" name="Content-Length" value="#len(trim(xmlbody))#">
<cfhttpparam type="header" name="soapAction" value="http://tempuri.org/GetVersion">
<cfhttpparam type="body" name="body" value="#trim(xmlBody)#">
</cfhttp>
<cfdump var="#cfhttp#">
Run Code Online (Sandbox Code Playgroud)
运行页面后,我得到了The security context token is expired or is not valid. The message was not processed.回复.在阅读服务提供商提供的文档时,似乎我不能只将XML发布到URL并将其称为一天:
While WCF uses XML to post communications to the endpoint, it is required that users use Visual Studio's "Add Service Reference" or svcutil.exe …