Brian David Berman
Brian David Berman

Reputation: 7694

Consume WCF service from Coldfusion 7

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. Anyone?

Upvotes: 2

Views: 1374

Answers (2)

Ben Doom
Ben Doom

Reputation: 7885

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.

Upvotes: 3

Andreas Schuldhaus
Andreas Schuldhaus

Reputation: 2648

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>

Upvotes: 0

Related Questions