SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    Omaha, NE
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Consuming a java webservice

    What would be the best way to go about consuming a java webservice? Let's say I have a service that takes a city and state and returns 10 people that live there.

    Said service would return and Array of people objects that have first name and last name attributes.

    I understand how to do this in coldfusion with CFC's, and I understand how to do this in the java world. But how can you write a CFC that consumes the java web service and handles the arrray of people objects?

    Any ideas?
    "Oh, you hate your job? Why didn't you say so? There's a support group for that.
    It's called EVERYBODY, and they meet at the bar."

    --Drew Carey

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as ColdFusion is concerned, there's no such thing as a Java web service, or a ASP web service, or even a ColdFusion web service. That's the whole point of web services. You simply call the URL, pass in the required parameters, and receive the expected results. Could be Perl, PHP, Ruby, or Python for that matter.

    All you really need is the documentation for this service, so that you know the manner in which you need to call it (secure or not, get or post), the parameters, and the return variable.

    Take a look at cfhttp as that's probably going to be the method you use.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    Omaha, NE
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the response. I get how I would call it, it is more the consuming part that I'm conceptually struggling with. So I call the service via http and get back my array of people objects. How does CF handle those people objects? Can I get the name from the object by using getName(); ?
    "Oh, you hate your job? Why didn't you say so? There's a support group for that.
    It's called EVERYBODY, and they meet at the bar."

    --Drew Carey

  4. #4
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the webservice returns the actual object, with methods, then yes...you'll be able to call those methods.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


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
  •