Refer to Quick Reference section on org.seasar.remoting.axis.ServiceDef for details. Mapping DefinitionWhen Axis is used and argument type and return type of a service is application specific JavaBeans, whose type are not directly supported by JAX-JPC, values to be passed to these types must be <component name="Hello" class="org.seasar.remoting.axis.examples.ex02.HelloImpl"> <meta name="axis-service"> <component class="org.seasar.remoting.axis.server.ServiceDef"> <initMethod name="addTypeMapping"> <arg> <component type="org.seasar.remoting.axis.server.TypeMappingDef"> <property name="...">・・・</property> </component> </arg> </initMethod> </component> </meta> <property name="..."> ...</property> </component>
Refer to Quick Reference section on org.seasar.remoting.axis.TypeMappingDef for details. WSDD Service PropertiesWhen Web service has a WSDL and Java implementation class was generated by using Axis's WSDL2Java, web service may be deployed by specifying <component name="Magazine" class="org.seasar.remoting.axis.examples.ex05.MagazineSoapBindingImpl"> <meta name="axis-service"> "org/seasar/remoting/axis/examples/ex05/deploy.wsdd" </meta> ... </component> In this situation, because Java type and XML type mapping, which are specified when executing WSDL2Java, are included in Client ConfigurationS2Axis allows web services to be used as a component. Dynamic CallTo call service through Java interface, write dicon file as follows: <!-- Web service proxy --> <component name="Echo" class="org.seasar.remoting.axis.examples.ex01.Echo"> <aspect>remoting</aspect> </component> <!-- Remote call interceptor --> <component name="remoting" class="org.seasar.remoting.common.interceptor.RemotingInterceptor"/> <!-- Axis connector --> <component name="connector" class="org.seasar.remoting.axis.connector.AxisConnector"> <property name="baseURL"> "http://localhost:8080/s2-axis-examples/services/" </property> </component> <!-- Axis service --> <component class="org.apache.axis.client.Service" autoBinding="none"/> Proxy is necessary for each web service. Specify Java interface of web service in
Axis connector calls a web service through Axis service. In the above sample, Axis connector property is set to Axis service by S2's automatic binding. baseURL property is set to base URI of web service endpoint. In the actual communication, value specified in the name attribute of proxy's <component> element is appended to this base URI. Axis connector must have one Axis service uses SOAP protocol to communicate with other web services. Axis service requires at lease one <component> definition for each S2 container. Static CallTo call a service using stub generated by WSDL, create a dicon file as follows: <component class="org.seasar.axis.examples.ex05.Magazine"> locator.getMagazine() </component> <component name="locator" class="org.seasar.axis.examples.ex05.MagazineServiceLocator"/> Service locator is the class generated by WSDL2Java. Stub with implementation of service's Java interface may be retrieved by the Client/Server Common Configuration
|
Name | C | S | Content | Description |
---|---|---|---|---|
axis-deploy |
yes | yes | String | Deploy WSDD file, which has a content specified path string, to Axis. Path name of WSDD file is specified as a relatvie path from the class path. Instance management of service and handler that have been specified in WSDD file are done by Axis. S2 and S2 do not management them. Service and handler, which have been deployed by S2Axis, may be referenced from within WSDD file. |
axis-engine |
yes | yes | String | Specify method to get Axis engine that will deploy services, handlers, and WSDD. Refer to "Method to Get Axis Engine" for details. |
Property | C | S | Content | Description |
---|---|---|---|---|
axis-handler |
yes | yes | Empty | Deploy as a handler a component written as a new element. |
axis-service |
no | yes | empty | Deploy component, which was written in a parent element, as a Axis service. When component implements an interface defined in a method, that method will be released. If an interface is not implemented, public methods that have not been defined as java.lang.Object is released. |
ServiceDef type component |
Deploy components that has been written in a parent element as Axis service. Refer to ServiceDef for detailds. | |||
String | Deploy components that has been written in a parent element as Axis service. Details of a service is as specified in <service> element in the WSDD file, which has been specified by the string path of the content. WSDD file path is specified by relative path from the class path. |
org.seasar.remoting.axis.ServiceDef
Components that are used on the server is set in the <meta>
element.
It is used to specified which components are to be released as a service.
Property | Type | Description |
---|---|---|
serviceType |
String |
Specify type of service that are to be released. Unnecessary method may be avoided from being released by specifying an interface type. Defaults to component type. However, if a component has only one method definition that has an implemented interface, type of that interface is used. |
allowMethods |
boolean |
Name of method to release. To release several methods, separate method names with a space. If omitted, defaults as follows:
|
provider |
String |
Type of service provider. Currently, only RPC and Msg are supported. Defaults to RPC when omitted. |
Method | Description |
---|---|
addTypeMapping(TypeMapping) |
Register type mapping. Refer to the next section for detail on TypeMapping. |
org.seasar.remoting.axis.TypeMappingDef
Components used at the server, set to ServiceDef
component.
Used to specify detailed type mapping of components to be released as a service.
Property | Type | Description |
---|---|---|
type |
Class |
Java type class. It propery is required. |
namespaceURI |
String |
XML type namespace URI. Defaults to URI from Java type package. |
namespacePrefix |
String |
XML type namespace prefix. Defaults to default namespace. |
localPart |
String |
XML type local name. Defaults to Java type class name. |
serializer |
Class | Serializer. Defaults to Axis BeanSerialzierFactory . |
deserializer |
String |
Deserializer. Defaults to Axis BeanDeserialzierFactory . |
encodingStyle |
String |
Encoding style. Defaults to encoded . |
Used to dynamically connect to a web service from a component used at a client.
Property | Type | Description |
---|---|---|
baseURL |
String |
Base URI of service to connect. This URI concatenated with proxy component name (value of name attribute in <component> element), which is an aspect of S2Remoting's RemotingInterceptor, is actually used to connect to a service. |
Component offering S2Remoting.
To use a component as a web service at the client, this component is used as an aspect.
Component offered by Axis.
Required when dynamic call is used at a client.
name
attribute in <service>
element specified in WSDD is used.context-path/services/name
name
attribute in <component>
element in dicon file is used.context-path/services/name
namespace
attribute in <components>
element and value of name
attribute in <component>
element in dicon file is used.context-path/services/namespace/name
service-engine
SettingsContent | Description |
---|---|
(Others) | Same as setting "default" |
"default" |
If S2 container is set javax.servlet.ServletContext then same as "default-server" , if not then same as setting "default-client" . |
"default-client" |
Retrieve component implemenation set by javax.xml.rpc.Service from S2 container and use that engine. |
"default-server" |
To try find engine from searching servlet:AxisServlet . If it could not find one, try to find an engine by searching servlet:AxisEngine . |
"s2:name" |
Use component as Axis engine retrieved from S2 container name . |
"servlet:name" |
Use attribute as Axis engine retrieved from ServletContext 's name . |
(Other) | Use component retrieved by string specified from S2 container string as Axis engine. |
Trans. by H.Ozawa | Copyright© 2004-2005, The Seasar Foundation and the others. All rights reserved. |