Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

wsdl2Java stub code - making sense of it. Where to begin?  RSS feed

 
James Ward
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using AXIS2

I have created skeleton code wsdl2java. It has generated really complicated .java Stub file. And i can't make out which method to call for what, and how.

The WSDL is for MSN Search API
http://soap.search.msn.com/webservices.asmx?wsdl

All i want to do is call the search functionality of this webb service.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well according to the WSDL there is only one method "Search".

However you have to submit a fairly complicated XML document to intiate a search. The Search message is roughly structured like this:


The Live Search API Reference explains the significance of each of these fields in a class model.

Axis2's WSDL2Java will use ADB (Axis Data Binding) by default. That means that any element in the above message that does not directly map to a Java primitive type or core class will generate 2 new classes. If I remember correctly one class represents the XML type which is then stuffed inside the second class that represents the XML element. So you will have to build the ADB object representation of the search message from scratch using the classes that WSDL2Java generated before you can call the search method.

The Response will be even more complicated.
[ March 13, 2008: Message edited by: Peer Reynders ]
 
graham king
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just tried this call and get a VersionMismatch Error
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!