I am trying to figure out a way to consume a WCF service I have (wsdl) from Coldfusion. I need to pass values in the request header. I can't seem to find any good examples anywhere. Any开发者_开发问答one?
I think the functions you want is
AddSOAPRequestHeader(webservice, namespace, name, value [, mustunderstand])
AddSOAPResponseHeader(namespace, name, value[, mustunderstand])
These let you add XML to the request and response headers of your webservice.
In ColdFusion you can consume webservices using cfinvoke
<cfinvoke
webservice="http://www.somewebservice.com/WebService.wsdl"
method="getWebServiceMethod"
returnvariable="webServiceResult">
<cfinvokeargument name="arg1" value="Arg1"/>
<cfinvokeargument name="arg2" value="Arg2"/>
</cfinvoke>
<cfoutput>The Result is #webServiceResult#</cfoutput>
or CreateObject
<cfscript>
ws = CreateObject("webservice",
"http://www.somewebservice.com/WebService.wsdl");
webServiceResult = ws.getWebServiceMethod("Arg1","Arg2");
writeoutput(webServiceResult);
</cfscript>
精彩评论