File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes which way we can pass more than 25 parameters to a web service? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "which way we can pass more than 25 parameters to a web service? " Watch "which way we can pass more than 25 parameters to a web service? " New topic
Author

which way we can pass more than 25 parameters to a web service?

yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110
Hello all,

I have deployed a sample web service which inserts some data(just 2 parameters) to the database.
If i have to pass more than 25 parameters to a web service, how can i do?

In web application, we could use something like value objects. But to the web service, how to pass a value object?


Thank You!
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Why would using 25 parameters be any different than using 2? What problems do you foresee? What kind of service and which implementation are you using?
yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110
Thank You for your reply Lester Burnham!

A simple registration page has more than 15 parameters(first name, last name, address, city and etc.,) at least. Passing those 15 parameters will make the code poor. I have developed a sample with 'axis 2' soap framework and jboss AS.

I need to perform everything like user registration, getting list of users through my web service.

Is it possible?
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Sure it's possible. If you need to pass 15 parameters, then you need to pass 15 parameters. (Actually, it'll most likely be just 1 parameter, because you would create a object that happens to have 15 fields; but thanks to JAXB you wouldn't see any of that - it would look like a single parameter.)
yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110
Thank You again.

An important advantage of web service is "cross platform and cross language". I need to access the web service from a php client (i will take care this php client). But as your suggestion, if i pass an object (consider an user object), how it will be received and handled by the web service?

Will it detect the object easily?
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
The Java object would be converted to a cross-platform compatible XML representation; at least that's what JAXB does for the JAX-WS API on the Java side. I'm not familiar with how PHP SOAP frameworks work, but presumably along similar lines.
yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110
Thank You Lester Burnham!

I will try to use jaxb and jax-ws APIs.
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

Hi Yuvraj,
I will try to use jaxb and jax-ws APIs.

It's good to use JAXB for your databinding. But, you may not necessarily need to do that. To make your code simple, you can just use any of the webservices framework, which would provide some default data binding mechanism. If you use JAX-WS2.0, incidentally JAXB 2.0 is the default databinding mechanism. As a matter of fact, in most of the cases you don't need to bother about how the underlying data binding works to develop a web service.


Cheers,
Naren
(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110
Thank You Naren!

I am using axis2 with eclipse IDE. But, let me know the difference between axis 2 and jax-ws?

Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

Hi Yuvaraj,
Axis2 is one of the several implementations of JAX-WS.
Check out this post.
yuvaraj KumarAmudhan
Ranch Hand

Joined: Aug 22, 2009
Posts: 110
Thank You Naren!

Axis 2 is a kind of jax-ws implementation!

ok. Thank You All!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: which way we can pass more than 25 parameters to a web service?