I�m with a similar problem and I�m get crazy. Could you tell me how you configured your web container?
-----Mensagem original----- De: Mark Leone [mailto:[EMAIL PROTECTED] Enviada em: segunda-feira, 5 de abril de 2004 01:17 Para: [EMAIL PROTECTED] Assunto: RE: Mapping a bean within a bean Problem solved. Found a misconfiguration in my web container, causing an older version of the class files to be running. The bean mapping works as expected with a wrapped bean. >From: "Mark Leone" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: Mapping a bean within a bean >Date: Sun, 04 Apr 2004 00:57:10 -0500 > >I'm new to Axis and playing around with bean mapping to make sure I >understand it. I'm trying to imnplement an RPC that returns a bean >(TestBean2) that has as its members several primitive types as well as a >user-defined type (InnerBean) that is a bean, i.e., it has setters and >getters named according to the class variables. I created two separate bean >mappings, one for TestBean2, and one for InnerBean. > >The service deploys successfully, except that when I look at the WSDL that >is created, I see separate types corresponding to TestBean2 and InnerBean. >However, there is no element in type TestBean2 of type InnerBean, as I >expected there to be. There are elements that correspond to the primitive >type members of TestBean2, but no element that corresponds to the member of >type InnerBean. Thus InnerBean will not be returned with this service, even >though a type mapping was creatd for it. > >I tried making InnerBean a separate class file as well as an inner class >inside TestBean2, with the same results. Here is the java code for the >servce and the beans, the WSDD, and the WSDL that is generated by Axis. Can >someone pelase tell me how I could cause Axis to generate a WSDL that would >return InnerBean as a member of TestBean2? > > >***** bean code ***** > >package TaxServiceW2B; >public class TestBean2{ > > public double total = 0; > public double subtotal = 0; > public double rate = 0; > public String text = ""; > public InnerBean anotherBean = new InnerBean(); > > public TestBean2(int number, String color){ > anotherBean.setNumber(number); > anotherBean.setColor(color); > } > > public void setTotal(double total){ > this.total = total; > } > > public void setSubtotal(double subtotal){ > this.subtotal = subtotal; > } > > public void setRate(double rate){ > this.rate = rate; > } > > public void setText(String text){ > this.text = text; > } > > public void setAnotherBean(InnerBean anotherBean){ > this.anotherBean = anotherBean; > } > > public double getTotal(){ > return total; > } > > public double getSubTotal(){ > return subtotal; > } > > public double getRate(){ > return rate; > } > > public String getText(){ > return text; > } > > public InnerBean getAnotherBean(){ > return anotherBean; > } > > public class InnerBean{ > > int number = 0; > String color = "none"; > > public void setNumber(int number){ > this.number = number; > } > > public void setColor(String color){ > this.color = color; > } > > public int getNumber(){ > return number; > } > > public String getColor(){ > return color; > } > > } > >} > >***** Service Implementation ***** > >package TaxServiceW2B; >public class TaxServiceW2B >{ > public TestBean2 calcTaxRate(double subtotal, double total) > { > double rate = (total - subtotal) / subtotal; > TestBean2 bean = new TestBean2(1,"red"); > bean.setTotal(total); > bean.setSubTotal(subtotal); > bean.setRate(rate); > bean.setText("I am a superbean"); > return bean; > } > > public double calcSubTotal(double total, double taxpercent) > { > double subtotal = total / (1 + taxpercent); > return subtotal; > } > > public double calcTotal(double subtotal, double taxpercent) > { > double total = subtotal * (1 + taxpercent); > return total; > } >} > > >***** WSDD ***** > ><deployment xmlns="http://xml.apache.org/axis/wsdd/" > >xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> > ><service name="TaxServiceW2B" provider="java:RPC"> > > <parameter name="className" value="TaxServiceW2B.TaxServiceW2B"/> > > <parameter name="allowedMethods" value="*"/> > <beanMapping xmlns:ns1="http://my.namespace" qname="ns1:TestBean2" > languageSpecificType="java:TaxServiceW2B.TestBean2"/> > <beanMapping xmlns:ns1="http://my.namespace" qname="ns1:InnerBean" > languageSpecificType="java:TaxServiceW2B.TestBean2$InnerBean"/> > ></service> > ></deployment> > > >***** AXIS Generated WSDL ***** > >- <wsdl:types> >- <schema targetNamespace="http://my.namespace" >xmlns="http://www.w3.org/2001/XMLSchema"> > <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> >- <complexType name="TestBean2"> >- <sequence> > <element name="rate" type="xsd:double" /> > <element name="subTotal" type="xsd:double" /> > <element name="text" nillable="true" type="xsd:string" /> > <element name="total" type="xsd:double" /> > </sequence> > </complexType> >- <complexType name="InnerBean"> >- <sequence> > <element name="color" nillable="true" type="xsd:string" /> > <element name="number" type="xsd:int" /> > </sequence> > </complexType> > </schema> > </wsdl:types> >- <wsdl:message name="calcTaxRateResponse"> > <wsdl:part name="calcTaxRateReturn" type="tns1:TestBean2" /> > </wsdl:message> >- <wsdl:message name="calcTotalResponse"> > <wsdl:part name="calcTotalReturn" type="xsd:double" /> > </wsdl:message> >- <wsdl:message name="calcSubTotalRequest"> > <wsdl:part name="in0" type="xsd:double" /> > <wsdl:part name="in1" type="xsd:double" /> > </wsdl:message> >- <wsdl:message name="calcSubTotalResponse"> > <wsdl:part name="calcSubTotalReturn" type="xsd:double" /> > </wsdl:message> >- <wsdl:message name="calcTotalRequest"> > <wsdl:part name="in0" type="xsd:double" /> > <wsdl:part name="in1" type="xsd:double" /> > </wsdl:message> >- <wsdl:message name="calcTaxRateRequest"> > <wsdl:part name="in0" type="xsd:double" /> > <wsdl:part name="in1" type="xsd:double" /> > </wsdl:message> >- <wsdl:portType name="TaxServiceW2B"> >- <wsdl:operation name="calcTaxRate" parameterOrder="in0 in1"> > <wsdl:input message="impl:calcTaxRateRequest" name="calcTaxRateRequest" >/> > <wsdl:output message="impl:calcTaxRateResponse" >name="calcTaxRateResponse" /> > </wsdl:operation> >- <wsdl:operation name="calcSubTotal" parameterOrder="in0 in1"> > <wsdl:input message="impl:calcSubTotalRequest" name="calcSubTotalRequest" >/> > <wsdl:output message="impl:calcSubTotalResponse" >name="calcSubTotalResponse" /> > </wsdl:operation> >- <wsdl:operation name="calcTotal" parameterOrder="in0 in1"> > <wsdl:input message="impl:calcTotalRequest" name="calcTotalRequest" /> > <wsdl:output message="impl:calcTotalResponse" name="calcTotalResponse" /> > </wsdl:operation> > </wsdl:portType> >- <wsdl:binding name="TaxServiceW2BSoapBinding" type="impl:TaxServiceW2B"> > <wsdlsoap:binding style="rpc" >transport="http://schemas.xmlsoap.org/soap/http" /> >- <wsdl:operation name="calcTaxRate"> > <wsdlsoap:operation soapAction="" /> >- <wsdl:input name="calcTaxRateRequest"> > <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >namespace="http://TaxServiceW2B" use="encoded" /> > </wsdl:input> >- <wsdl:output name="calcTaxRateResponse"> > <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >namespace="http://localhost:8080/axis/services/TaxServiceW2B" use="encoded" >/> > </wsdl:output> > </wsdl:operation> >- <wsdl:operation name="calcSubTotal"> > <wsdlsoap:operation soapAction="" /> >- <wsdl:input name="calcSubTotalRequest"> > <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >namespace="http://TaxServiceW2B" use="encoded" /> > </wsdl:input> >- <wsdl:output name="calcSubTotalResponse"> > <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >namespace="http://localhost:8080/axis/services/TaxServiceW2B" use="encoded" >/> > </wsdl:output> > </wsdl:operation> >- <wsdl:operation name="calcTotal"> > <wsdlsoap:operation soapAction="" /> >- <wsdl:input name="calcTotalRequest"> > <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >namespace="http://TaxServiceW2B" use="encoded" /> > </wsdl:input> >- <wsdl:output name="calcTotalResponse"> > <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >namespace="http://localhost:8080/axis/services/TaxServiceW2B" use="encoded" >/> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> >- <wsdl:service name="TaxServiceW2BService"> >- <wsdl:port binding="impl:TaxServiceW2BSoapBinding" name="TaxServiceW2B"> > <wsdlsoap:address >location="http://localhost:8080/axis/services/TaxServiceW2B" /> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> > >_________________________________________________________________ >Watch LIVE baseball games on your computer with MLB.TV, included with MSN >Premium! >http://join.msn.com/?page=features/mlb&pgmarket=en-us/go/onm00200439ave/dir ect/01/ > _________________________________________________________________ Watch LIVE baseball games on your computer with MLB.TV, included with MSN Premium! http://join.msn.com/?page=features/mlb&pgmarket=en-us/go/onm00200439ave/dire ct/01/
