Yes I'm using Axis2 (1.4). I noticed the same thing. Did you try to deploy the service and called it using a test client?
Thanks for your help. Does anybody have a suggestion why two similar classes are being generated? Regards, Harm! On Fri, Aug 15, 2008 at 5:06 PM, Detelin Yordanov <[EMAIL PROTECTED] > wrote: > Hi, > Are you using Axis2 1.4 ? > I tried your wsdl on Axis2 1.4 using following command: > wsdl2java -t -o server/title_edition/ -uri wsdl/Webs_TitelEdition.wsdl -p > nl.kabisa.sanoma.webservices.server -d adb > > And the generated code contains two repeating classes: > 1. There is Edition_type0 and Edition_type1 > 2. There is Editions and Editions_type0 > > The Editions_type0 class by me contains an addEdition(Edition_type*1*), > rather than addEdition(Edition_type*0*) > And I just used Edition_type1 instance and got the following request which > seems OK: > > <soapenv:Body> > <ns3:TitelEdition_new xmlns:ns3=" > http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition"> > <Editions xmlns=" > http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition/TitelEdition_new" > createDate="2008-08-15+02:00" records="1"> > <Edition> > <titleId>2</titleId> > <titleName>Test title</titleName> > <editionId>1</editionId> > <editionDescription>Test</editionDescription> > <publicationDate>2008-08-15+02:00</publicationDate> > <latestMatDelivDate>2008-08-15+02:00</latestMatDelivDate> > </Edition> > </Editions> > </ns3:TitelEdition_new> > </soapenv:Body> > > But I wonder why there 2 similiar classes generated and not just one of > them, can somebody explain this? > > > On Fri, Aug 15, 2008 at 5:04 PM, Harm de Laat <[EMAIL PROTECTED]> wrote: > >> Hi all, >> >> I'm trying to generate a SOAP service server from an existing WSDL file. >> >> I have generated all necessary class using the following command: >> >> wsdl2java.sh -t -o server/title_edition/ -uri wsdl/Webs_TitelEdition.wsdl >> -p nl.kabisa.sanoma.webservices.server -d adb -s -wv 1.2 -ss -sd -ssi >> >> I have also created a simple client. Unfortunately when I run the client I >> get the following exception: >> >> Exception in thread "main" org.apache.axis2.AxisFault: >> org.apache.axis2.databinding.ADBException: Unexpected subelement Edition >> at >> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512) >> at >> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370) >> at >> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416) >> at >> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228) >> at >> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) >> at >> nl.kabisa.sanoma.webservices.Webs_TitelEditionStub.TitelEdition_new(Webs_TitelEditionStub.java:186) >> at >> nl.kabisa.sanoma.webservices.TitleEditionTestClient.main(TitleEditionTestClient.java:48) >> Java Result: 1 >> >> I don't know why, because it seems my message is correct according to the >> XML schema provided. >> I have been trying to resolve this now for the past two days, but >> unfortunately I'm still stuck. >> >> Can somebody please tell me what it is I'm doing wrong here? >> >> >> Here is my code including the WSDL: >> >> ---- client: ----- >> package nl.kabisa.sanoma.webservices; >> >> import java.math.BigInteger; >> import java.util.Date; >> >> /** >> * >> * @author harm >> */ >> public class TitleEditionTestClient { >> >> >> public static void main(String[] args) throws Exception { >> >> Webs_TitelEditionStub stub = >> new Webs_TitelEditionStub(" >> http://localhost:9090/axis2/services/Webs_TitelEdition"); >> >> Webs_TitelEditionStub.TitelEdition_new titleEdition = >> new Webs_TitelEditionStub.TitelEdition_new(); >> >> >> Webs_TitelEditionStub.Editions_type0 editions = >> new Webs_TitelEditionStub.Editions_type0(); >> >> Webs_TitelEditionStub.Edition_type0 edition = >> new Webs_TitelEditionStub.Edition_type0(); >> >> >> edition.setTitleId("2"); >> edition.setTitleName("Test title"); >> edition.setEditionId("1"); >> edition.setEditionDescription("Test"); >> edition.setPublicationDate(new Date()); >> edition.setLatestMatDelivDate(new Date()); >> >> editions.addEdition(edition); >> >> editions.setCreateDate(new Date()); >> editions.setRecords(BigInteger.ONE); >> >> titleEdition.setEditions(editions); >> >> stub.TitelEdition_new(titleEdition); >> >> } >> } >> ------------------- >> >> Using TCPMon I see the following message being sent to the server: >> >> ------ soap message ----- >> POST /axis2/services/Webs_TitelEdition HTTP/1.1 >> Content-Type: application/soap+xml; charset=UTF-8; action=" >> http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition/TitelEdition_new >> " >> User-Agent: Axis2 >> Host: localhost:9090 >> Transfer-Encoding: chunked >> >> 209 >> <?xml version='1.0' encoding='UTF-8'?> >> <soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope >> "> >> <soapenv:Body> >> <ns3:TitelEdition_new xmlns:ns3=" >> http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition"> >> <Editions xmlns=" >> http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition/TitelEdition_new" >> createDate="2008-08-15+01:00" records="1"> >> >> <Edition>[EMAIL PROTECTED] >> </Edition> >> </Editions> >> </ns3:TitelEdition_new> >> </soapenv:Body> >> </soapenv:Envelope> >> 0 >> ----------- >> >> ------ WSDL------------- >> <?xml version="1.0" encoding="utf-8"?> >> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" >> xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc=" >> http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime=" >> http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns=" >> http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition" >> xmlns:s1=" >> http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition/TitelEdition_new" >> xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:s2=" >> http://schemas.sanoma-uitgevers.nl/AdvPortal/Defaults/SchemaReturnMessage" >> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http=" >> http://schemas.xmlsoap.org/wsdl/http/" targetNamespace=" >> http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition" >> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> >> <wsdl:types> >> <s:schema elementFormDefault="qualified" targetNamespace=" >> http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition"> >> <s:import namespace=" >> http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition/TitelEdition_new" >> /> >> <s:import namespace=" >> http://schemas.sanoma-uitgevers.nl/AdvPortal/Defaults/SchemaReturnMessage" >> /> >> <s:element name="TitelEdition_new"> >> <s:complexType> >> <s:sequence> >> <s:element minOccurs="0" maxOccurs="1" ref="s1:Editions" /> >> </s:sequence> >> </s:complexType> >> </s:element> >> <s:element name="TitelEdition_newResponse"> >> <s:complexType> >> <s:sequence> >> <s:element minOccurs="0" maxOccurs="1" >> ref="s2:TitelEdition_newResult" /> >> </s:sequence> >> </s:complexType> >> </s:element> >> </s:schema> >> <s:schema elementFormDefault="qualified" targetNamespace=" >> http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition/TitelEdition_new >> "> >> <s:element name="Editions"> >> <s:complexType> >> <s:sequence> >> <s:element minOccurs="0" maxOccurs="unbounded" >> form="unqualified" name="Edition"> >> <s:complexType> >> <s:sequence> >> <s:element minOccurs="0" maxOccurs="1" >> form="unqualified" name="titleId" type="s:string" /> >> <s:element minOccurs="0" maxOccurs="1" >> form="unqualified" name="titleName" type="s:string" /> >> <s:element minOccurs="0" maxOccurs="1" >> form="unqualified" name="editionId" type="s:string" /> >> <s:element minOccurs="0" maxOccurs="1" >> form="unqualified" name="editionDescription" type="s:string" /> >> <s:element minOccurs="1" maxOccurs="1" >> form="unqualified" name="publicationDate" type="s:date" /> >> <s:element minOccurs="1" maxOccurs="1" >> form="unqualified" name="latestMatDelivDate" type="s:date" /> >> </s:sequence> >> </s:complexType> >> </s:element> >> </s:sequence> >> <s:attribute name="createDate" type="s:date" /> >> <s:attribute name="records" type="s:integer" /> >> </s:complexType> >> </s:element> >> </s:schema> >> <s:schema elementFormDefault="qualified" targetNamespace=" >> http://schemas.sanoma-uitgevers.nl/AdvPortal/Defaults/SchemaReturnMessage >> "> >> <s:element name="TitelEdition_newResult"> >> <s:complexType> >> <s:sequence> >> <s:element minOccurs="1" maxOccurs="1" form="unqualified" >> name="MessageCode" type="s:int" /> >> <s:element minOccurs="0" maxOccurs="1" form="unqualified" >> name="MessageText" type="s:string" /> >> </s:sequence> >> </s:complexType> >> </s:element> >> </s:schema> >> </wsdl:types> >> <wsdl:message name="TitelEdition_newSoapIn"> >> <wsdl:part name="parameters" element="tns:TitelEdition_new" /> >> </wsdl:message> >> <wsdl:message name="TitelEdition_newSoapOut"> >> <wsdl:part name="parameters" element="tns:TitelEdition_newResponse" /> >> </wsdl:message> >> <wsdl:portType name="Webs_TitelEditionSoap"> >> <wsdl:operation name="TitelEdition_new"> >> <wsdl:input message="tns:TitelEdition_newSoapIn" /> >> <wsdl:output message="tns:TitelEdition_newSoapOut" /> >> </wsdl:operation> >> </wsdl:portType> >> <wsdl:binding name="Webs_TitelEditionSoap" >> type="tns:Webs_TitelEditionSoap"> >> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" /> >> <wsdl:operation name="TitelEdition_new"> >> <soap:operation soapAction=" >> http://schemas.sanoma-uitgevers.nl/advportal/Webs_TitelEdition/TitelEdition_new" >> style="document" /> >> <wsdl:input> >> <soap:body use="literal" /> >> </wsdl:input> >> <wsdl:output> >> <soap:body use="literal" /> >> </wsdl:output> >> </wsdl:operation> >> </wsdl:binding> >> <wsdl:binding name="Webs_TitelEditionSoap12" >> type="tns:Webs_TitelEditionSoap"> >> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> >> <wsdl:operation name="TitelEdition_new"> >> <soap12:operation soapAction=" >> http://xxx/advportal/Webs_TitelEdition/TitelEdition_new" style="document" >> /> >> <wsdl:input> >> <soap12:body use="literal" /> >> </wsdl:input> >> <wsdl:output> >> <soap12:body use="literal" /> >> </wsdl:output> >> </wsdl:operation> >> </wsdl:binding> >> <wsdl:service name="Webs_TitelEdition"> >> <wsdl:port name="Webs_TitelEditionSoap" >> binding="tns:Webs_TitelEditionSoap"> >> <soap:address location="http://xxx/store/Webs_TitelEdition.asmx" /> >> </wsdl:port> >> <wsdl:port name="Webs_TitelEditionSoap12" >> binding="tns:Webs_TitelEditionSoap12"> >> <soap12:address location="http://xxx/store/Webs_TitelEdition.asmx" >> /> >> </wsdl:port> >> </wsdl:service> >> </wsdl:definitions> >> >> -------------------------------------- >> >> -- >> Harm de Laat >> >> Kabisa ICT >> 't Inne 9c >> 6021 DA Budel >> KVK: 14090089 >> >> e : [EMAIL PROTECTED] >> w : http://www.kabisa.nl >> m : +31 (0)6 144 288 21 >> t : +31 (0)495 43 07 98 >> f : +31 (0)495 43 05 93 >> > > -- Harm de Laat Kabisa ICT 't Inne 9c 6021 DA Budel KVK: 14090089 e : [EMAIL PROTECTED] w : http://www.kabisa.nl m : +31 (0)6 144 288 21 t : +31 (0)495 43 07 98 f : +31 (0)495 43 05 93