Question on passing parameter to webservice usinng AXIS

2005-11-13 Thread Developer Developer
Hello All,

I have a webservice method that needs to take a java class as input. I am using AXIS for SOAP and tomcat for my container.

Here is the signature of my webservice method public Integer createProject(Object o). I want to later cast the object o into some other object that the service is expecting as input from the client.


Question : What is the XML Parameter type corresponding to java object in the method addParameter. Eg:. for integer we will use XSD_INTEGER ( see below)
call.addParameter(op1, XMLType.XSD_INTEGER, ParameterMode.IN);.

What should it be for java object ?

Thanks !


Re: Question on passing parameter to webservice usinng AXIS

2005-11-13 Thread Developer Developer


jus a follow up on the this error. I when I try to invoke the webservice i get the following error

nested exception is: java.io.IOException: No serializer found for class cmu.edu.webservice.ProjectObject in registry [EMAIL PROTECTED] Got something from Simple1 


Does anybody know the fix for this problem ?

Thanks a lot.


On 11/13/05, Developer Developer [EMAIL PROTECTED] wrote:

Hello All,

I have a webservice method that needs to take a java class as input. I am using AXIS for SOAP and tomcat for my container.

Here is the signature of my webservice method public Integer createProject(Object o). I want to later cast the object
 o into some other object that the service is expecting as input from the client.

Question : What is the XML Parameter type corresponding to java object in the method addParameter. Eg:. for integer we will use XSD_INTEGER ( see below)
call.addParameter(op1, XMLType.XSD_INTEGER, ParameterMode.IN);.

What should it be for java object ?

Thanks !


Re: Question on passing parameter to webservice usinng AXIS ( Problem with registration) - Somebody please review my code. - Already spent a lot of time on this one.

2005-11-13 Thread Developer Developer
I think I am not doing the registration and type mapping correctly. I would really appreciate if somebody can review my code and deployment descriptor.

Here is the type mapping
beanMapping qname=myNS:ProjectObject 
xmlns:myNS=urn:ProjectManager languageSpecificType=
cmu.edu.webservice.ProjectObject/beanMapping

Here is my clinet code

 Service service = new Service(); Call call = (Call) service.createCall(); QName qn = new QName( urn:ProjectManager, ProjectObject );
call.registerTypeMapping(ProjectObject.class, qn, new org.apache.axis.encoding.ser.BeanSerializerFactory(ProjectObject.class, qn),  new org.apache.axis.encoding.ser.BeanDeserializerFactory
(ProjectObject.class, qn));

 call.setTargetEndpointAddress(new java.net.URL(endpoint)); call.setOperationName(new QName(http://soapinterop.org/, method));
call.addParameter(op1,qn, ParameterMode.IN);
Integer ret = (Integer) call.invoke( new Object[] { obj1} );


Here isthe error I am getting
org.xml.sax.SAXException: Deserializing parameter 'op1': could not find deserializer for type {urn:ProjectManager}ProjectObject Got something from Simple1

 



On 11/13/05, Developer Developer [EMAIL PROTECTED] wrote:



jus a follow up on the this error. I when I try to invoke the webservice i get the following error

nested exception is: java.io.IOException: No serializer found for class cmu.edu.webservice.ProjectObject in registry [EMAIL PROTECTED] Got something from Simple1 


Does anybody know the fix for this problem ?

Thanks a lot.



On 11/13/05, Developer Developer [EMAIL PROTECTED]
 wrote: 

Hello All,

I have a webservice method that needs to take a java class as input. I am using AXIS for SOAP and tomcat for my container.

Here is the signature of my webservice method public Integer createProject(Object o). I want to later cast the object o into some other object
 that the service is expecting as input from the client.

Question : What is the XML Parameter type corresponding to java object in the method addParameter. Eg:. for integer we will use XSD_INTEGER ( see below)
call.addParameter(op1, XMLType.XSD_INTEGER, ParameterMode.IN);.

What should it be for java object ?

Thanks !


Re: Question on passing parameter to webservice usinng AXIS ( Problem with registration) - Somebody please review my code. - don't worry I solved the problem.

2005-11-13 Thread Developer Developer
It was a stupid typo. I could solve the problem when
replaced the mapping element in wsdd
beanMapping qname=myNS:ProjectObject xmlns:myNS
=urn:ProjectManager languageSpecificType= cmu.edu.webservice.ProjectObject/
beanMapping 

with

beanMapping qname=myNS:ProjectObject 
xmlns:myNS=urn:ProjectManager languageSpecificType= java:cmu.edu.webservice.ProjectObject
/beanMapping 

notice the java: was missing in the languageSpecificType attribute.

Thanks for reading the mails .





On 11/13/05, Developer Developer [EMAIL PROTECTED] wrote:

I think I am not doing the registration and type mapping correctly. I would really appreciate if somebody can review my code and deployment descriptor.

Here is the type mapping
beanMapping qname=myNS:ProjectObject 
xmlns:myNS=urn:ProjectManager languageSpecificType= 
cmu.edu.webservice.ProjectObject/beanMapping 
 
Here is my clinet code

 Service service = new Service(); Call call = (Call) service.createCall(); QName qn = new QName( urn:ProjectManager, ProjectObject );
call.registerTypeMapping(ProjectObject.class, qn, new org.apache.axis.encoding.ser.BeanSerializerFactory(ProjectObject.class, qn),  new org.apache.axis.encoding.ser.BeanDeserializerFactory
 (ProjectObject.class, qn));

 call.setTargetEndpointAddress(new java.net.URL(endpoint)); call.setOperationName(new QName(
http://soapinterop.org/, method));
call.addParameter(op1,qn, ParameterMode.IN);
Integer ret = (Integer) call.invoke( new Object[] { obj1} );


Here isthe error I am getting
org.xml.sax.SAXException: Deserializing parameter 'op1': could not find deserializer for type {urn:ProjectManager}ProjectObject Got something from Simple1

 



On 11/13/05, Developer Developer [EMAIL PROTECTED]
 wrote: 



jus a follow up on the this error. I when I try to invoke the webservice i get the following error

nested exception is: java.io.IOException: No serializer found for class cmu.edu.webservice.ProjectObject in registry [EMAIL PROTECTED] Got something from Simple1 


Does anybody know the fix for this problem ?

Thanks a lot.



On 11/13/05, Developer Developer [EMAIL PROTECTED] 
 wrote: 

Hello All,

I have a webservice method that needs to take a java class as input. I am using AXIS for SOAP and tomcat for my container.

Here is the signature of my webservice method public Integer createProject(Object o). I want to later cast the 
object o into some other object that the service is expecting as input from the client.

Question : What is the XML Parameter type corresponding to java object in the method addParameter. Eg:. for integer we will use XSD_INTEGER ( see below)

call.addParameter(op1, XMLType.XSD_INTEGER, ParameterMode.IN);.

What should it be for java object ?

Thanks !