aspose file tools*
The moose likes Web Services and the fly likes Java Integer Object in Axis - WSDL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Java Integer Object in Axis - WSDL" Watch "Java Integer Object in Axis - WSDL" New topic
Author

Java Integer Object in Axis - WSDL

Lakshmanakumar Loganathan
Greenhorn

Joined: Jan 29, 2006
Posts: 23
Hi
I am using apache axis for both client & server side. In server side i am declaring java one Integer object & one String. I am generating wsdl file & generated java files from that.
Now i am passing Value for Integer & String from client side.
In serverside when i print both i am able to receive String object value, but for Integer i am receiving null.


What went wrong..
please its urgent. Whether i am not able to pass Integer object in java.Its working fine when i used int.

My wsdl file as follows


<element name="banner" nillable="true" type="soapenc:string"/>
<element name="releaseYear" nillable="true" type="soapenc:int"/>

Its urgent plz give me solution wat to do...
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Axis doesn't requires any extra configuration for sending some basic variable as SOAP message, but for sending objects like Interger or Double or Javabeans its requires us to specify the way to de/serialize. See here on how to do so and also check our Webservces FAQ.


Spritle Software Blogs
Lakshmanakumar Loganathan
Greenhorn

Joined: Jan 29, 2006
Posts: 23
Hi balaji,
Thanks for ur reply.

My Bean as follows




server-config.wsdd
------------------
<service name="mwservice" provider="java:RPC">
<typeMapping qname="middleware:Content"
xmlns:middleware="urn:middleware" languageSpecificType="java:com.etrance.iptv.domain.Content"

serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</service>

[ April 18, 2006: Message edited by: Balaji Loganathan ]
Lakshmanakumar Loganathan
Greenhorn

Joined: Jan 29, 2006
Posts: 23
Hi balaji,
Thanks for ur reply.

My Bean as follows




server-config.wsdd
------------------



From wsdl file i am generating Java files & calling function.
For String its working fine. But still for Float/Integer, giving null. Please give the solution fast...

[Part of my wsdl file]




Please......


[ April 18, 2006: Message edited by: Balaji Loganathan ]
[ April 18, 2006: Message edited by: Balaji Loganathan ]
Lakshmanakumar Loganathan
Greenhorn

Joined: Jan 29, 2006
Posts: 23
Hi balaji

Its urgent Please help me. Still for Integer/Long objects inside the bean is giving null. But String is working well.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi,
I have edited your message to avoid non-breaking code display.

Like i said in my previous post, you have explicitly tell the AXIS on how to SOAP interget/long parameters...
For example, you could try as shown below...


The proper and easier way to generate wsdd, de/serializers, stub, skeleton is......use Java2WSDL and WSDL2Java

for example first generate wsdl(say my.wsdl) for the service class Content using Java2WSDL

then use WSDL2Java and supply the generated wsdl(my.wsdl). WSDL2Java can generate sample stub, skeleton, package, wsdd etc.,

once done.... deploy them...

this way you can also assure the inteoperability with .NET

Sorry, I dont have time right now to explain further on how to use java2wsdl or wsdl2java, but the axis website has ready to use examples...
check it out and let me know how it goes..
Lakshmanakumar Loganathan
Greenhorn

Joined: Jan 29, 2006
Posts: 23
Hi Balaji,
First thank u very much for reply.
While generating wsdl2java.
i am getting following error.



Lakshmanakumar Loganathan
Greenhorn

Joined: Jan 29, 2006
Posts: 23
Hi balaji,
while generating wsdl file, (http://localhost:8080/middleware/services/wsdl?mwservice) i am getting
following message in eclipse console.







[ April 19, 2006: Message edited by: Balaji Loganathan ]
Lakshmanakumar Loganathan
Greenhorn

Joined: Jan 29, 2006
Posts: 23
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi,
I tried to create the service which could return an Integer or Float variable. It is an expected fail as Axis doesn't have equivalent xml schema type for Integer/Float.
If i want any client to connect to my webservices, then i would certianly avoid Integer/Float kind of objects and I will go for beans (complex types). Can you make that change ?
If you still prefer to use Integer,then you can try writing Custom Serializer or use RMI.
Lakshmanakumar Loganathan
Greenhorn

Joined: Jan 29, 2006
Posts: 23
Thank you very much Balaji, for ur answer..

i am using bean...

regrds
Lakshman
:roll:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Integer Object in Axis - WSDL