简体   繁体   中英

Consume ASP.Net Web Service using ColdFusion

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.

So I completely spaced that the ColdFusion Server is a cloud server (ie not in our network) and the Web Service is running on a local network server. Once I moved the ColdFusion code to a local server the service worked like it was suppose to.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM