I have created a java web service with netbeans 7.1 (glassfish3.1).
It is supposed to be visited via clicking a URL (like: http://localhost:8080/ImageService/GetImage?visitDate=‘2012-01-01’) to generate an image for web users. And there are some parameters in the URL that I need to get to use inside the WebMethod.
@WebMethod(operationName = "GetImage")
public void GetImage() {
// Date visitDate = GET["visitDate"];
...
}
Or, how can I make the java web service invoked via http get method?
PS: In .net, this config will enable the feature – calling a web service via URL. I’m asking for a java version.
<webServices>
<protocols>
<add name="HttpPost"/>
<add name="HttpGet"/>
</protocols>
</webServices>
Is this doable? How can I get that work?
Thanks!
Finally, I have given up this, turn to use jsp to do that. But still hoping someone can tell me – if web-service way is possible or not.
Thanks!
The @WebParam annotation is defined by the javax.jws.WebParam interface. It is placed on the parameters of the methods defined in the SEI. The @WebParam annotation allows you to specify the direction of the parameter, if the parameter will be placed in the SOAP header, and other properties of the generated wsdl:part.