Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

The following example illustrates the requirement from Geronimo of having the same name the request elements. Look for the three occurrences of "myOperation".

Code Block
xml
xml
borderStylesolidxml
<wsdl:definitions targetNamespace="http://myService.com/service"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:tns="http://myService.com/service"
        xmlns:types="http://myService.com/service/types">
    
    <wsdl:types>
        <xsd:schema targetNamespace="http://myService.com/service/types">
            <xsd:element name="myOperation">...</xsd:element>
            <xsd:element name="myOperationResponse">...</xsd:element>
        </xsd:schema>
    </wsdl:types>

    <wsdl:message name="myOperationRequest">
        <wsdl:part element="types:myOperation" name="parameters"/>
    </wsdl:message>
    <wsdl:message name="myOperationResponse">
        <wsdl:part element="types:myOperationResponse" name="result"/>
    </wsdl:message>

    <wsdl:portType name="myServicePortType">
        <wsdl:operation name="myOperation">
            <wsdl:input message="tns:myOperationRequest"
                    name="myOperationRequest"/>
            <wsdl:output message="tns:myOperationResponse"
                    name="myOperationResponse"/>
        </wsdl:operation>
    </wsdl:portType>
    ...
</wsdl:definitions>

...

After extracting the zip file, a phonebook directory is created. From now on this directory will be referred as <phonebook_home>. In the <phonebook_home>/config directory open the build.properties file and edit the geronimo.home as given in below.

Code Block
xml
xml
borderStylesolid
titlebuild.propertiesxml
## Set the Geronimo 1.1 home here
geronimo.home=<geronimo_home>

...

In addition to the compiled Java classes and the previously mentioned WSDL and JAXP-RPC mapping files the WEB-INF directory of the archive contains standard web.xml and webservices.xml deployment descriptors and a descriptor specific to JBoss jboss-web.xml. The JBoss deployment descriptor is illustrated in below.

Code Block
xml
xml
2jboss-web.xml
borderStylesolidxml
<?xml version="1.0" encoding="UTF-8"?>

<jboss-web>
    <context-root>/phonebook</context-root>
</jboss-web>

...

The Search a Phone Directory Web services sample application uses WSDL names convention supported by both servers. Therefore the only thing that you need to do prior to deploy the application on Geronimo is to replace the deployment descriptor specific to JBoss with one specific to Geronimo. The geronimo-web.xml file is located in the <phonebook_home>/web/WEB-INF directory and its contents is listed below.

Code Block
xml
xml
2geronimo-web.xml
borderStylesolidxml
<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1">
  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
    <dep:moduleId>
      <dep:groupId>org.apache.geronimo.samples</dep:groupId>
      <dep:artifactId>phonebook</dep:artifactId>
      <dep:version>1.0</dep:version>
      <dep:type>car</dep:type>
    </dep:moduleId>
    <dep:dependencies>
    	<dep:dependency>
           <dep:groupId>geronimo</dep:groupId>
           <dep:artifactId>geronimo-webservices</dep:artifactId>
           <dep:type>jar</dep:type>
        </dep:dependency>
		<dep:dependency>
           <dep:groupId>geronimo</dep:groupId>
           <dep:artifactId>geronimo-axis</dep:artifactId>
           <dep:type>jar</dep:type>
        </dep:dependency>
    </dep:dependencies>
    <dep:hidden-classes/>
    <dep:non-overridable-classes/>
  </dep:environment>
  <context-root>/phonebook</context-root> 
</web-app>

...