SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Wizard bronze trophy cydewaze's Avatar
    Join Date
    Jan 2006
    Location
    Merry Land, USA
    Posts
    1,074
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    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?
    <cfset myblog = "http://cydewaze.org/">

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,827
    Mentioned
    142 Post(s)
    Tagged
    0 Thread(s)
    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.
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  3. #3
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,827
    Mentioned
    142 Post(s)
    Tagged
    0 Thread(s)
    Actually strike that, it may be even easier than that for you
    http://livedocs.adobe.com/coldfusion...rvices_02.html
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  4. #4
    SitePoint Wizard bronze trophy cydewaze's Avatar
    Join Date
    Jan 2006
    Location
    Merry Land, USA
    Posts
    1,074
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cpradio View Post
    Actually strike that, it may be even easier than that for you
    http://livedocs.adobe.com/coldfusion...rvices_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.
    <cfset myblog = "http://cydewaze.org/">

  5. #5
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,827
    Mentioned
    142 Post(s)
    Tagged
    0 Thread(s)
    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)
    Last edited by cpradio; Oct 3, 2012 at 06:52. Reason: Added example URLs
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  6. #6
    SitePoint Wizard bronze trophy cydewaze's Avatar
    Join Date
    Jan 2006
    Location
    Merry Land, USA
    Posts
    1,074
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Yeah, what I need for them is the URL. I think I can figure out the rest from there.
    <cfset myblog = "http://cydewaze.org/">

  7. #7
    SitePoint Wizard bronze trophy cydewaze's Avatar
    Join Date
    Jan 2006
    Location
    Merry Land, USA
    Posts
    1,074
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    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.
    <cfset myblog = "http://cydewaze.org/">

  8. #8
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    4,827
    Mentioned
    142 Post(s)
    Tagged
    0 Thread(s)
    *sigh* no one builds services very well anymore... so sorry you have to go through that.
    Be sure to congratulate xMog on earning April's Member of the Month
    Go ahead and blame me, I still won't lose any sleep over it
    My Blog | My Technical Notes

  9. #9
    SitePoint Wizard bronze trophy cydewaze's Avatar
    Join Date
    Jan 2006
    Location
    Merry Land, USA
    Posts
    1,074
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    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.
    <cfset myblog = "http://cydewaze.org/">

  10. #10
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,576
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    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.

  11. #11
    SitePoint Wizard bronze trophy cydewaze's Avatar
    Join Date
    Jan 2006
    Location
    Merry Land, USA
    Posts
    1,074
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    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.
    <cfset myblog = "http://cydewaze.org/">

  12. #12
    Non-Member
    Join Date
    Oct 2012
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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>
    Last edited by TechnoBear; Oct 18, 2012 at 05:57. Reason: Please wait 90 days for a real signature


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •