Forums Register Login

Web service method with no parameters

+Pie Number of slices to send: Send
Hi,
I am hoping to get some ideas from some of the Web Services gurus on here. My scenario is that I am designing a Web Service which contains a method with no parameters. I would like to write the WSDL in such a way that's it's clear that no data is required. However, the best way I have thought of to accomplish this is something like:

<xsd:complexType name="getMethod">
<xsd:sequence/>
</xsd:complexType>

<xsd:element name="request" type="ns1:getMethod" />

However, when I generate a client for this using JAX-RPC, it generates the method in the proxy as getMethod(String str) where string is basically useless. My question is, is there a better way to specify a method that does not require any input, or am I stuck with just telling clients to feed junk into the string parameter?

Thanks for any feedback,
KS
+Pie Number of slices to send: Send
I've not tried to do an empty request, but an empty response can be achieved by having no "parts" in the <message> declaration, viz:



If I were you, I'd try this on the message used for the request.

Note that ultimately the form of the Java interface (and hence number of paramters in a Java sense) is dependent upon two things (1) the WSDL content, and (2) how the Java - WSDL mapping tool (Axis, JWSDP, Weblogic wsdl2service etc) interprets the WSDL. So, although you can control (1), it may be difficult to ensure a particular interpretation (that is, producing a method with no parameters) among all the different mapping tools.


-Tim
+Pie Number of slices to send: Send
 

Originally posted by Kevin G Scott:

<xsd:complexType name="getMethod">
<xsd:sequence/>
</xsd:complexType>

<xsd:element name="request" type="ns1:getMethod" />


How about this:

<element name="request">
<complexType name="dummyName"></complexType>
</element>
+Pie Number of slices to send: Send
 

Originally posted by Tim West:
I've not tried to do an empty request, but an empty response can be achieved by having no "parts" in the <message> declaration, viz:



If I were you, I'd try this on the message used for the request.

Note that ultimately the form of the Java interface (and hence number of paramters in a Java sense) is dependent upon two things (1) the WSDL content, and (2) how the Java - WSDL mapping tool (Axis, JWSDP, Weblogic wsdl2service etc) interprets the WSDL. So, although you can control (1), it may be difficult to ensure a particular interpretation (that is, producing a method with no parameters) among all the different mapping tools.


-Tim



Tim,
Thanks for your response. This is an interesting idea, but I would be very concerned about the tool support. I think I tried this once and got an error, but I need to try again.

Thanks,
KS
+Pie Number of slices to send: Send
Hmm, it's legal according to WSDL 1.1, and it's worked for me in Weblogic 8.1.

Good luck though ...and compatibility across different toolkits is still a bit of a pain, hey?


-Tim
+Pie Number of slices to send: Send
 

Originally posted by Tim West:
Hmm, it's legal according to WSDL 1.1, and it's worked for me in Weblogic 8.1.

Good luck though ...and compatibility across different toolkits is still a bit of a pain, hey?


-Tim



Just for the sake of information sharing, I tried this again using the Oracle JDeveloper 10.1.3 Preview (the only edition that supports JAX-RPC) and the wscompile tool in JWSDP 1.5, and neither seems to support this. The wcompile tool returns the following error

"error: parts "parameters" not found in the message "TestWebService1SEI_getTest",wrong WSDL"

Thanks again for the feedback,
KS
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 4341 times.
Similar Threads
Axis 2 Binding question (Important)
Axis2 databinding problem
Axis 1.4 -Serialization of array of Strings
Passing XML document to Web service :: Operation param's type <xsd:any/> or <xsd:string> ?
Trying to figure out why Im getting "cannot be resolved" error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:18:04.