I was trying to consume a simple ASP.NET webservice from a ColdFusion template and found that the service could not find the ASP.NET webmethod directly via URL.  Instead, it seemed to work only when I mapped the webservice name in the ColdFusion administrator.  BTW, I'm using CFMX 6.1.

For example, here is the web method which I'll call wsSimple.asmx:

[WebMethod]
public string sayHello(string yourName)
{
    return "Hello, " + yourName;
}

Here is a snippet of code from the ColdFusion page:

   <cfinvoke webservice="http://someDomain/wsSimple.asmx?wsdl" method="sayHello" returnvariable="wsMsg">
        <cfinvokeargument name="yourName" value="user1">
   </cfinvoke>

   <cfscript>
        WriteOutput("Message from the web service: <br>" & wsMsg );
   </cfscript>

Instead, if I map the webservice in CF administrator using the same URL as in the CFML above (http://someDomain/wsSimple.asmx?wsdl) as "wsDotNetSimple," everything works as expected.  Any ideas?
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to