Sun Microsystems Logo
Products and Services
 
Support and Training
 
 

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  
 
User Commandswscompile(1M)


NAME

 wscompile - generates stubs, ties, serializers, and WSDL files used in JAX-RPC clients and services

SYNOPSIS

 wscompile [options] configuration_file

DESCRIPTION

Generates the client stubs and server-side ties for the service definition interface that represents the web service interface. Additionally, it generates the WSDL description of the web service interface which is then used to generate the implementation artifacts.

In addition to supporting the generation of stubs, ties, server configuration, and WSDL documents from a set of RMI interfaces, wscompile also supports generating stubs, ties and remote interfaces from a WSDL document.

You must specifiy one of the -gen options in order to use wscompile as a stand alone generator. You must use either -import (for WSDL) or -define (for an RMI interface) along with the -model option in order to use wscompile in conjunction with wsdeploy.

Invoking the wscompile command without specifying any arguments outputs the usage information.

OPTIONS

-cp path

location of the input class files.

-classpath path

same as -cp path option.

-d directory

where to place the generated output files.

-define

read the service's RMI interface, define a service. Use this option with the -model option in order to create a model file for use with the wsdeploy command.

-f:features

enables the given features. Features are specified as a comma separated list of features. See the list of supported features below.

-features:features

same as -f:features option.

-g

generates the debugging information.

-gen

generates the client-side artifacts.

-gen:client

same as -gen option.

-gen:server

generates the server-side artifacts and the WSDL file. If you are using wsdeploy, you do not specify this option.

-httpproxy:host:port

specifies an HTTP proxy server; defaults to port 8080.

-import

reads a WSDL file, generates the service RMI interface and a template of the class that implements the interface. Use this option with the -model option in order to create a model file for use with the wsdeploy command.

-mapping file

writes the mapping file to the specified file.

-model

write the internal model for the given file name. Use this option with the -import option in order to create a model file for use with the wsdeploy command.

-keep

keeps the generated files.

-nd directory

directory for the non-class generated files are stored.

-O

optimizes the generated code.

-s directory

directory for the generated source files.

-source version

generate code for the specified JAX-RPC version. Supported versions are 1.0.1, 1.0.3, 1.1, 1.1.1, and 1.1.2 (the default).

-verbose

output messages about what the compiler is doing.

-version

prints version information.

Exactly one of the -input, -define, -gen options must be specified.

SUPPORTED FEATURES

The --f option requires a comma-separated list of features. The following are the supported features.

datahandleronly

always map attachments to data handler type

documentliteral

use document literal encoding

donotoverride

do not regenerate classes that already exist in the classpath.

donotunwrap

disable unwrapping of document/literal wrapper elements in WSI mode (default).

explicitcontext

turn on explicit service context mapping.

infix:name

specify an infix to use for generated serializers (Solaris).

infix=name

specify an infix to use for generated serializers (Windows).

jaxbenumtype

map anonymous enumeration to its base type.

nodatabinding

turn off data binding for literal encoding.

noencodedtypes

turn off encoding type information.

nomultirefs

turn off support for multiple references.

norpcstructures

do not generate RPC structures (-import only).

novalidation

turn off validation for the imported WSDL file.

resolveidref

resolve xsd:IDREF.

rpclietral

use the RPC literal encoding.

searchschema

search schema aggresively for subtypes.

serializeinterfaces

turn on direct serialization of interface types.

strict

generate code strictly compliant with JAX-RPC 1.1 specification.

unwrap

enable unwrapping of document/literal wrapper elements in WSI mode.

useonewayoperations

allow generation of one-way operations.

wsi

enable WS-I Basic Profile features, to be used for document/literal, and RPC/literal.

donotoverride

do not regenrate the classes

donotunwrap

disables unwrapping of document/literal wrapper elements in WS-I mode. This is on by default.

Note: the -gen options are not compatible with wsdeploy.

CONFIGURATION FILE

The wscompile command reads the configuration file config.xml which contains information that describes the web service. The structure of the file is as follows:

<?xml version="1.0" encoding="UTF-8"?>

<configuration

xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">

<service> or <wsdl> or <modelfile>

</configuration>

The configuration element may contain exactly one <service>, <wsdl> or <modelfile>.

SERVICE ELEMENT

If the <service> element is specified, wscompile reads the RMI interface that describes the service and generates a WSDL file. In the <interface> subelement, the name attribute specifies the service's RMI interface, and the servantName attribute specifies the class that implements the interface. For example:

<service name="CollectionIF_Service"

targetNamespace="http://echoservice.org/wsdl"

typeNamespace="http://echoservice.org/types"

packageName="stub_tie_generator_test">

<interface name="stub_tie_generator_test.CollectionIF"

servantName="stub_tie_generator_test.CollectionImpl"/>

</service>

WSDL ELEMENT

If the <wsdl> element is specified, wscompile reads the WSDL file and generates the service's RMI interface. The location attribute specifies the URL of the WSDL file, and the packageName attribute specifies the package of the classes to be generated. For example:

<wsdl

location="http://tempuri.org/sample.wsdl"

packageName="org.tempuri.sample"/>

MODELFILE ELEMENT

This element is for advanced users.

If config.xml contains a <service> or <wsdl> element, wscompile can generate a model file that contains the internal data structures that describe the service. If a model file is already generated, it can be reused next time while using wscompile. For example:

<modelfile location="mymodel.xml.gz"/>

EXAMPLES

Example 1. Using wscompile to generate client-side artifacts
wscompile -gen:client -d outputdir -classpath classpathdir config.xml

Where a client side artifact is generated in the outputdir for running the service as defined in the config.xml file.

Example 2. Using wscompile to generate server-side artifacts
wscompile -gen:server -d outputdir -classpath classpathdir -model modelfile.Z config.xml

Where a server side artifact is generated in the outputdir and the modelfile in modelfile.Z for services defined in the config.xml file.

SEE ALSO

wsdeploy(1M)


J2EE SDK 1.4Go To TopLast Changed 22 Dec 2004