axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arijit Mukherjee" <Arijit.Mukher...@newcastle.ac.uk>
Subject RE: how to get rid of these warnings?
Date Thu, 21 Oct 2004 09:17:40 GMT
Further to what Tami has mentioned -

You can use your ORM objects within your service - I mean send an object to your service so
that it is saved by hibernate in your DB or retrive an object - but that requires a document
oriented approach. Define your objects in an xsd schema, use that in your WSDL. In this case
there can be a slight problem in case of collections, as hibernate prefers SET, LIST or BAG
- but the stubs that will be generated by Axis WSDL2Java would contain arrays. You have two
options in such cases - (1) use arrays in hibernate instead of set/list/bag or (2) create
an interim layer which would convert the axis objects into hibernate objects (the only major
thing in this case you need to do is to convert the array into a set).

I have been working with such a service which uses hibernate in the background to load/save
different objects, and I use the axis generated beans for this purpose.

Cheers
Arijit

>-----Original Message-----
>From: Tami Wright [mailto:ttwright@myfamilyinc.com] 
>Sent: 20 October 2004 23:53
>To: axis-user@ws.apache.org
>Subject: RE: how to get rid of these warnings?
>
>Any complex objects being passed across the wire need to be 
>standard bean types (getters/setters) with a default 
>constructor in each.  java.util.List and 
>net.sf.hibernate.Interceptor will not qualify because axis 
>cannot marshall/unmarshall them into 
>platform-independent/soap-compliant types.
>
>Sample complex object for web service:
>
>Class Product
>{
>	private String name;
>	private String type;
>
>	public Product(){}  //A default constructor takes not parameters
>	
>	public String getName()
>	{
>		return this.name;
>	}
>
>	public void setName(String name)
>	{
>		this.name = name;
>	}
>
>	public String getType()
>	{
>		return this.type;
>	}
>
>	public void setType(String type)
>	{
>		this.type = type;
>	}
>} 
>
>Sample web-service method using complex object Product:
>
>Public Product getProduct(String productName) {
>	Product product = new Product();
>	... //Your code
>	return product;
>}
>
>If you want to use List and Interceptor(Hibernate) the design 
>pattern is to use them inside your web-service, but do not 
>expose them to web service clients (Remote Fa├žade pattern).  
>So if you are doing some sort of object-relational mapping, do 
>so, but don't use the tool's objects to be return types.  Use 
>the tool to create your "Product" bean and then let the 
>web-service return it to the client.  Remember, web services 
>are for interoperability.  A .NET client wouldn't know how to 
>operate on a Java List or Hibernate Interceptor.
>
>Go through Java2Wsdl and Wsdl2Java again, and then see what happens.
>
>Best Regards,
>
>Tami Wright
>
>-----Original Message-----
>From: Koney, Satish [mailto:Satish_Koney@syntelinc.com]
>Sent: Wednesday, October 20, 2004 10:00 AM
>To: axis-user@ws.apache.org
>Subject: how to get rid of these warnings?
>
>I am trying to develop the service using Spring and Hibernate.
>When I try to get the WSDL from the java classes I am getting 
>the following
>warnings:
>
>WARNING: The class java.util.List is defined in a java or 
>javax package and cann ot be converted into an xml schema 
>type.  An xml schema anyType will be used to define this class 
>in the wsdl file.
>
>
>WARNING: The class net.sf.hibernate.Interceptor does not 
>contain a default const ructor, which is a requirement for a 
>bean class.  The class cannot be converted into an xml schema 
>type.  An xml schema anyType will be used to define this clas 
>s in the wsdl file.
>
>
>I ignored the warnings and executed WSDL2Java command and the 
>WSDD file was generated.
>When I tried to deploy the service with that WSDD, I am getting error
>message:
>
>
>Null Response Message  
>
>So I think the problem is with those warnings that I ignored earlier...
>
>Can someone plz tell me how to remove those warnings??
>
>Thanks,
>SSSS
>
>
>____________________________________________
>Confidential:  This electronic message and all contents 
>contain information from Syntel, Inc. which may be privileged, 
>confidential or otherwise protected from disclosure. The 
>information is intended to be for the addressee only. If you 
>are not the addressee, any disclosure, copy, distribution or 
>use of the contents of this message is prohibited.  If you 
>have received this electronic message in error, please notify 
>the sender immediately and destroy the original message and all copies.
>
>
>
>

Mime
View raw message