RE: Wsdl2Java
Here is the target namespace http://tempuri.org/"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:tns="http://tempuri.org/"; xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"; xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"; xmlns:i0="urn:emp:service" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"; xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"; xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns:wsa10="http://www.w3.org/2005/08/addressing"; xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex";> Cheers, Dave From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Re: Wsdl2JavaDate: Mon, 7 May 2007 17:36:58 -0400 what is the target namespace declaration for your wsdl e.g. here is what I have for StockQuoteService.wsdl http://w3.ibm.com/schemas/services/2002/11/15/stockquote/wsdl"; xmlns="http://schemas.xmlsoap.org/wsdl/"; xmlns:tns="http://w3.ibm.com/schemas/services/2002/11/15/stockquote/wsdl"; creates /src/com/ibm/w3/schemas/services/_2002/_11/_15/stockquote/wsdl/StockQuoteServiceCallbackHandler.java creates /src/com/ibm/w3/schemas/services/_2002/_11/_15/stockquote/wsdl/StockQuoteServiceStub.java??? Martin-- This email message and any files transmitted with it contain confidentialinformation intended only for the person(s) to whom this email message isaddressed. If you have received this email message in error, please notifythe sender immediately by telephone or email and destroy the originalmessage without making a copy. Thank you. - Original Message - From: David Elliott To: axis Sent: Monday, May 07, 2007 9:19 AM Subject: Wsdl2Java I am trying to have all the namespaces in the Webservice to get its own package name. Namespace Package===urn:emp:data emp.dataurn:emp:serviceemp.service When I run Wsdl2Java everything gets put in org.tempuri In looking at the documentation at: http://ws.apache.org/axis/java/reference.html I notice that the parameters are not the same as in the binary distribution. I am on a Windows XP machine. Included below is a line from the WSDL the output from Wsdl2Java the bat file running and its parameters used the resulting directory structure and filesAny help is appreciated.Dave === Here is a line from the WSDL that has the namespace I want to have as a seperate packagehttp://localhost:9000/PersonService/Service?wsdl=wsdl0"; /> === D) %AXIS2_HOME%/bin/WSDL2JavaUsing AXIS2_HOME: C:\Apps\java\Libraries\Axis2\axis2-1.2Using JAVA_HOME: C:\Program Files\Java\jre1.5.0_11Usage: WSDL2Java -uri : A url or path to a WSDL -o Specify a directory path for the generated code. -a Generate async style code only (Default: off). -s Generate sync style code only (Default: off). Takes precedence over -a. -p Specify a custom package name for the generated code. -l Valid languages are java and csharp (Default: java). -t Generate a test case for the generated code. -ss Generate server side code (i.e. skeletons) (Default: off). -sd Generate service descriptor (i.e. services.xml). (Default: off). Valid with -ss. -d Valid databinding(s) are adb, xmlbeans, jibx, jaxme and jaxbri (Default: adb). -g Generates all the classes. Valid only with -ss. -pn Choose a specific port when there are multiple ports in the wsdl. -snChoose a specific service when there are multiple services in the wsdl. -u Unpacks the databinding classes -r Specify a repository against which code is generated. -ns2p ns1=pkg1,ns2=pkg2 Specify a custom package name for each namespace specified in the wsdls schema. -ssi Generate an interface for the service implementation (Default: off). -wv WSDL Version. Valid Options : 2, 2.0, 1.1 -S Specify a directory path for generated source -R Specify a directory path for generated resou
Wsdl2Java
I am trying to have all the namespaces in the Webservice to get its own package name. Namespace Package === urn:emp:data emp.data urn:emp:serviceemp.service When I run Wsdl2Java everything gets put in org.tempuri In looking at the documentation at: http://ws.apache.org/axis/java/reference.html I notice that the parameters are not the same as in the binary distribution. I am on a Windows XP machine. Included below is a line from the WSDL the output from Wsdl2Java the bat file running and its parameters used the resulting directory structure and files Any help is appreciated. Dave === Here is a line from the WSDL that has the namespace I want to have as a seperate package http://localhost:9000/PersonService/Service?wsdl=wsdl0"; /> === D) %AXIS2_HOME%/bin/WSDL2JavaUsing AXIS2_HOME: C:\Apps\java\Libraries\Axis2\axis2-1.2Using JAVA_HOME:C:\Program Files\Java\jre1.5.0_11Usage: WSDL2Java -uri : A url or path to a WSDL -o Specify a directory path for the generated code. -a Generate async style code only (Default: off). -s Generate sync style code only (Default: off). Takes precedence over -a. -p Specify a custom package name for the generated code. -l Valid languages are java and csharp (Default: java). -t Generate a test case for the generated code. -ss Generate server side code (i.e. skeletons) (Default: off). -sd Generate service descriptor (i.e. services.xml). (Default: off). Valid with -ss. -d Valid databinding(s) are adb, xmlbeans, jibx, jaxme and jaxbri (Default: adb). -g Generates all the classes. Valid only with -ss. -pn Choose a specific port when there are multiple ports in the wsdl. -snChoose a specific service when there are multiple services in the wsdl. -u Unpacks the databinding classes -r Specify a repository against which code is generated. -ns2p ns1=pkg1,ns2=pkg2 Specify a custom package name for each namespace specified in the wsdls schema. -ssi Generate an interface for the service implementation (Default: off). -wv WSDL Version. Valid Options : 2, 2.0, 1.1 -S Specify a directory path for generated source -R Specify a directory path for generated resources -em Specify an external mapping file -f Flattens the generated files -uw Switch on un-wrapping. -xsdconfig Use XMLBeans .xsdconfig file. Valid only with -d xmlbeans. === D) go.bat D) rd build /q/sD) set outdir=buildD) set src=srcD) set language=javaD) set databinding=adbD) set uri=http://localhost:9000/PersonService/Service?wsdl D) C:\Apps\java\Libraries\Axis2\axis2-1.2/bin/WSDL2Java -uri "http://localhost:9000/PersonService/Service?wsdl"; -o "build" -l "java" -d "adb" -S "src" -ns2p urn:emp:service=emp.service,urn:emp:data=emp.dataUsing AXIS2_HOME: C:\Apps\java\Libraries\Axis2\axis2-1.2Using JAVA_HOME: C:\Program Files\Java\jre1.5.0_11Retrieving document at 'http://localhost:9000/PersonService/Service?wsdl=wsdl0', relative to 'http://localhost:9000/PersonService/Service?wsdl'.Retrieving schema at 'http://localhost:9000/PersonService/Service?xsd=xsd1', relative to 'http://localhost:9000/PersonService/Service?wsdl=wsdl0'.Retrieving schema at 'http://localhost:9000/PersonService/Service?xsd=xsd2', relative to 'http://localhost:9000/PersonService/Service?wsdl=wsdl0'.Retrieving schema at 'http://localhost:9000/PersonService/Service?xsd=xsd0', relative to 'http://localhost:9000/PersonService/Service?wsdl=wsdl0'.Retrieving schema at 'http://localhost:9000/PersonService/Service?xsd=xsd2', relative to 'http://localhost:9000/PersonService/Service?xsd=xsd0'.Retrieving document at 'http://localhost:9000/PersonService/Service?wsdl=wsdl0', relative to 'http://localhost:9000/PersonService/Service?wsdl'.Retrieving schema at 'http://localhost:9000/PersonService/Service?xsd=xsd1', relative to 'http://localhost:9000/PersonService/Service?wsdl=wsdl0'.Retrieving schema at 'http://localhost:9000/PersonService/Service?xsd=xsd2', relative to 'http://localhost:9000/PersonService/Service?wsdl=wsdl0'.Retrieving schema at 'http://localhost:9000/PersonService/Service?xsd=xsd0', relative to 'http://localhost:9000/PersonService/Service?wsdl=wsdl0'.Retrieving schema at 'http://localhost:9000/PersonService/Service?xsd=xsd2', relative to 'h
Sending Derived types to Webservice doesn't work
This note is a continuation of "Issue with Axis when sending abstract class to .NET webservice" I have change my .NET Web Service and no longer has any abstracts. It looks like public class Person{ public string name; public Address address;} public class Address{ } public class HomeAddress : Address{ public string houseNumber;} I let Axis generate the Java proxy class and I call the .NET service in the Java client as such: IEmployeeServiceProxy service = new IEmployeeServiceProxy(); HomeAddress homeAddress = new HomeAddress();homeAddress.setHouseNumber("456 Long and Winding Road"); person = new Person();person.setName( "Bob the Builder" );person.setAddress(homeAddress); newPerson = service.getPerson( person ); For all 3 tests below, NO CHANGES were made to the .NET Webservice. Test 1: Run as isIf I examine the SOAP Request Message I see with no data. - SoapRequest at 3/6/2007 2:35:41 PM -http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> Bob the Builder Test 2: If I open the Java Proxy Class Person.java and changepublic data.emp.Address getAddress() {return address;}topublic data.emp.HomeAddress getAddress() {return (HomeAddress)address;} then this goes into the service 456 Long and Winding Road and this comes out 456 Long and Winding Roadhowever the getAddress() method now returns null when trying to print in the Java client Test 3:Put getAddress() back to original code and Change all instances fromdata.emp.Addresstodata.emp.HomeAddress The correct data structure is passed in 456 Long and Winding Road recieved 456 Long and Winding Road and printed out successfully. Printing Returned Data... Name: Bob the Builder Addr: 456 Long and Winding Road Any thoughts are welcomed. Dave _ Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
RE: Issue with Axis when sending abstract class to .NET webservice
I am sending a concrete type: HomeAddress that is derived from Address. The place holder in the class is the abstract type. This is the Java Client code being performed. HomeAddress homeAddress = new HomeAddress();homeAddress.setHouseNumber("123 Main Street"); Person person = new Person();person.setAge(12);person.setName("Hello World");person.setAddress(homeAddress); IEmployeeServiceProxy service = new IEmployeeServiceProxy();admin = service.getAdmin(person); Dave > Date: Fri, 2 Mar 2007 09:11:03 -0500> From: [EMAIL PROTECTED]> To: > axis-user@ws.apache.org> Subject: Re: Issue with Axis when sending abstract > class to .NET webservice> > David,> > You cannot send an element of an > abstract type. Your choices:> - don't send the element (requires > minOccurs="0")> - define it as a concrete type> > Anne> > On 3/1/07, David > Elliott <[EMAIL PROTECTED]> wrote:> >> > I am testing some interoperability > between a Java Client using Axis and> > a .NET ASMX Webservice and am > experiencing a problem and was wondering> > if anyone has an idea of what is > going on.> >> > If I have a class that contains a data member that is > abstract and try to> > pass a> > derived class type into the webservice, an > XML error is generated. If I> > receive the> > same exact structure from the > webservice all works as expected.> >> > I have a full .NET webservice and > java client that will demonstrate the> > issue if> > anyone wants the code.> > >> > I am including the soap messages that are received on the service.> > > The class definition follows the SOAP Messages.> >> > Thanks,> > Dave> >> > > WebbertSolutions[at]hotmail[dot]com> >> >> > Good Message> > - don't send > address in> > - receive address> > ==> >> > - > SoapRequest at 2/27/2007 2:01:41 PM -> > > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>> > > > > > > > > > Hello World> > 12> > > > > > > > > > >> > - > SoapResponse at 2/27/2007 2:01:41 PM -> > > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";>> > > > > > > xsi:type="Admin" xmlns="urn:emp:data">> > Hello World> > > 12> > > > 234 State > Street> > > > true> > > > > > > > > > > >> >> >> >> > Bad Message> > - populate HomeAddress> > - send HomeAddress in> > > ==> >> >> > - SoapRequest at 2/27/2007 > 2:01:13 PM -> > > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>> > > > > > > > > > Hello World> > 12> > />> > > > > > > > > > >> > - SoapResponse at 2/27/2007 2:01:13 PM -> > > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";>> > > > > > > soap:Client> >> > > System.Web.Services.Protocols.SoapException:> > Server was > unable to read request. --->> > System.InvalidOperationException: There is an > error in XML> > document (1, 353). ---> System.InvalidOperationException:> > > The specified type is abstract: name='Address', namespace='urn:emp:data', at> > > .> > at> > > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read5_Address(Boolean> > > isNullable, Boolean checkType)> > at> > > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read6_Person(Boolean> > > isNullable, Boolean checkType)> > at> > > Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read7_GetAdmin()> > > at> > > Microsoft.Xml.Serialization.GeneratedAssembly.A
RE: Issue with Axis when sending abstract class to .NET webservice
I am not sending an empty element. I am sending a HomeAddress as in my example and the Axis framework doesn't seem to want to serialize it into the soap message. This is why the received soap message is empty and this is ultimately my problem.Dave > Date: Fri, 2 Mar 2007 16:04:11 -0500> From: [EMAIL PROTECTED]> To: > axis-user@ws.apache.org> Subject: Re: Issue with Axis when sending abstract > class to .NET webservice> > In the message that generates the fault, you send > an empty element.> That's not allowed:> > - SoapRequest at > 2/27/2007 2:01:13 PM -> > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> > xmlns:xsd="http://www.w3.org/2001/XMLSchema";> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>> > > > > > Hello World> 12> > > > > > > > On > 3/2/07, David Elliott <[EMAIL PROTECTED]> wrote:> >> > I am sending a > concrete type: HomeAddress that is derived from Address.> > The place holder > in the class is the abstract type.> >> > This is the Java Client code being > performed.> >> > HomeAddress homeAddress = new HomeAddress();> > > homeAddress.setHouseNumber("123 Main Street");> >> > Person person = new > Person();> > person.setAge(12);> > person.setName("Hello World");> > > person.setAddress(homeAddress);> >> > IEmployeeServiceProxy service = new > IEmployeeServiceProxy();> > admin = service.getAdmin(person);> >> >> > Dave> > >> > > >> > > Date: Fri, 2 Mar 2007 09:11:03 > -0500> > > From: [EMAIL PROTECTED]> > > To: axis-user@ws.apache.org> > > > Subject: Re: Issue with Axis when sending abstract class to .NET> > > webservice> >> > >> > > David,> > >> > > You cannot send an element of an > abstract type. Your choices:> > > - don't send the element > (requires minOccurs="0")> > > - define it as a concrete type> > >> > > Anne> > > >> > > On 3/1/07, David Elliott <[EMAIL PROTECTED]> wrote:> > > >> > > > I > am testing some interoperability between a Java Client using Axis and> > > > > a .NET ASMX Webservice and am experiencing a problem and was wondering> > > > > if anyone has an idea of what is going on.> > > >> > > > If I have a class > that contains a data member that is abstract and try> > to> > > > pass a> > > > > derived class type into the webservice, an XML error is generated. If I> > > > > receive the> > > > same exact structure from the webservice all works as > expected.> > > >> > > > I have a full .NET webservice and java client that > will demonstrate the> > > > issue if> > > > anyone wants the code.> > > >> > > > > I am including the soap messages that are received on the service.> > > > > The class definition follows the SOAP Messages.> > > >> > > > Thanks,> > > > > Dave> > > >> > > > WebbertSolutions[at]hotmail[dot]com> > > >> > > >> > > > > Good Message> > > > - don't send address in> > > > - receive address> > > > > ==> > > >> > > > - SoapRequest at 2/27/2007 > 2:01:41 PM -> > > > > > >> > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> > > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";> > > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>> > > > > > > > > > > > > xmlns:ns1="urn:emp:data">> > > > Hello World> > > > > 12> > > > > > > > > > > > > > > > > > > > >> > > > - SoapResponse > at 2/27/2007 2:01:41 PM -> > > > > > > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";> > > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> > > > > xmlns:xsd="http://www.w3.org/2001/XMLSchema";>> > > > > > > > > > > > > xsi:type="Admin" xmlns="urn:emp:data">> > > > Hello World&
Issue with Axis when sending abstract class to .NET webservice
I am testing some interoperability between a Java Client using Axis and a .NET ASMX Webservice and am experiencing a problem and was wondering if anyone has an idea of what is going on. If I have a class that contains a data member that is abstract and try to pass a derived class type into the webservice, an XML error is generated. If I receive the same exact structure from the webservice all works as expected. I have a full .NET webservice and java client that will demonstrate the issue if anyone wants the code. I am including the soap messages that are received on the service. The class definition follows the SOAP Messages. Thanks,Dave WebbertSolutions[at]hotmail[dot]com Good Message - don't send address in- receive address== - SoapRequest at 2/27/2007 2:01:41 PM -http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> Hello World12 - SoapResponse at 2/27/2007 2:01:41 PM -http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";>Hello World12 234 State Streettrue Bad Message - populate HomeAddress- send HomeAddress in== - SoapRequest at 2/27/2007 2:01:13 PM -http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> Hello World12 - SoapResponse at 2/27/2007 2:01:13 PM -http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";> soap:Client System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (1, 353). ---> System.InvalidOperationException: The specified type is abstract: name='Address', namespace='urn:emp:data', at . at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read5_Address(Boolean isNullable, Boolean checkType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read6_Person(Boolean isNullable, Boolean checkType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read7_GetAdmin() at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer.Deserialize(XmlSerializationReader reader) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle) at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() --- End of inner exception stack trace --- at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest() public abstract class PersonBase{protected PersonBase() { } private string _name; public string Name{get { return ( _name ); }set { _name = value; }}} public class Person : PersonBase{private int _age;private Address _address; public int Age{get { return ( _age ); }set { _age = value; }} public Address Address{ get { return ( _address ); }set { _address = value; }}} public abstract class Address{protected Address() { }} public class HomeAddress : Address{public HomeAddress() { } private string _houseNumber; public string HouseNumber{get { return ( _houseNumber ); }set { _houseNumber = value; }}} _ Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE