axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carl Cabou <ext.altior.ca...@sncf.fr>
Subject Re: serialisation problem.
Date Thu, 20 Mar 2003 10:00:21 GMT
Thanks Jolly !!
Works just fine !!
PS:No need to use "urn:" before the nameSpace. If I do, I get the 
exception again.

Thanks again.
Best regards.

Carl.

Thomas, Jolly (Cognizant) wrote:
> Hi, 
> You need to register your application specific data type at the client end too.
> 
> Following is the piece of code:
> 
> QName    qn      = new QName( "urn:mkbNameSpace", "local" );
> call.registerTypeMapping(Personne.class, qn,
>      new org.apache.axis.encoding.ser.BeanSerializerFactory(Personne.class, qn),
>      new org.apache.axis.encoding.ser.BeanDeserializerFactory(Personne.class, qn));
> 
> Try doing this.
> Regards,
> Jolly
> 
> -----Original Message-----
> From: Carl Cabou [mailto:ext.altior.cabou@sncf.fr]
> Sent: Wednesday, March 19, 2003 7:59 PM
> To: axis-user@ws.apache.org
> Subject: serialisation problem.
> 
> 
> Hi all.
> 
> I'm trying to use a specific class for parameter in a soap call using 
> Axis. I followed the instruction about how to serialize/deserialize for 
> Axis Soap call 
> (http://cvs.apache.org/viewcvs.cgi/~checkout~/xml-axis/java/docs/user-guide.html)
> I want to use a Vector of objetcs. When I run the client of the 
> Webservice I get  the following exception :
> 
> ===============================================================================================
> org.xml.sax.SAXException: No deserializer for {mkbNameSpace}local
>          at 
> org.apache.axis.encoding.DeserializerImpl.onStartElement(DeserializerImpl.java:447)
>          at 
> org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:394)
>          at 
> org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:906)
>          at 
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:200)
>          at 
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:684)
>          at 
> org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:370)
>          at 
> org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:906)
>          at 
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:200)
>          at 
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:684)
>          at 
> org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:370)
>          at 
> org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:906)
>          at 
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:200)
>          at 
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:684)
>          at 
> org.apache.axis.message.RPCElement.deserialize(RPCElement.java:241)
>          at 
> org.apache.axis.message.RPCElement.getParams(RPCElement.java:265)
>          at org.apache.axis.client.Call.invoke(Call.java:1871)
>          at org.apache.axis.client.Call.invoke(Call.java:1777)
>          at org.apache.axis.client.Call.invoke(Call.java:1315)
>          at PClient.main(PClient.java:35)
> [ERROR] Call - -Exception: <org.xml.sax.SAXException: No deserializer 
> for {mkbNameSpace}local>
> org.xml.sax.SAXException: No deserializer for {mkbNameSpace}local
> ===============================================================================================
> 
> Here is the deployement file :
> 
> <deployment xmlns="http://xml.apache.org/axis/wsdd/"
>              xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
>   <service name="PersonneWebService" provider="java:RPC">
>    <parameter name="className" value="PersonneService"/>
>    <parameter name="allowedMethods" value="getPersonnes"/>
>   </service>
> <beanMapping qname="ns:local" xmlns:ns="mkbNameSpace" 
> languageSpecificType="java:Personne"/>
> </deployment>
> 
> ===============================================================================================
> Here is the source of the Personne Java class :
> 
> public class Personne
> {
> 	private String nom;
> 	private String prenom;
> 	private int age;
> 	
> 	public Personne()
> 	{
> 		this("Green","Hulk",28);
> 	}
> 	
> 	public Personne(String nom, String prenom, int age)
> 	{
> 		this.nom=nom;
> 		this.prenom=prenom;
> 		this.age=age;
> 	}
> 	
> 	public String getNom()
> 	{
> 		return(nom);
> 	}
> 
> 	public String getPrenom()
> 	{
> 		return(prenom);
> 	}
> 
> 	public int getAge()
> 	{
> 		return(age);
> 	}
> 	
> 	public void setNom(String nom)
> 	{
> 		this.nom=nom;
> 	}
> 
> 	public void setPrenom(String prenom)
> 	{
> 		this.prenom=prenom;
> 	}
> 
> 	public void setAge(int age)
> 	{
> 		this.age=age;
> 	}
> }
> =============================================================
> 
> Here is the Service source :
> 
> import java.util.Vector;
> 
> public class PersonneService
> {
> 
> 	public Vector getPersonnes()
> 	{
> 		Vector
> 			personnes=new Vector();
> 			
> 		personnes.add(new Personne());
> 		personnes.add(new Personne("Sawyer","Tom",13));
> 		
> 		return(personnes);
> 	}
> 	
> }
> 
> =============================================================
> 	
> Here is the client code :
> 
> import java.util.*;
> import org.apache.axis.client.Call;
> import org.apache.axis.client.Service;
> import javax.xml.namespace.QName;
> 
> public class PClient
> {
> 	public static void main(String [] args)
>     	{
> 		Vector ret=null;
> 		
> 	   	try
> 	    {
> 	
> 			final String endpoint = 
> "http://orion:8080/axis/services/PersonneWebService";
> 	
> 	        org.apache.axis.client.Service service = new Service();
> 	        Call     call    = (Call) service.createCall();
> 	
> 	        call.setTargetEndpointAddress( new java.net.URL(endpoint) );
> 	        call.setOperationName(new QName("urn:PersonneWebService ", 
> "getPersonnes") );
> 	
> 	
> 	        System.out.println("Invoking Webservice ...");
> 	        ret = (Vector) call.invoke( new Object[] {} );
> 	
> 	        System.out.println("Resultat\n'" + ret + "'");
> 	
> 	
> 	      }
> 	      catch (Exception e)
> 	      {
> 	      	System.err.println(e.toString());
> 	      }
> 
>     }
> 
> }
> =======================================================================
> 
> Any idea ?
> 
> Best regards.
> 
> Carl.
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> This e-mail and any files transmitted with it are for the sole use of the intended recipient(s)
and may contain confidential and privileged information. 
> If you are not the intended recipient, please contact the sender by reply e-mail and
destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination,
forwarding, printing or copying of this email or any action taken in reliance on this e-mail
is strictly prohibited and may be unlawful.
> Visit us at http://www.cognizant.com



Mime
View raw message