aspose file tools*
The moose likes Web Services and the fly likes WS method parameters question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "WS method parameters question" Watch "WS method parameters question" New topic
Author

WS method parameters question

Kaise a.Zakkar
Ranch Hand

Joined: Oct 20, 2003
Posts: 47
Dear All,
IT seems to be a silly question ,but the thing is i need to have some official documents and proofs about the following problem:
I have a method that invokes web service through http proxy , and this method has 12 parameters , i was thinking that it will be more safe to keep those 12 parameters in one single bean , then pass just the been to the web service so the method will be with one parameter , instead of 12 parameters.as the second method could be risky because of a possible network failure or crash during communications with the web service.
so which one will win 12-parameters method
or 1-parameter method
I wonder if you can advice some official documents that assert your choice .
Thanks and Regards


"Nothing is harder on your aurels than resting on them."<br />SCJP 1.4 89%,,SCJA 80%,SCWCD1.4 81%
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42631
    
  65
I don't understand why you think there will be a difference in the presence of possible network problems. Either the call goes through or it doesn't (in which case you'll need to handle the exception), regardless of what the content of the message is, or the topology of the network.

In any case, SOAP does not support arbitrary Java objects to begin with. The SOAP toolkit takes those apart and sends them as individual data items, which probably will look very similar to what would have been sent if you had used individual primitive parameters. So, there isn't much difference to the two approaches.


Ping & DNS - my free Android networking tools app
Kaise a.Zakkar
Ranch Hand

Joined: Oct 20, 2003
Posts: 47
Dear Ulf ,
Thank you very much for your instant response ,and i totally agree with what you've said about the difference between the two approaches .
However , the thing that let me seems to be a little bit paranoid about that 12-parameter methods was from OO perspective. As its not a good programming practice to have a method signature with that size, even if they will be manipulated at the end be in the same shape from SOAP perspective.
Am glade to have your opinion about this issue.
Thanks & Regards
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42631
    
  65
Of course, having 12 parameters to a method is bad design -in any language paradigm, OO or procedural or functional- but you were talking about network problems, and it has no bearing on that.
Kaise a.Zakkar
Ranch Hand

Joined: Oct 20, 2003
Posts: 47
Dear Ulf ,
You hit the right point here ,
can you help me to find some well-known references that proof that this kind of method signatures is regarded as a bad programming practice that we should avoid whatever it was a web service method , or a normal ordinary one.
Thanks allot for your invaluable help.
with my best Regards .

[ August 13, 2008: Message edited by: Kaise a.Zakkar ]
[ August 13, 2008: Message edited by: Kaise a.Zakkar ]
Kaise a.Zakkar
Ranch Hand

Joined: Oct 20, 2003
Posts: 47
Anybody can help me to find what am looking for ??
Thanks & Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WS method parameters question