CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2002
    Posts
    290

    get XML string returned by web service in java

    dear gurus:

    how can I get XML string returned by web service in java?

    not an object of web service .

    thank you

  2. #2
    Join Date
    Feb 2008
    Posts
    966

    Re: get XML string returned by web service in java

    If you type "java consume web service" about 25,000,000 results pop up showing you, with code even, how to consume a web service. There are two main ways that people do this: using JaxWS (a third party, open source, solution), or by using some of the following Java classes, already there in the SDK:

    javax.xml.rpc.Service
    javax.xml.rpc.ServiceFactory

  3. #3
    Join Date
    Jul 2005
    Location
    Currently in Mexico City
    Posts
    568

    Re: get XML string returned by web service in java

    The easiest and straightforward way would be to connect to the service and parse the response: http://java.sun.com/docs/books/tutor...eadingURL.html
    The rest of solutions involve external APIs.
    Wanna install linux on a vacuum cleaner. Could anyone tell me which distro sucks better?

    I had a nightmare last night. I was dreaming that I’m 64-bit and my blanket is 32-bit and I couldn’t cover myself with it, so I’ve spent the whole night freezing. And in the morning I find that my blanket just had fallen off the bed. =S (from: bash.org.ru)

    //always looking for job opportunities in AU/NZ/US/CA/Europe :P
    willCodeForFood(Arrays.asList("Java","PHP","C++","bash","Assembler","XML","XHTML","CSS","JS","PL/SQL"));

    USE [code] TAGS! Read this FAQ if you are new here. If this post was helpful, please rate it!

  4. #4
    Join Date
    Feb 2008
    Posts
    966

    Re: get XML string returned by web service in java

    The Java recommended way is using JAX-WS, and as of JSR 109 and SDK 1.6 JAX-WS is actually part of the SDK. Using a WSDL and the classes provided is about 5 lines of code, AND the best part is that you don't have to write your own XML parser.

    Try reading this article: http://java.sun.com/developer/techni...J2SE/jax_ws_2/.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured