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 Optional operation parameters (long types) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Optional operation parameters (long types)" Watch "Optional operation parameters (long types)" New topic
Author

Optional operation parameters (long types)

Steve Tallamy
Greenhorn

Joined: Mar 27, 2006
Posts: 5
I'm currently trying to get Apache Axis to allow nil elements for particular parameters to one of my methods. The parameters are of type long. When I deploy and try to send a request Axis responds with "No such operation". Below are some snippets of code

WSDL Sections


SOAP Request


SOAP Response


[ March 27, 2006: Message edited by: Steve Tallamy ]
[ March 27, 2006: Message edited by: Steve Tallamy ]
Steve Tallamy
Greenhorn

Joined: Mar 27, 2006
Posts: 5
Has anyone got any thoughts on this?
Steve Tallamy
Greenhorn

Joined: Mar 27, 2006
Posts: 5
Suprised nobody has a solution to this as I would assume it's quite a common requirement. Can anyone point me to someone or somewhere that could help with this?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Theoretically you should be able to specify:
WSDL


That should then translate to an endpoint interface like

Note that the parameters of the endpoint interface are in fact java.lang.Long object references which can be set to "null" (i.e. they do not refer to an object at all) � something you cannot do with the intrinsic "long" type. Also in the part definition you are using "element" rather than "type".

However I have no idea whether Axis (WSDL2Java) supports this properly.
[ April 18, 2006: Message edited by: Peer Reynders ]
Steve Tallamy
Greenhorn

Joined: Mar 27, 2006
Posts: 5
Thanks for the help - certainly looks like it should work. Unfortunately, wsdl2java does not create the end-point as you describe. I still uses primative longs instead of object Longs.

Could this be a limitation in Axis?

Are there any alternatives/work-arounds?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
According to the Axis User's Guide its supposed to work that way; see How your Java types map to SOAP/XML types.
However you are currently using SOAP Section 5 encoding (RPC/encoded).


For interop to work you need to change your binding to literal

[ April 19, 2006: Message edited by: Peer Reynders ]
Steve Tallamy
Greenhorn

Joined: Mar 27, 2006
Posts: 5
Even the change to literal doesn't work. Boo-hoo. Thanks for the idea anyway!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Optional operation parameters (long types)