Re: Help with Deserialization of complex object with Java Webservice

2009-07-29 Thread Carmelo
Probably you have to write a metod in your client to deserialize that
object, and you need to do your class Alert implementing serializable.
ES: public class Alert implements serializable{
attributes...
public Allert(){}
}
Remember you have to do a class with an empty constructor.
Then befor you use the metod Invoke you ha to do this:

QName qnameAlert = new QName(urn:nameWebService, Alert);
Class classeAlert = Alert.class;
call.registerTypeMapping(classeAlert, qnameAlert,
BeanSerializerFactory.class,
BeanDeserializerFactory.class);

BeanSerializer/DeserializerFactory.class make for you serialization and
deserialization.
Bye.
Il giorno mar, 28/07/2009 alle 16.47 -0700, guitarro17 ha scritto:
 Let me explain. 
 I have this object:
 public class Alert {
   private String name;
   private String approximateStartDate;
   private String startDate;
   private String stopDate;
 ...
 }
 And in my webservice, I have this method:
   public Alert[] getAlerts() throws Exception{
   VectorAlert vetorAlerts = new VectorAlert();
   vetorAlerts = leitor.readAlerts();
 
 Alert[] Alerts = new Alert[vetorAlerts.size()];
 for(int i=0; ivetorAlerts.size(); i++){
 Alerts[i]=vetorAlerts.get(i);
 }
   return Alerts;
   }
 
 But When I'm trying to access this with J2SE, just like this:
   Call call = (Call) new Service().createCall();
   call.setTargetEndpointAddress(local);
   call.setOperationName(getAlerts);
   Object[] param = null;
   Alert alerts[] = (Alert[])call.invoke(param);
 
 I'm getting this error:
 
 Unable to find required classes (javax.activation.DataHandler and
 javax.mail.internet.MimeMultipart). Attachment support is disabled.
 - Exception:
 org.xml.sax.SAXException: SimpleDeserializer encountered a child element,
 which is NOT expected, in something it was trying to deserialize.
   at
 org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
 ...
 
 I have no idea what I need to do to solve this problem =(
 



Re: Help with Deserialization of complex object with Java Webservice

2009-07-29 Thread Carmelo
Sorry, i don't know.
Il giorno mer, 29/07/2009 alle 06.07 -0700, guitarro17 ha scritto:
 Thank you!
 
 But, in J2ME, What I need to do? Same?
 
 In my client I have this:
 
 public void testWebService() throws Exception { 
   
   SoapSerializationEnvelope envelope = new
 SoapSerializationEnvelope(SoapEnvelope.VER11);
   
   SoapObject soapObject = new SoapObject(url,getAlerts);
   
   envelope.addMapping(url, Alert, new Alert().getClass());
   
   envelope.setOutputSoapObject(soapObject);
   
   HttpTransport transport = new HttpTransport(url);
   
   transport.call(getAlerts,envelope);
   
 //HERE IS THE PROBLEM...
   Vector ret = (Vector)envelope.getResponse();
   
   } 
 



WARN Please initialize the log4j system properly

2009-07-24 Thread Carmelo
Hi,
i've used axis2 wsdl2java tool to create a client from an application
i've deployed.
I get this error when i try to run the client:
log4j:WARN No appenders could be found for logger
(org.apache.axis2.description.AxisService).
log4j:WARN Please initialize the log4j system properly.
What should i do?
Thanks a lot and sorry for my english.



Re: WARN Please initialize the log4j system properly

2009-07-24 Thread Carmelo
Il giorno ven, 24/07/2009 alle 15.26 -0700, Shasta Willson ha scritto:
 On Fri, Jul 24, 2009 at 3:20 PM, Carmelocrmsa...@gmail.com wrote:
  Hi,
  i've used axis2 wsdl2java tool to create a client from an application
  i've deployed.
  I get this error when i try to run the client:
  log4j:WARN No appenders could be found for logger
  (org.apache.axis2.description.AxisService).
  log4j:WARN Please initialize the log4j system properly.
  What should i do?
  Thanks a lot and sorry for my english.
 
 The long story : http://logging.apache.org/log4j/1.2/manual.html
 
 The short story : http://www.mobilefish.com/developer/log4j/log4j.html
 Step 10 is about configuring log4j.properties, which is likely what
 you need to do.
 
 - Shasta

Thank you so much!
It is easy and it works!
Bye.

Carmelo.