axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oren Bar-El" <Oren.Bar...@smarteam.com>
Subject RE: Return a primitive type when java.lang.Object is expected
Date Thu, 27 Jun 2002 13:16:23 GMT
build a custom Serializer for primitive types ?
doesn't this look like a bug ?
especially since the line that throws the exception has the remark // FIXME! (org.apache.axis.message.RPCHandler:206)

-----Original Message-----
From: Stickley, Jim [mailto:JStickley@birch.com]
Sent: Thursday, June 27, 2002 4:11 PM
To: 'axis-user@xml.apache.org'
Subject: RE: Return a primitive type when java.lang.Object is expected


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:
   
<ns1:getAssociateIDFromDMZIDResponse
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1
="AssociateInfo">
   
    <getAssociateIDFromDMZIDReturn xsi:type="xsd:int">8002255
    </getAssociateIDFromDMZIDReturn>
  
</ns1:getAssociateIDFromDMZIDResponse>

  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.


Mime
View raw message