Creating a web service from an annotated Java bean by publishing to a server
After annotating a Java™ bean, you can generate a web service application by publishing the application project of the bean directly to a server. When your web service is generated, no WSDL file is created in your project.
Before you begin
- For a Java bean in your workspace, you have already specified web services annotations, including at least the @WebService annotation. If there are validation errors or warnings in the Java editor, you should address these to prevent potential problems at run time.
- You have already created a server in your workspace.
About this task
Procedure
Results
Note: If you want
to use SOAP 1.2:
@javax.xml.ws.BindingType (value=javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
you
must you specify the wsdlLocation attribute of the @WebService annotation,
such as in the following example: @javax.jws.WebService (targetNamespace="http://p/", ..., wsdlLocation="WEB-INF/wsdl/EchoService.wsdl")
This
means that you cannot use the WSDL file dynamically generated by WebSphere® Application Server
but must have a WSDL file created beforehand and follow the instructions
in Creating a web service from a Java bean and a WSDL file.
Alternatively you can use the web services wizards, which will generate
a WSDL file for you if you select to use SOAP 1.2 when generating
a web service from a Java bean.