Invoking a .NET web service from ColdFusion

I need to get my ColdFusion web apps to authenticate to a .NET server. The .NET people have given me a code snippet, but it’s a .NET code snippet, so it doesn’t help me much. I know I can use <cfinvoke> or CreateObject() to call the service, but I’m not exactly sure how.

Does anyone here have any experience with this?

I’ve never done it with ColdFusion, but I’ve seen it done in C++, and in short, if you are truly calling a .NET web service you need to build the SOAP request exactly as .NET wants it to be built.

The easiest way to do this is use Fiddler and record the process of being authenticated by a .NET login page, capture the SOAP request sent to the server and make your code produce the same request.

Actually strike that, it may be even easier than that for you :slight_smile:
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=webservices_02.html

Yeah, I was looking at that page. I have a meeting with our .NET people tomorrow. I’m thinking that they’ll need to create this .wsdl file for us, and I can throw a <cfinvoke> at it. They gave us some code, but I’m starting to think that it’s old asp code from around 10 years ago that they keep reusing, and I’m not sure if I can do anything with it from CF.

We’ll see what tomorrow’s meeting brings.

Usually if you know the Service URL, you can load it in your web browser (depending if the WSDL output is enabled), and then add ?wsdl to the URL and it should produce it (again, if it is enabled)

Example:
www.example.com/myservice/service.asmx?wsdl (Web Service)
www.example.com/myservice/service.svc?wsdl (WCF Service)

Yeah, what I need for them is the URL. I think I can figure out the rest from there.

Well this is interesting. I have to point users to another server where they log in, then carry them back to mine with a session ID. :goof:

sigh no one builds services very well anymore… so sorry you have to go through that.

It’s because all of our web apps need to use an access card (gov’t) so we have to log in on the server that’s set up to read the cards. I’m hoping that the session cookie from that server populates GetAuthUser(), in which case I’ll be all set. Then I just have to figure out a way to tell the remote server that the session is still alive so it doesn’t time out.

It’s probably not a cookie but rather a token that has little to do with a http session. You’ll probably need to pass that token back in some form for each request.

Yep, I can probably do a cfinvoke to a web service they have for just this purpose. Any time a page is submitted, it triggers the cfinvoke.

i have not done this but my experience a bit says that it can b done by making a web methord and on every app request it should come to .net server and like this they can b connected… same way as snippet… but i don’t think other then this will be easy work …it might make this a large project
regards
Andy
<snip>