3-16 Getting Started With JAX-WS Web Services for Oracle WebLogic Server
directory of these other Java files. See jwsc in WebLogic Web Services Reference for Oracle WebLogic Server for more information.
3.6.1 Examples of Using jwsc
The following build.xml excerpt shows a basic example of running the jwsc Ant task on a JWS file:
taskdef name=jwsc classname=weblogic.wsee.tools.anttasks.JwscTask
target name=build-service jwsc
srcdir=src destdir=outputhelloWorldEar
jws file=exampleswebserviceshello_worldHelloWorldImpl.java
type=JAXWS jwsc
target
In the example:
■
The Enterprise application will be generated, in exploded form, in outputhelloWorldEar
, relative to the current directory.
■
The JWS file is called HelloWorldImpl.java, and is located in the srcexampleswebserviceshello_world
directory, relative to the current directory. This implies that the JWS file is in the package
examples.webservices.helloWorld .
■
A JAX-WS Web service is generated. The following example is similar to the preceding one, except that it uses the
compiledWsdl attribute to specify the JAR file that contains wsdlc-generated
artifacts for the starting with WSDL use case: taskdef name=jwsc
classname=weblogic.wsee.tools.anttasks.JwscTask target name=build-service
jwsc srcdir=src
destdir=outputwsdlcEar jws
file=exampleswebserviceswsdlcTemperaturePortTypeImpl.java compiledWsdl=outputcompiledWsdlTemperatureService_wsdl.jar
type=JAXWS jwsc
target
In the preceding example, the TemperaturePortTypeImpl.java file is the stubbed-out JWS file that you updated to include your business logic. Because the
compiledWsdl attribute is specified and points to a JAR file, the jwsc Ant task does
not regenerate the artifacts that are included in the JAR. To actually run this task, type at the command line the following:
prompt ant build-service
Developing WebLogic Web Services 3-17
3.6.2 Advanced Uses of jwsc
This section described two very simple examples of using the jwsc Ant task. The task, however, includes additional attributes and child elements that make the tool very
powerful and useful. For example, you can use the tool to:
■
Process multiple JWS files at once. You can choose to package each resulting Web service into its own Web application WAR file, or group all of the Web services
into a single WAR file.
■
Specify the transports HTTPHTTPS that client applications can use when invoking the Web service.
■
Update an existing Enterprise Application or Web application, rather than generate a completely new one.
See jwsc in the WebLogic Web Services Reference for Oracle WebLogic Server for complete documentation and examples about the jwsc Ant task.
3.7 Running the wsdlc WebLogic Web Services Ant Task