Skip to main content

Accessing Sharepoint webservices from java client

2 replies [Last post]
Joined: 2009-07-10


I am new to WebServices and currently working on JAX WS 2.1 to access Sharepoint webservices. I need to access the data in the Lists of sharepoint site, so I used /_vti_bin/lists.asmx. I am using NetBeans 6.5 to generate the WebService References and could access Sharepoint (without any authentication issues). I found that I am getting a response object, however I am unable to extract the data from the response object. I found that the result (response object) consists of a list of objects of type ElementNSImpl and again each of them consisted of list of ElementNSImpl objects. Found that some contained text objects which contained some weird values, numbers. I could know exactly how to extract the data from the result. I really appreciate your help and please throw some light on how to retrieve data from result object. Also let me know if you need more details

Below is the generated code from NetBeans for the WebService Refernce(Made changes to access sharepoint, didnt have to add any code for authentication):

URL baseUrl =".");
try { // Call Web Service Operation service = new URL(baseUrl, "http://website/sites/itarchitecture/ssr/webservicetest/_vti_bin/lists.asmx?wsdl"), new QName("", "Lists")); port = service.getListsSoap12();
// TODO initialize WS operation arguments here
java.lang.String listName = "testList";
// TODO process result here result = port.getList(listName);
System.out.println("Result = "+result);
} catch (Exception ex) {
// TODO handle custom exceptions here

Thanks in advance!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2004-04-16

Client side stubs must have all necessary POJOs to extract the info from web service.

Joined: 2009-07-10

Thanks so much for the response!

I believe that all the POJOs (referred in your response) would be created while building the client side artifacts (using wsimport- based on the provided wsdl link) in NetBeans. Do we have to create any more POJOs for extracting the data from the result/response of the service?

Can you provide me any example client obtaining data of complex type from a web service?

Thanks and greatly appreciate your time :)