WCF和ColdFusion

Che*_*ter 6 .net coldfusion wcf web-services coldfusion-11

我有一个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 to generate reference code for the service in whichever WCF-compatible language they prefer, and use that code instead of attempting to post XML directly to the service.

因此,在下载并安装Visual Studio代码之后,我运行了svcutil.exe并从中获取了两个文件:一个C#代码,它似乎设置了一大堆变量然后执行STUFF.还有一个output.config文件是一个XML文件,它具有端点的地址.

作为最后的手段,我尝试使用CFINVOKE以下方法调用WSDL :

<cfinvoke webservice="https://www.example.com/OtherService.svc?wsdl" method="getVersion" username="myUsername" password="myPassword" returnvariable="wsdl">
</cfinvoke>

<cfdump var="#wsdl#">
Run Code Online (Sandbox Code Playgroud)

这次我得到了一个不同的错误: org.apache.axis2.AxisFault: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '"' (code 34) in DOCTYPE declaration; expected a space between public and system identifiers

我的问题是:我现在该怎么办?