简体   繁体   English

使用ColdFusion消耗ASP.Net Web服务

[英]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. 我正在创建一个ASP.NET Web服务来记录我们的内部网站活动。 The majority of our internal sites are written in ColdFusion. 我们的大多数内部站点都是用ColdFusion编写的。 I have used web services before in the ASP.Net world, but ColdFusion is a little new to me. 我以前在ASP.Net世界中使用过Web服务,但是ColdFusion对我来说是个新手。 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. 为了解释为什么我们要混合两种技术:我们目前正在远离ColdFusion,并且处于过渡阶段。

The C# code is first. 首先是C#代码。 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. 我只有一个简单的CFC来调用Web服务。

<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. 当我运行CFC方法时,出现以下错误。

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. 我搜索并遵循了发现的所有教程和建议,但是我不是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. 因此,我完全确定ColdFusion服务器是一台云服务器(即不在我们的网络中),并且Web服务正在本地网络服务器上运行。 Once I moved the ColdFusion code to a local server the service worked like it was suppose to. 一旦将ColdFusion代码移动到本地服务器,该服务就会像预期的那样工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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