Home TOC |
![]() ![]() ![]() |
Configuration File
The
xrpcc
tool reads an XML configuration file which specifies the files to be generated. The configuration file has two different formats, depending on whether you are starting with RMI interfaces or a WSDL document. The file can have one format or the other, but not both. The file's<configuration>
element must have either one <rmi
> element or one <wsdl
> element.
Note: Although required for the reference implementation of JAX-RPC, the configuration file andxrpcc
tool are not defined in the specifications. Their syntax and usage may change in future releases.
Starting With RMI Interfaces
If you are starting with RMI interfaces, the tool can generate stubs, ties, a server configuration file, and a WSDL document. In this case, the tool's configuration file must have the following form:
<?xml version="1.0" encoding="UTF-8"?> <configuration xmlns="http://java.sun.com/jax-rpc-ri/xrpcc-config"> <rmi name="[1]" targetNamespace="[2]" typeNamespace="[3]"> <service name="[4]" packageName="[5]"> <interface name="[6]" servantName="[7]" soapAction="[8]" soapActionBase="[9]"/> </service> <typeMappingRegistry> [10] </typeMappingRegistry> </rmi> </configuration>The integers in the preceding syntax indicate the following:
- Model name
- Target namespace for the generated WSDL document
- Target namespace for the schema portion of the generated WSDL document
- Service name
- Package name for the generated classes (for example, the service interface that extends
javax.xml.rpc.Service
)- Fully qualified name of an interface
- Fully qualified name of a servant class that implements the interface in [5]
- Optional - string to be used as the
SOAPAction
for all operations in the corresponding port- Optional - string to be used as a prefix for the
SOAPAction
strings for the operations in the corresponding port- Optional - type mapping information, see Specifying the Type Mapping
For RMI interfaces, the
<configuration>
element must have just one<rmi>
element. The<rmi>
element may contain multiple<service>
elements, which may contain multiple<interface>
elements.SOAPAction Elements
If you are an advanced user you might be interested in the following information about
SOAPAction
elements: If thesoapAction
attribute is specified, all the operations in the generated port will use that string as theSOAPAction.
If thesoapActionBase
attribute is specified, its value will be used as a prefix for the generatedSOAPAction
strings. The suffix will be a unique string; in the current implementation it is the operation name. For example, ifsoapActionBase
is set tohttp://hello/
and the port has two operations,opA
andopB
, theirSOAPAction
strings will behttp://hello/opA
andhttp://hello/opB
respectively. If neithersoapAction
norsoapActionBase
are specified, theSOAPAction
for all operations will be the empty string. Notice that this version of the reference implementation does not rely on theSOAPAction
HTTP header for dispatching.Starting With a WSDL Document
If you are starting with a WSDL document, the tool can generate stubs, ties, a server configuration file, and RMI interfaces. The tool's configuration file must have the following form:
<?xml version="1.0" encoding="UTF-8"?> <configuration xmlns="http://java.sun.com/jax-rpc-ri/xrpcc-config"> <wsdl name="[1]" location="[2]" packageName="[3]"> <typeMappingRegistry> [4] </typeMappingRegistry> </wsdl> </configuration>The integers in the preceding syntax indicate the following:
- Model name
- URL pointing to a WSDL document
- Fully qualified name of the package for the generated classes and interfaces
- Optional: type mapping information, see Specifying the Type Mapping
For WSDL documents, the
<configuration>
element must have just one<wsdl>
element.Server Configuration File
The xrpcc tool also generates a server configuration file for Tomcat. The name of the file is specified by the
<init-param>
element of theweb.xml
file. (Theweb.xml
file is the deployment descriptor for a Web application that's packaged in a WAR file.) For example, theweb.xm
l file might contain the following<init-param>
element:<init-param> <param-name>configuration.file</param-name> <param-value>/WEB-INF/config.properties</param-value> </init-param>Here's an example of a server configuration file that is generated by the
xrpcc
tool:port0.tie=hello.HelloIF_Tie port0.servant=hello.HelloImpl port0.name=HelloIF port0.wsdl.targetNamespace=http://hello.org/wsdl port0.wsdl.serviceName=HelloWorld port0.wsdl.portName=HelloIFPort portcount=1For the
<init-param>
example shown previously, the server configuration file should be copied to theWEB-INF/config.properties
file in the Tomcat installation.Specifying the Type Mapping
Intended for advanced users, this section describes the
<typeMappingRegistry>
element of the tool's configuration file. Here's an example:<typeMappingRegistry> <typeMapping encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <entry schemaType="ns1:SampleType" javaType="org.tempuri.WellKnownClass" serializerFactory= "org.tempuri.WellKnownClassSerializationFactory" deserializerFactory= "org.tempuri.WellKnownClassDeserializationFactory" xmlns:ns1="http://echoservice.org/types"/> </typeMapping> </typeMappingRegistry>A type mapping registry can have multiple type mappings (for different encoding styles). Each mapping consists of multiple entries and all attributes on an entry are mandatory. For more information, see the JAX-RPC Specifications.
Home TOC |
![]() ![]() ![]() |