Return-Path: Mailing-List: contact axis-user-help@xml.apache.org; run by ezmlm Delivered-To: mailing list axis-user@xml.apache.org Received: (qmail 88678 invoked from network); 27 Jun 2002 13:12:09 -0000 Received: from mail.birch.com (HELO kcotsmtp0.birch.com) (216.212.17.100) by 209.66.108.5 with SMTP; 27 Jun 2002 13:12:09 -0000 Received: from kcdcex00.birch.com ([10.38.64.26]) by kcotsmtp0.birch.com (NAVGW 2.5.1.18) with SMTP id M2002062708102701516 for ; Thu, 27 Jun 2002 08:10:27 -0500 Received: by kcdcex00.birch.com with Internet Mail Service (5.5.2653.19) id ; Thu, 27 Jun 2002 08:10:50 -0500 Message-ID: <61611E5D89EED511955000D0B7B9EDE9FA429F@kcdcex07.birch.com> From: "Stickley, Jim" To: "'axis-user@xml.apache.org'" Subject: RE: Return a primitive type when java.lang.Object is expected Date: Thu, 27 Jun 2002 08:10:48 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Spam-Rating: 209.66.108.5 1.6.2 0/1000/N You may have to build a custom Serializer in Axis. Jim Stickley Birch Telecom (816) 300-6743 jstickley@birch.com -----Original Message----- From: Oren Bar-El [mailto:Oren.Bar-el@smarteam.com] Sent: Wednesday, June 26, 2002 9:23 AM To: axis-user@xml.apache.org Subject: RE: Return a primitive type when java.lang.Object is expected Hi Cyrus, I think I managed to better understand the problem. I get the error only when I use the method: call.setReturnType(org.apache.axis.Constants.XSD_ANYTYPE), and I have to use it if I want to name my parameters using the addParameter method. does that make any sense ? Oren. -----Original Message----- From: Hurst, Cyrus [mailto:Cyrus_Hurst@tvratings.com] Sent: Wednesday, June 26, 2002 5:05 PM To: 'axis-user@xml.apache.org' Subject: RE: Return a primitive type when java.lang.Object is expected Hello Oren, I have a java web-service that returns int ...The encoded response looks something like: 8002255 On the client I cast the returned object to Integer and it seems to work fine ... -Cyrus -----Original Message----- From: Oren Bar-El [mailto:Oren.Bar-el@smarteam.com] Sent: Wednesday, June 26, 2002 9:56 AM To: axis-user@xml.apache.org Subject: RE: 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:JStickley@birch.com] Sent: Wednesday, June 26, 2002 4:35 PM To: 'axis-user@xml.apache.org' 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 jstickley@birch.com -----Original Message----- From: Oren Bar-El [mailto:Oren.Bar-el@smarteam.com] Sent: Wednesday, June 26, 2002 2:38 AM To: axis-user@xml.apache.org 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.