• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web Service consumed by non-java clients

 
Suresh Kumar
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Web Service can be accessed by any client(java or non-java). If it is non-java, how about the request/response parameters are considered for a non-java client.

Thanks in Advance.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The client (java or non-java) simply uses its host language specific mapping rules (e.g. XML-to-Java) to generate objects/structures/records that reflect the XML elements found in the requests and responses described in WSDL.

However even in the presence of these mapping rules even Java WS clients may get different Java objects on the client side than those that exist on the server side.

Under JAX-RPC java.util.Calendar maps to {http://www3.org/2001/XMLSchema}dateTime (and back). An array of java.lang.String is simply mapped to an {http://www3.org/2001/XMLSchema}string based XML element with a maxOccurs="unbounded" (and back).

However there are no mappings for most non-primitive Java types. So, for Example, any java.util.Collection based classes like ArrayList on the server side will end up as arrays on the client side. JAX-RPC Mapping Files were supposed to help so that you could coerce the array back to an ArrayList - but that means that information outside of the WSDL would have to be used to produce the desired java-client interface.

Because of these issues it is important to realize that the web service producer and web service consumer simply exchange messages that contain semi-structured data - they do not exchange full-blown (Java) objects.

contract first
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic