Title: Return a primitive type when java.lang.Object is expected
thanks for the response Jim, but...
the service that returns the data is a .net server, so I can't really control it.
the exception is thrown from Call.invoke (before it reaches my code) when it discovers that the returned type is int.
where can I wrap the returned type ????
 
Oren.
-----Original Message-----
From: Stickley, Jim [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 4:35 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Return a primitive type when java.lang.Object is expected

You can not return a primitive type as a java.lang.Object, you will need to wrap it in one of the java.lang type classes, i.e.

 

            Primitive type     java.lang type

            -------------------     -----------------------

            int                     java.lang.Integer

            long                  java.lang.Long

            double               java.lang.Double

            etc...

 

 

Jim Stickley

Birch Telecom

(816) 300-6743

[EMAIL PROTECTED]

 

-----Original Message-----
From: Oren Bar-El [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 2:38 AM
To: [EMAIL PROTECTED]
Subject: Return a primitive type when java.lang.Object is expected

 

Hi All,

I am new with Axis, and trying to evaluate it for my company.

The first test I made was to build a Microsoft.NET web service, and try to consume it with Apache Axis.

The web service has one method that returns an object.

When the actual returned type is String, it works fine, but when I try to return a primitive type (like int or boolean), I get an Exception ("org.xml.sax.SAXException: Bad types (int ->class java.lang.Object)").

I saw that Call.invoke has a overloaded method that accepts and returns a SOAPEnvelope, but I don't really like to build my own SOAPEnvelope.

I tried this with and without WSDL2Java proxies, and got the same error.

Anybody has a solution ?

Thanks,

Oren.

Reply via email to