blue44
asked on
Consuming a .NET web service from ColdFusion
Hi,
I"m trying to consume a .NET web service and keep getting the following error:
Web service operation test1 with parameters {QUERYSTRING={00006-0464-0 5},TYPE={N DC},TOKEN= {YourToken Here}} cannot be found.
I've tried many different combinations but just can't crack it. Any help is greatly appreciated.
Thanks!
I"m trying to consume a .NET web service and keep getting the following error:
Web service operation test1 with parameters {QUERYSTRING={00006-0464-0
I've tried many different combinations but just can't crack it. Any help is greatly appreciated.
Thanks!
<cfscript>
	myrequest = structNew();
	myrequest.Type='NDC';
	myrequest.QueryString='00006-0464-05';
	myrequest.Token ='YourTokenHere';
</cfscript>
<cfinvoke webservice="http://www.YourWSDLHere.com/wspHVLookup.asmx?WSDL" argumentCollection="#myrequest#" returnvariable="result" method="Query">
<cfdump var="#result#">
ASKER
Good try but same result:
Web service operation test1 with parameters {QueryString={00006-0464-0 5},Type={N DC},Token= YourTokenH ere} cannot be found.
Web service operation test1 with parameters {QueryString={00006-0464-0
I'm not the most talented at reading WSDL files, but I don't see anything mentioned in that WSDL about a function called "test1". Which function are you trying to call?
Use SOAP..
<cfsavecontent variable="soap">
<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://YourWSDLHere.com/webservice/2008" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<SOAP-ENV:Body>
<tns:Query xmlns:tns="http://YourWDSLHere.com/webservice/2008">
<tns:Type>NDC</tns:Type>
<tns:QueryString>00006-0464-05</tns:QueryString>
<tns:Token>YourTokenHere</tns:Token>
</tns:Query>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</cfsavecontent>
<cfhttp url="http://www.YourWDSLHere.com/wspHVLookup.asmx" method="post">
	 <cfhttpparam type="header" name="content-type" value="text/xml">
<cfhttpparam type="header" name="SOAPAction" value="">
<cfhttpparam type="header" name="content-length" value="#len(soap)#">
<cfhttpparam type="header" name="charset" value="utf-8">
<cfhttpparam type="xml" name="message" value="#trim(soap)#">
</cfhttp>
<cfdump var="#cfhttp.FileContent#">
ASKER
@kaufmed: That was just a typo, but good catch :-) I'm trying to call the Query function and I still get the same error.
@brijeshchauhan: Thanks so much...I really think this is how I have to proceed...unfortunate I can't utilize cfinvoke. I tried your code and got a new error:
<?xml version="1.0" encoding="utf-8"?><soap:En velope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><s oap:Fault> <faultcode >soap:Clie nt</faultc ode><fault string>Ser ver did not recognize the value of HTTP Header SOAPAction: .</faultstring><detail /></soap:Fault></soap:Body ></soap:En velope>
@brijeshchauhan: Thanks so much...I really think this is how I have to proceed...unfortunate I can't utilize cfinvoke. I tried your code and got a new error:
<?xml version="1.0" encoding="utf-8"?><soap:En
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@brijeshchauhan: Perfect, it worked!! You are indeed a MASTER!! My next challenge it trying to parse this SOAP response into a CF object (i.e., array, query, struct, etc). I will post a second question regarding this and it would be great if you could respond to it.
Open in new window