Skip to topic | Skip to bottom
Grimoires
Grimoires.JavaAddressBookWsdl

Start of topic | Skip to actions

WSDL for Java classes using WSIF

This is an example WSDL created for a java class AddressBook using the Java Extension in the Web services invocation framework

The java class is addressbook.wsiftypes.AddressBook. The class has a function called addEntry. The function takes an input message consisting of a full name and an address.

<?xml version="1.0" ?>

<definitions targetNamespace="http://wsifservice.addressbook/"
             xmlns:tns="http://wsifservice.addressbook/"
             xmlns:typens="http://wsiftypes.addressbook/"
             xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
             xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/"
             xmlns:java="http://schemas.xmlsoap.org/wsdl/java/"
             xmlns="http://schemas.xmlsoap.org/wsdl/">

  <!-- type defs -->
  <types>
    <xsd:schema
      targetNamespace="http://wsiftypes.addressbook/"
                xmlns:xsd="http://www.w3.org/1999/XMLSchema">

      <xsd:complexType name="phone">
        <xsd:element name="areaCode" type="xsd:int"/>

        <xsd:element name="exchange" type="xsd:string"/>
        <xsd:element name="number" type="xsd:string"/>
      </xsd:complexType>

      <xsd:complexType name="address">
        <xsd:element name="streetNum" type="xsd:int"/>
        <xsd:element name="streetName" type="xsd:string"/>

        <xsd:element name="city" type="xsd:string"/>
        <xsd:element name="state" type="xsd:string"/>
        <xsd:element name="zip" type="xsd:int"/>
        <xsd:element name="phoneNumber" type="typens:phone"/>
      </xsd:complexType>
    </xsd:schema>

  </types>

  <!-- message declns -->
  <message name="AddEntryWholeNameRequestMessage">
    <part name="name" type="xsd:string"/>
    <part name="address" type="typens:address"/>
  </message>

  <!-- port type declns -->
  <portType name="AddressBook">
    <operation name="addEntry">
      <input name="AddEntryWholeNameRequest" message="tns:AddEntryWholeNameRequestMessage"/>
    </operation>
  </portType>

  <!-- binding declns -->
  <binding name="JavaBinding" type="tns:AddressBook">
    <java:binding/>
    <format:typeMapping encoding="Java" style="Java">
      <format:typeMap typeName="typens:address" formatType="addressbook.wsiftypes.Address" />

      <format:typeMap typeName="xsd:string" formatType="java.lang.String" />
    </format:typeMapping>
    <operation name="addEntry">
      <java:operation
         methodName="addEntry"
         parameterOrder="name address"
         methodType="instance" />
      <input name="AddEntryWholeNameRequest"/>
    </operation>
  </binding>
  
  <!-- service decln -->
  <service name="AddressBookService">

    <port name="JavaPort" binding="tns:JavaBinding">
      <java:address className="addressbook.wsiftypes.AddressBook"/>
    </port>
  </service>

</definitions>

-- SylviaWong - 02 Dec 2004
to top


You are here: Grimoires > JavaAddressBookWsdl

to top

Copyright 2004 by the University of Southampton