You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsif-user@ws.apache.org by Ma...@nokia.com on 2003/05/03 17:17:57 UTC

WS-IF and Axis

hi all,
	i have a little doubt.
if i am correct, WS-IF runs axis under the hood, right?
as a matter of fact, for generating classes from WSDL i use same command.... 
java org.apache.axis.wsdl.WSDL2Java <filename.wsdl>

however, the end result is little different: when i run above command using axis libraries,
i can get the interface for the portType described in the WSDL file

when instead i launch same command with WS-if, i don't get the interface for the portType.

is some sort of bug? or am i missing something? fact is taht the samples comes already
with the interfaces generated..and when i tried to start from scratch from a plain wsdl file,
the interface for the portType were never generated..

anyone can help?

thanx and regards
	marco


> -----Original Message-----
> From: Mistroni Marco (NET-IMN/Espoo) 
> Sent: 03 May, 2003 17:29
> To: 'wsif-user@ws.apache.org'
> Subject: How to start from scratch with WS-if
> 
> 
> hi all,
> 	i am trying to start from a wsdl file in WS-IF and 
> generate classes, but
> i am having problems.
> i took the addressbook.wsdl file from samples\localjava 
> directory, and i run
> following command
> 
> java org.apache.axis.wsdl.WSDL2Java AddressBook.wsdl
> 
> 
> however,the interface 'AddressBook.java' is never generated.
> 
> as of documentation of axis, above command shold produce
> 
> For each entry in the type section A java class 
>  A holder if this type is used as an inout/out parameter 
> For each portType A java interface 
> For each binding A stub class 
> For each service A service interface 
>  A service implementation (the locator 
> 
> however, from following WSDL (addressbook.wsdl)
> 
> <?xml version="1.0" ?>
> 
> <definitions targetNamespace="http://wsifservice.addressbook/"
>              xmlns:tns="http://wsifservice.addressbook/"
>              
> xmlns:typens="http://wsiftypes.addressbook.stub.client.localjava/"
>              xmlns:xsd="http://www.w3.org/1999/XMLSchema"
>              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>              
> 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.stub.client.localjava/"
>                 xmlns:xsd="http://www.w3.org/1999/XMLSchema">
>       <xsd:complexType name="phone">
>         <xsd:sequence>
>           <xsd:element name="areaCode" type="xsd:int"/>
>           <xsd:element name="exchange" type="xsd:string"/>
>           <xsd:element name="number" type="xsd:string"/>
>         </xsd:sequence>
>       </xsd:complexType>
> 
>       <xsd:complexType name="address">
>         <xsd:sequence>
>           <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:sequence>
>       </xsd:complexType>
>     </xsd:schema>
>   </types>
> 
>   <!-- message declns -->
>   <message name="AddEntryWholeNameRequestMessage">
>     <part name="name" type="xsd:string"/>
>     <part name="address" type="typens:address"/>
>   </message>
> 
>   <message name="AddEntryFirstAndLastNamesRequestMessage">
>     <part name="firstName" type="xsd:string"/>
>     <part name="lastName" type="xsd:string"/>
>     <part name="address" type="typens:address"/>
>   </message>
> 
>   <message name="GetAddressFromNameRequestMessage">
>     <part name="name" type="xsd:string"/>
>   </message>
> 
>   <message name="GetAddressFromNameResponseMessage">
>     <part name="address" type="typens:address"/>
>   </message>
> 
>   <!-- port type declns -->
>   <portType name="AddressBook">
>     <operation name="addEntry">
>       <input name="AddEntryWholeNameRequest" 
> message="tns:AddEntryWholeNameRequestMessage"/>
>     </operation>
>     <operation name="addEntry">
>       <input name="AddEntryFirstAndLastNamesRequest" 
> message="tns:AddEntryFirstAndLastNamesRequestMessage"/>
>     </operation>
>     <operation name="getAddressFromName">
>       <input name="GetAddressFromNameRequest" 
> message="tns:GetAddressFromNameRequestMessage"/>
>       <output name="GetAddressFromNameResponse" 
> message="tns:GetAddressFromNameResponseMessage"/>
>     </operation>
>   </portType>
> 
>   <!-- binding declns -->
>   <binding name="JavaBinding" type="tns:AddressBook">
>     <java:binding/>
>     <format:typeMapping encoding="Java" style="Java">
>       <format:typeMap typeName="typens:address" 
> formatType="localjava.client.stub.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>
>     <operation name="addEntry">
>       <java:operation
>          methodName="addEntry"
>          parameterOrder="firstName lastName address"
>          methodType="instance" />
>       <input name="AddEntryFirstAndLastNamesRequest"/>
>     </operation>
>     <operation name="getAddressFromName">
>       <java:operation
>          methodName="getAddressFromName"
>          parameterOrder="name"
>          methodType="instance"
>          returnPart="address" />
>       <input name="GetAddressFromNameRequest"/>
>       <output name="GetAddressFromNameResponse"/>
>     </operation>
>   </binding>
> 
>   <!-- service decln -->
>   <service name="AddressBookService">
>     <port name="JavaPort" binding="tns:JavaBinding">
>       <java:address className="localjava.service.AddressBookImpl"/>
>     </port>
>   </service>
> 
> </definitions>
> 
> 
> i never obtain the interface AddressBook..
> 
> where is the 'trick'?
> 
> thanx and regards
> 	marco
> 
> 
> 
> 
> 
> 
> > -----Original Message-----
> > From: ext Roberto Podesta' [mailto:ropode@laser.dist.unige.it]
> > Sent: 03 May, 2003 17:23
> > To: wsif-user@ws.apache.org
> > Subject: Re: getting started /help
> > 
> > 
> > SOAP2.3 gives support to the Java Hashtable like to the Java 
> > String, maybe
> > you have only to write:
> > <part name="name" type="xsd:hashtable"/>
> > instead of
> > <part name="name" type="java.util.Hashtable"/>
> > 
> > 
> > 
> > ----- Original Message -----
> > From: <Ma...@nokia.com>
> > To: <ws...@ws.apache.org>
> > Sent: Saturday, May 03, 2003 3:32 PM
> > Subject: getting started /help
> > 
> > 
> > > hi all,
> > > i am trying to define in WSDL a simple service that accepts 
> > an Hashtable
> > > as input parameter, but i don't know how to define it...
> > > i tried to avoid it and write following WSDL
> > >
> > > <?xml version="1.0" ?>
> > >
> > > <definitions targetNamespace="http://wsifservice.addressbook/"
> > >              xmlns:tns="http://wsifservice.addressbook/"
> > >
> > xmlns:typens="http://wsiftypes.addressbook.stub.client.localjava/"
> > >              xmlns:xsd="http://www.w3.org/1999/XMLSchema"
> > >              xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > >              
> > xmlns:format="http://schemas.xmlsoap.org/wsdl/formatbinding/"
> > >              xmlns:java="http://schemas.xmlsoap.org/wsdl/java/"
> > >              xmlns="http://schemas.xmlsoap.org/wsdl/">
> > >
> > >   <!-- type defs -->
> > >
> > >   <!-- message declns -->
> > >
> > >   <message name="GetJoltServiceRequestMessage">
> > >     <part name="name" type="java.util.Hashtable/>
> > >   </message>
> > >
> > >   <message name="GetJoltServiceResponseMessage">
> > >     <part name="service" type="xsd:string"/>
> > >   </message>
> > >
> > >   <!-- port type declns -->
> > >   <portType name="JoltTool">
> > >     <operation name="getJoltService">
> > >       <input name="GetJoltServiceRequest"
> > message="tns:GetJoltServiceRequestMessage"/>
> > >       <output name="GetJoltServiceResponse"
> > message="tns:GetJoltServiceResponseMessage"/>
> > >     </operation>
> > >   </portType>
> > >
> > >   <!-- binding declns -->
> > >   <binding name="JavaBinding" type="tns:JoltTool">
> > >     <java:binding/>
> > >     <format:typeMapping encoding="Java" style="Java">
> > >       <format:typeMap typeName="xsd:string" 
> > formatType="java.lang.String"
> > />
> > >       <format:typeMap typeName="xsd:hashtable"
> > formatType="java.util.Hashtable"/>
> > >     </format:typeMapping>
> > >     <operation name="getJoltService">
> > >       <java:operation
> > >          methodName="getJoltService"
> > >          parameterOrder="name"
> > >          methodType="instance"
> > >          returnPart="service" />
> > >       <input name="GetJoltServiceRequest"/>
> > >       <output name="GetJoltServiceResponse"/>
> > >     </operation>
> > >   </binding>
> > >
> > >   <!-- service decln -->
> > >   <service name="JoltToolkService">
> > >     <port name="JavaPort" binding="tns:JavaBinding">
> > >       <java:address className="marco.JoltToolImpl"/>
> > >     </port>
> > >   </service>
> > >
> > > </definitions>
> > >
> > > but i got following exception (obviously)
> > >
> > > C:\wsif-2.0>java org.apache.axis.wsdl.WSDL2Java
> > samples\localjava\JoltTool.wsdl
> > > java.io.IOException: Type
> > {http://schemas.xmlsoap.org/wsdl/}java.util.Hashtable
> > > is referenced but not defined.
> > >         at
> > 
> org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(Symbol
> > > Table.java:484)
> > >         at
> > 
> org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:384
> > > )
> > >         at
> > 
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> > > a:371)
> > >         at
> > 
> org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.jav
> > > a:358)
> > >         at
> > org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:243)
> > >         at java.lang.Thread.run(Thread.java:479)
> > >
> > >
> > >
> > > so, if the input param is a java type, how do i specify 
> it in WSDL?
> > >
> > > anyone can help?
> > >
> > > thanx in advance and regards
> > > marco
> > >
> > >
> > >
> > >
> > 
> > 
>