Skip to main content
September 7, 2012
Question

Consume ASP.Net Web Service using ColdFusion

  • September 7, 2012
  • 2 replies
  • 2470 views

Here is what I have so far. I am creating an ASP.NET Web service to log our internal web site activities. The majority of our internal sites are written in ColdFusion. I have used web services before in the ASP.Net world, but ColdFusion is a little new to me. I am just starting to experiment with this type of situation. As an explanation to why we are mixing the two technologies: we are moving away from ColdFusion at this time and are in a transitional phase.

The C# code is first. This I believe is correct.

 [WebService(Namespace = "http://oursite.org:86")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]

[System.Web.Script.Services.ScriptService]
public class LogEvent : System.Web.Services.WebService
{
   
private IContainer components = null;


   
public LogEvent()
   
{
       
InitalizeComponent();
   
}

   
private void InitalizeComponent()
   
{
   
}

   
protected override void Dispose(bool disposing)
   
{
       
if (disposing && components != null)
       
{
            components
.Dispose();
       
}

       
base.Dispose(disposing);
   
}



   
[WebMethod]
   
public string InsertEvent()
   
{

       
return "HellWorld";

   
}
}

I have just a simple CFC to call the web service.

<cffunction name="TestWebService" access="remote" returntype="Any" >

       
<cfinvoke webservice="oursite.org:86/LogEvent.asmx?wsdl" method="InsertEvent" returnvariable="result"   >

       
<cfdump var="#result#">      
 
</cffunction>

When I run the CFC method I get the following error back.

Unable to read WSDL from URL: 

I have searched and followed every tutorial and suggestion I have found, but I am not an expert at ColdFusion. Am I missing something?

Any help would be appreciated.

This topic has been closed for replies.

2 replies

Miguel-F
Inspiring
September 7, 2012

Not sure if it is required but you might need to put the protocol in your webservice attribute.

<cfinvoke webservice="http://oursite.org:86/LogEvent.asmx?wsdl" method="InsertEvent" returnvariable="result"   >

Do you get the WSDL if you surf to http://oursite.org:86/LogEvent.asmx?wsdl in your browser?  Test from the ColdFusion server too.

September 7, 2012

I can get to the service in a browser, and display the WSDL on my machine. I have not tried it on the ColdFusion Server. I am trying that right now

September 7, 2012

I can not get the service from the ColdFusion Server. I should mention that the ColdFusion server is a cloud server and the web service server is on the local network. That is what is wrong!

Inspiring
September 7, 2012

Are you able to browse the webservice?