You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Eran Chinthaka <ch...@opensource.lk> on 2006/01/03 18:20:58 UTC

[Axis2] Databinding

Forwarding with correct prefix.

-------- Original Message --------
Subject: 	Databinding
Date: 	Tue, 03 Jan 2006 12:01:27 -0500
From: 	Steve Molloy <sm...@convera.com>
Reply-To: 	axis-user@ws.apache.org
To: 	axis-user@ws.apache.org



Hi,

	I'm new to Axis 2 (0.93) and am trying to convert my Axis 1 services to
it. I'm having a problem with the databindings generated and was
wondering if anyone ran into this and, much more importantly, if anyone
had a solution... My messages use the following types:

<complexType name="Item">
	<sequence>
		<element name="id" nillable="true" type="xsd:anyType"/>
		<element name="latest" nillable="true" type="tns1:Version"/>
		<element name="modificationStamp" type="xsd:long"/>
		<element name="versions" nillable="true" type="apachesoap:Vector"/>
	</sequence>
</complexType>
<complexType name="BatchTest">
	<complexContent>
		<extension base="tns1:Item">
			<sequence>
				<element name="info" nillable="true" type="tns1:BatchTestInfo"/>
			</sequence>
		</extension>
	</complexContent>
</complexType>

While the generated (WSDL2Java using xmlbeans) java code seems fine,
when I actually try to use it, the server throws a 
XmlValueOutOfRangeException because it gets into XmlObjectBase code
instead of XmlLong when trying to set the modificationTimeStamp field 
with a long (yes, System.currentTimeMillis()). StackTrace:

...
Caused by: org.apache.xmlbeans.impl.values.XmlValueNotSupportedException
      at org.apache.xmlbeans.impl.values.XmlObjectBase.set_BigDecimal(XmlObjectBase.java:1989)
      at org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1608)
      at org.apache.xmlbeans.impl.values.XmlObjectBase.set_BigInteger(XmlObjectBase.java:1987)
      at org.apache.xmlbeans.impl.values.XmlObjectBase.set_long(XmlObjectBase.java:1969)
      at org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1596)
      at org.apache.xmlbeans.impl.values.XmlObjectBase.setLongValue(XmlObjectBase.java:1537)
      at com.convera.taw.qa.ws.databinding.com.convera.taw.qa.ws.data.impl.ItemImpl.setModificationStamp(ItemImpl.java:244)
... 28 more

Am I doing anything wrong here?

Thanks,
Steve



Re: [Axis2] Databinding

Posted by Steve Molloy <sm...@convera.com>.
Thanks,

	It does seem to be a problem with anyType and/or Vector as replacing
them seems to work. It still would have been nice to get the anyType
working as it still forced me to remove that piece of hierarchy. The
Item's id was a Comparable, so in one case was a string, and in another
another complexType. anyways, I split the 2 sub-classes to have specific
types (and use arrays instead of vectors which makes sense anyways...)
and it seems to work.

Thanks again,
Steve

On Wed, 2006-04-01 at 08:54 -0200, iksrazal wrote:
> Hi Steve, 
> 
> Using axis2 v.93 I also have a complex object using long, and I tried setting 
> one of its params to System.currentTimeMillis() . I couldn't reproduce the 
> problem. 
> 
> The other curious thing I see in the stack trace, is BigInteger.  Nothing I 
> see in your complex object maps to that: 
> 
> http://xmlbeans.apache.org/docs/2.0.0/guide/conXMLBeansSupportBuiltInSchemaTypes.html
> 
> I've seen some people on the list have problems with anyType, and  
> apachesoap:Vector I'm not sure about. You may try removing everything but 
> your long and see if you still have the problem. 
> 
> Lastly, you don't mention what type of binding style you are using - wrapped 
> document lteral, rpc literal or rpc encoded. Looking at your complex object, 
> you may be using soap encoded. I don't know what impact that would have with 
> xmlbeans, but axis2 support for rpc encoded IIRC is perhaps not up to par 
> with doc /lit. 
> 
> FWIW, here's an example of a wsdl I'm using successfully with axis2. It uses 
> extension base also, but uses int instead of long: 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <definitions name="SWASmartService" targetNamespace="http://swaSmartNS" 
> xmlns:tns="http://swaSmartNS" xmlns="http://schemas.xmlsoap.org/wsdl/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
> xmlns:ns2="http://swaSmartNS/types">
>   <types>
>     <schema targetNamespace="http://swaSmartNS/types" 
> xmlns:tns="http://swaSmartNS/types" 
> xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
> xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>       <complexType name="ReturnWebBase">
>         <sequence>
>           <element name="errorMessage" type="xsd:string"/>
>           <element name="successErrorCode" type="xsd:int"/>
>         </sequence>
>       </complexType>
>       <element name="smartLogin">
>         <complexType>
>           <sequence>
>             <element name="user_name" type="xsd:string"/>
>             <element name="user_password" type="xsd:string"/>
>           </sequence>
>         </complexType>
>       </element>
>       <element name="smartLoginResponse">
>         <complexType>
>           <complexContent>
>             <extension base="tns:ReturnWebBase">
>               <sequence>
>                 <element name="soap_session_id" type="xsd:string"/>
>                 <element name="web_user_name" type="xsd:string"/>
>               </sequence>
>             </extension>
>           </complexContent>
>         </complexType>
>       </element>
>       <element name="testService">
>         <complexType>
>           <sequence>
>             <element name="soap_session_id" type="xsd:string"/>
>             <element name="web_user_name" type="xsd:string"/>
>           </sequence>
>         </complexType>
>       </element>
>       <element name="testServiceResponse">
>         <complexType>
>           <complexContent>
>             <extension base="tns:ReturnWebBase">
>               <sequence>
>                 <element name="testId" type="xsd:long"/>
>               </sequence>
>             </extension>
>           </complexContent>
>         </complexType>
>       </element>
>       <element name="informarTecnicos">
>         <complexType>
>           <sequence>
>             <element name="soap_session_id" type="xsd:string"/>
>             <element name="web_user_name" type="xsd:string"/>
>             <element name="Matricula" type="xsd:string"/>
>             <element name="RATIntervalInicio" type="xsd:long"/>
>             <element name="RATIntervalFinal" type="xsd:long"/>
>           </sequence>
>         </complexType>
>       </element>
>       <complexType name="ArrayOfItemSnPn">
>         <sequence>
>           <element minOccurs="0" maxOccurs="unbounded" name="ItemSnPn" 
> nillable="false" type="tns:ItemSnPn" />
>         </sequence>
>       </complexType>
>       <complexType name="ItemSnPn">
>         <sequence>
>           <element minOccurs="1" maxOccurs="1" name="pn" type="long" />
>           <element minOccurs="1" maxOccurs="1" name="sn" type="long" />
>         </sequence>
>       </complexType>
>       <element name="informarListaEquipamento">
>         <complexType>
>           <sequence>
>             <element name="soap_session_id" type="xsd:string"/>
>             <element name="web_user_name" type="xsd:string"/>
>             <element name="Matricula" type="xsd:string"/>
>             <element name="ItemSnPn" minOccurs="0" maxOccurs="1" 
> type="tns:ArrayOfItemSnPn"/>
>           </sequence>
>         </complexType>
>       </element>
>       <element name="informarEquipamentoRetirado">
>         <complexType>
>           <sequence>
>             <element name="soap_session_id" type="xsd:string"/>
>             <element name="web_user_name" type="xsd:string"/>
>             <element name="OS" type="xsd:string"/>
>             <element name="modemRetirado" type="xsd:string"/>
>           </sequence>
>         </complexType>
>       </element>
>       <element name="informarServicoList">
>         <complexType>
>           <sequence>
>             <element name="soap_session_id" type="xsd:string"/>
>             <element name="web_user_name" type="xsd:string"/>
>             <element name="Matricula" type="xsd:string"/>
>             <element name="RATList"  minOccurs="0" maxOccurs="unbounded" 
> type="xsd:string"/>
>           </sequence>
>         </complexType>
>       </element>
>       <element name="ReturnWebBaseResponse" type="ns2:ReturnWebBase"/>
> </schema></types>
>   <message name="SWASmartEndpoint_informarListaEquipamento">
>      <part name="parameters" element="ns2:informarListaEquipamento"/>
>   </message>
>   <message name="SWASmartEndpoint_informarListaEquipamentoResponse">
>     <part name="result" element="ns2:ReturnWebBaseResponse"/>
>   </message>
>   <message name="SWASmartEndpoint_informarServicoList">
>      <part name="parameters" element="ns2:informarServicoList"/>
>   </message>
>   <message name="SWASmartEndpoint_informarServicoListResponse">
>     <part name="result" element="ns2:ReturnWebBaseResponse"/>
>   </message>
>   <message name="SWASmartEndpoint_informarEquipamentoRetirado">
>      <part name="parameters" element="ns2:informarEquipamentoRetirado"/>
>   </message>
>   <message name="SWASmartEndpoint_informarEquipamentoRetiradoResponse">
>     <part name="result" element="ns2:ReturnWebBaseResponse"/>
>   </message>
>   <message name="SWASmartEndpoint_informarTecnicos">
>      <part name="parameters" element="ns2:informarTecnicos"/>
>   </message>
>   <message name="SWASmartEndpoint_informarTecnicosResponse">
>     <part name="result" element="ns2:ReturnWebBaseResponse"/>
>   </message>
>   <message name="SWASmartEndpoint_testService">
>      <part name="parameters" element="ns2:testService"/>
>   </message>
>   <message name="SWASmartEndpoint_testServiceResponse">
>     <part name="result" element="ns2:testServiceResponse"/>
>   </message>
>   <message name="SWASmartEndpoint_smartLogin">
>      <part name="parameters" element="ns2:smartLogin"/>
>   </message>
>   <message name="SWASmartEndpoint_smartLoginResponse">
>     <part name="result" element="ns2:smartLoginResponse"/>
>   </message>
>   <portType name="SWASmartEndpoint">
>     <operation name="informarListaEquipamento">
>       <input message="tns:SWASmartEndpoint_informarListaEquipamento" 
> name="SWASmartEndpoint_informarListaEquipamento"/>
>       <output message="tns:SWASmartEndpoint_informarListaEquipamentoResponse" 
> name="SWASmartEndpoint_informarListaEquipamentoResponse"/>
>     </operation>
>     <operation name="informarEquipamentoRetirado">
>       <input message="tns:SWASmartEndpoint_informarEquipamentoRetirado" 
> name="SWASmartEndpoint_informarEquipamentoRetirado"/>
>       <output 
> message="tns:SWASmartEndpoint_informarEquipamentoRetiradoResponse" 
> name="SWASmartEndpoint_informarEquipamentoRetiradoResponse"/>
>     </operation>
>     <operation name="informarServicoList">
>       <input message="tns:SWASmartEndpoint_informarServicoList" 
> name="SWASmartEndpoint_informarServicoList"/>
>       <output message="tns:SWASmartEndpoint_informarServicoListResponse" 
> name="SWASmartEndpoint_informarServicoListResponse"/>
>     </operation>
>     <operation name="informarTecnicos">
>       <input message="tns:SWASmartEndpoint_informarTecnicos" 
> name="SWASmartEndpoint_informarTecnicos"/>
>       <output message="tns:SWASmartEndpoint_informarTecnicosResponse" 
> name="SWASmartEndpoint_informarTecnicosResponse"/>
>     </operation>
>     <operation name="testService">
>       <input message="tns:SWASmartEndpoint_testService" 
> name="SWASmartEndpoint_testService"/>
>       <output message="tns:SWASmartEndpoint_testServiceResponse" 
> name="SWASmartEndpoint_testServiceResponse"/>
>     </operation>
>     <operation name="smartLogin">
>       <input message="tns:SWASmartEndpoint_smartLogin" 
> name="SWASmartEndpoint_smartLogin"/>
>       <output message="tns:SWASmartEndpoint_smartLoginResponse" 
> name="SWASmartEndpoint_smartLoginResponse"/>
>     </operation>
>   </portType>
>   <binding name="SWASmartEndpointBinding" type="tns:SWASmartEndpoint">
>     <soap:binding transport="http://schemas.xmlsoap.org/soap/http" 
> style="document"/>
>     <operation name="informarListaEquipamento">
>       <soap:operation soapAction="informarListaEquipamento"/>
>       <input name="SWASmartEndpoint_informarListaEquipamento">
>         <soap:body use="literal"/>
>       </input>
>       <output name="SWASmartEndpoint_informarListaEquipamentoResponse">
>         <soap:body use="literal"/>
>       </output>
>     </operation>
>     <operation name="informarEquipamentoRetirado">
>       <soap:operation soapAction="informarEquipamentoRetirado"/>
>       <input name="SWASmartEndpoint_informarEquipamentoRetirado">
>         <soap:body use="literal"/>
>       </input>
>       <output name="SWASmartEndpoint_informarEquipamentoRetiradoResponse">
>         <soap:body use="literal"/>
>       </output>
>     </operation>
>     <operation name="informarServicoList">
>       <soap:operation soapAction="informarServicoList"/>
>       <input name="SWASmartEndpoint_informarServicoList">
>         <soap:body use="literal"/>
>       </input>
>       <output name="SWASmartEndpoint_informarServicoListResponse">
>         <soap:body use="literal"/>
>       </output>
>     </operation>
>     <operation name="informarTecnicos">
>       <soap:operation soapAction="informarTecnicos"/>
>       <input name="SWASmartEndpoint_informarTecnicos">
>         <soap:body use="literal"/>
>       </input>
>       <output name="SWASmartEndpoint_informarTecnicosResponse">
>         <soap:body use="literal"/>
>       </output>
>     </operation>
>     <operation name="smartLogin">
>       <soap:operation soapAction="smartLogin"/>
>       <input name="SWASmartEndpoint_smartLogin">
>         <soap:body use="literal"/>
>       </input>
>       <output name="SWASmartEndpoint_smartLoginResponse">
>         <soap:body use="literal"/>
>       </output>
>     </operation>
>     <operation name="testService">
>       <soap:operation soapAction="testService"/>
>       <input name="SWASmartEndpoint_testService">
>         <soap:body use="literal"/>
>       </input>
>       <output name="SWASmartEndpoint_testServiceResponse">
>         <soap:body use="literal"/>
>       </output>
>     </operation>
>   </binding>
>   <service name="SWASmartService">
>     <port name="SWASmartEndpointPort" binding="tns:SWASmartEndpointBinding">
>       <soap:address 
> location="http://localhost:8080/axis2/services/SWASmartEndpoint"/></port></service></definitions>
> 
> HTH,
> iksrazal
> http://www.braziloutsource.com/
> 
> Em Terça 03 Janeiro 2006 15:20, o Eran Chinthaka escreveu:
> > Forwarding with correct prefix.
> >
> > -------- Original Message --------
> > Subject: 	Databinding
> > Date: 	Tue, 03 Jan 2006 12:01:27 -0500
> > From: 	Steve Molloy <sm...@convera.com>
> > Reply-To: 	axis-user@ws.apache.org
> > To: 	axis-user@ws.apache.org
> >
> >
> >
> > Hi,
> >
> > 	I'm new to Axis 2 (0.93) and am trying to convert my Axis 1 services to
> > it. I'm having a problem with the databindings generated and was
> > wondering if anyone ran into this and, much more importantly, if anyone
> > had a solution... My messages use the following types:
> >
> > <complexType name="Item">
> > 	<sequence>
> > 		<element name="id" nillable="true" type="xsd:anyType"/>
> > 		<element name="latest" nillable="true" type="tns1:Version"/>
> > 		<element name="modificationStamp" type="xsd:long"/>
> > 		<element name="versions" nillable="true" type="apachesoap:Vector"/>
> > 	</sequence>
> > </complexType>
> > <complexType name="BatchTest">
> > 	<complexContent>
> > 		<extension base="tns1:Item">
> > 			<sequence>
> > 				<element name="info" nillable="true" type="tns1:BatchTestInfo"/>
> > 			</sequence>
> > 		</extension>
> > 	</complexContent>
> > </complexType>
> >
> > While the generated (WSDL2Java using xmlbeans) java code seems fine,
> > when I actually try to use it, the server throws a
> > XmlValueOutOfRangeException because it gets into XmlObjectBase code
> > instead of XmlLong when trying to set the modificationTimeStamp field
> > with a long (yes, System.currentTimeMillis()). StackTrace:
> >
> > ...
> > Caused by: org.apache.xmlbeans.impl.values.XmlValueNotSupportedException
> >       at
> > org.apache.xmlbeans.impl.values.XmlObjectBase.set_BigDecimal(XmlObjectBase.
> >java:1989) at
> > org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1608)
> > at
> > org.apache.xmlbeans.impl.values.XmlObjectBase.set_BigInteger(XmlObjectBase.
> >java:1987) at
> > org.apache.xmlbeans.impl.values.XmlObjectBase.set_long(XmlObjectBase.java:1
> >969) at
> > org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1596)
> > at
> > org.apache.xmlbeans.impl.values.XmlObjectBase.setLongValue(XmlObjectBase.ja
> >va:1537) at
> > com.convera.taw.qa.ws.databinding.com.convera.taw.qa.ws.data.impl.ItemImpl.
> >setModificationStamp(ItemImpl.java:244) ... 28 more
> >
> > Am I doing anything wrong here?
> >
> > Thanks,
> > Steve
> 

Re: [Axis2] Databinding

Posted by iksrazal <ik...@gmail.com>.
Hi Steve, 

Using axis2 v.93 I also have a complex object using long, and I tried setting 
one of its params to System.currentTimeMillis() . I couldn't reproduce the 
problem. 

The other curious thing I see in the stack trace, is BigInteger.  Nothing I 
see in your complex object maps to that: 

http://xmlbeans.apache.org/docs/2.0.0/guide/conXMLBeansSupportBuiltInSchemaTypes.html

I've seen some people on the list have problems with anyType, and  
apachesoap:Vector I'm not sure about. You may try removing everything but 
your long and see if you still have the problem. 

Lastly, you don't mention what type of binding style you are using - wrapped 
document lteral, rpc literal or rpc encoded. Looking at your complex object, 
you may be using soap encoded. I don't know what impact that would have with 
xmlbeans, but axis2 support for rpc encoded IIRC is perhaps not up to par 
with doc /lit. 

FWIW, here's an example of a wsdl I'm using successfully with axis2. It uses 
extension base also, but uses int instead of long: 

<?xml version="1.0" encoding="UTF-8"?>

<definitions name="SWASmartService" targetNamespace="http://swaSmartNS" 
xmlns:tns="http://swaSmartNS" xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:ns2="http://swaSmartNS/types">
  <types>
    <schema targetNamespace="http://swaSmartNS/types" 
xmlns:tns="http://swaSmartNS/types" 
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <complexType name="ReturnWebBase">
        <sequence>
          <element name="errorMessage" type="xsd:string"/>
          <element name="successErrorCode" type="xsd:int"/>
        </sequence>
      </complexType>
      <element name="smartLogin">
        <complexType>
          <sequence>
            <element name="user_name" type="xsd:string"/>
            <element name="user_password" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <element name="smartLoginResponse">
        <complexType>
          <complexContent>
            <extension base="tns:ReturnWebBase">
              <sequence>
                <element name="soap_session_id" type="xsd:string"/>
                <element name="web_user_name" type="xsd:string"/>
              </sequence>
            </extension>
          </complexContent>
        </complexType>
      </element>
      <element name="testService">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <element name="testServiceResponse">
        <complexType>
          <complexContent>
            <extension base="tns:ReturnWebBase">
              <sequence>
                <element name="testId" type="xsd:long"/>
              </sequence>
            </extension>
          </complexContent>
        </complexType>
      </element>
      <element name="informarTecnicos">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="Matricula" type="xsd:string"/>
            <element name="RATIntervalInicio" type="xsd:long"/>
            <element name="RATIntervalFinal" type="xsd:long"/>
          </sequence>
        </complexType>
      </element>
      <complexType name="ArrayOfItemSnPn">
        <sequence>
          <element minOccurs="0" maxOccurs="unbounded" name="ItemSnPn" 
nillable="false" type="tns:ItemSnPn" />
        </sequence>
      </complexType>
      <complexType name="ItemSnPn">
        <sequence>
          <element minOccurs="1" maxOccurs="1" name="pn" type="long" />
          <element minOccurs="1" maxOccurs="1" name="sn" type="long" />
        </sequence>
      </complexType>
      <element name="informarListaEquipamento">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="Matricula" type="xsd:string"/>
            <element name="ItemSnPn" minOccurs="0" maxOccurs="1" 
type="tns:ArrayOfItemSnPn"/>
          </sequence>
        </complexType>
      </element>
      <element name="informarEquipamentoRetirado">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="OS" type="xsd:string"/>
            <element name="modemRetirado" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <element name="informarServicoList">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="Matricula" type="xsd:string"/>
            <element name="RATList"  minOccurs="0" maxOccurs="unbounded" 
type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <element name="ReturnWebBaseResponse" type="ns2:ReturnWebBase"/>
</schema></types>
  <message name="SWASmartEndpoint_informarListaEquipamento">
     <part name="parameters" element="ns2:informarListaEquipamento"/>
  </message>
  <message name="SWASmartEndpoint_informarListaEquipamentoResponse">
    <part name="result" element="ns2:ReturnWebBaseResponse"/>
  </message>
  <message name="SWASmartEndpoint_informarServicoList">
     <part name="parameters" element="ns2:informarServicoList"/>
  </message>
  <message name="SWASmartEndpoint_informarServicoListResponse">
    <part name="result" element="ns2:ReturnWebBaseResponse"/>
  </message>
  <message name="SWASmartEndpoint_informarEquipamentoRetirado">
     <part name="parameters" element="ns2:informarEquipamentoRetirado"/>
  </message>
  <message name="SWASmartEndpoint_informarEquipamentoRetiradoResponse">
    <part name="result" element="ns2:ReturnWebBaseResponse"/>
  </message>
  <message name="SWASmartEndpoint_informarTecnicos">
     <part name="parameters" element="ns2:informarTecnicos"/>
  </message>
  <message name="SWASmartEndpoint_informarTecnicosResponse">
    <part name="result" element="ns2:ReturnWebBaseResponse"/>
  </message>
  <message name="SWASmartEndpoint_testService">
     <part name="parameters" element="ns2:testService"/>
  </message>
  <message name="SWASmartEndpoint_testServiceResponse">
    <part name="result" element="ns2:testServiceResponse"/>
  </message>
  <message name="SWASmartEndpoint_smartLogin">
     <part name="parameters" element="ns2:smartLogin"/>
  </message>
  <message name="SWASmartEndpoint_smartLoginResponse">
    <part name="result" element="ns2:smartLoginResponse"/>
  </message>
  <portType name="SWASmartEndpoint">
    <operation name="informarListaEquipamento">
      <input message="tns:SWASmartEndpoint_informarListaEquipamento" 
name="SWASmartEndpoint_informarListaEquipamento"/>
      <output message="tns:SWASmartEndpoint_informarListaEquipamentoResponse" 
name="SWASmartEndpoint_informarListaEquipamentoResponse"/>
    </operation>
    <operation name="informarEquipamentoRetirado">
      <input message="tns:SWASmartEndpoint_informarEquipamentoRetirado" 
name="SWASmartEndpoint_informarEquipamentoRetirado"/>
      <output 
message="tns:SWASmartEndpoint_informarEquipamentoRetiradoResponse" 
name="SWASmartEndpoint_informarEquipamentoRetiradoResponse"/>
    </operation>
    <operation name="informarServicoList">
      <input message="tns:SWASmartEndpoint_informarServicoList" 
name="SWASmartEndpoint_informarServicoList"/>
      <output message="tns:SWASmartEndpoint_informarServicoListResponse" 
name="SWASmartEndpoint_informarServicoListResponse"/>
    </operation>
    <operation name="informarTecnicos">
      <input message="tns:SWASmartEndpoint_informarTecnicos" 
name="SWASmartEndpoint_informarTecnicos"/>
      <output message="tns:SWASmartEndpoint_informarTecnicosResponse" 
name="SWASmartEndpoint_informarTecnicosResponse"/>
    </operation>
    <operation name="testService">
      <input message="tns:SWASmartEndpoint_testService" 
name="SWASmartEndpoint_testService"/>
      <output message="tns:SWASmartEndpoint_testServiceResponse" 
name="SWASmartEndpoint_testServiceResponse"/>
    </operation>
    <operation name="smartLogin">
      <input message="tns:SWASmartEndpoint_smartLogin" 
name="SWASmartEndpoint_smartLogin"/>
      <output message="tns:SWASmartEndpoint_smartLoginResponse" 
name="SWASmartEndpoint_smartLoginResponse"/>
    </operation>
  </portType>
  <binding name="SWASmartEndpointBinding" type="tns:SWASmartEndpoint">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" 
style="document"/>
    <operation name="informarListaEquipamento">
      <soap:operation soapAction="informarListaEquipamento"/>
      <input name="SWASmartEndpoint_informarListaEquipamento">
        <soap:body use="literal"/>
      </input>
      <output name="SWASmartEndpoint_informarListaEquipamentoResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="informarEquipamentoRetirado">
      <soap:operation soapAction="informarEquipamentoRetirado"/>
      <input name="SWASmartEndpoint_informarEquipamentoRetirado">
        <soap:body use="literal"/>
      </input>
      <output name="SWASmartEndpoint_informarEquipamentoRetiradoResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="informarServicoList">
      <soap:operation soapAction="informarServicoList"/>
      <input name="SWASmartEndpoint_informarServicoList">
        <soap:body use="literal"/>
      </input>
      <output name="SWASmartEndpoint_informarServicoListResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="informarTecnicos">
      <soap:operation soapAction="informarTecnicos"/>
      <input name="SWASmartEndpoint_informarTecnicos">
        <soap:body use="literal"/>
      </input>
      <output name="SWASmartEndpoint_informarTecnicosResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="smartLogin">
      <soap:operation soapAction="smartLogin"/>
      <input name="SWASmartEndpoint_smartLogin">
        <soap:body use="literal"/>
      </input>
      <output name="SWASmartEndpoint_smartLoginResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="testService">
      <soap:operation soapAction="testService"/>
      <input name="SWASmartEndpoint_testService">
        <soap:body use="literal"/>
      </input>
      <output name="SWASmartEndpoint_testServiceResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="SWASmartService">
    <port name="SWASmartEndpointPort" binding="tns:SWASmartEndpointBinding">
      <soap:address 
location="http://localhost:8080/axis2/services/SWASmartEndpoint"/></port></service></definitions>

HTH,
iksrazal
http://www.braziloutsource.com/

Em Terça 03 Janeiro 2006 15:20, o Eran Chinthaka escreveu:
> Forwarding with correct prefix.
>
> -------- Original Message --------
> Subject: 	Databinding
> Date: 	Tue, 03 Jan 2006 12:01:27 -0500
> From: 	Steve Molloy <sm...@convera.com>
> Reply-To: 	axis-user@ws.apache.org
> To: 	axis-user@ws.apache.org
>
>
>
> Hi,
>
> 	I'm new to Axis 2 (0.93) and am trying to convert my Axis 1 services to
> it. I'm having a problem with the databindings generated and was
> wondering if anyone ran into this and, much more importantly, if anyone
> had a solution... My messages use the following types:
>
> <complexType name="Item">
> 	<sequence>
> 		<element name="id" nillable="true" type="xsd:anyType"/>
> 		<element name="latest" nillable="true" type="tns1:Version"/>
> 		<element name="modificationStamp" type="xsd:long"/>
> 		<element name="versions" nillable="true" type="apachesoap:Vector"/>
> 	</sequence>
> </complexType>
> <complexType name="BatchTest">
> 	<complexContent>
> 		<extension base="tns1:Item">
> 			<sequence>
> 				<element name="info" nillable="true" type="tns1:BatchTestInfo"/>
> 			</sequence>
> 		</extension>
> 	</complexContent>
> </complexType>
>
> While the generated (WSDL2Java using xmlbeans) java code seems fine,
> when I actually try to use it, the server throws a
> XmlValueOutOfRangeException because it gets into XmlObjectBase code
> instead of XmlLong when trying to set the modificationTimeStamp field
> with a long (yes, System.currentTimeMillis()). StackTrace:
>
> ...
> Caused by: org.apache.xmlbeans.impl.values.XmlValueNotSupportedException
>       at
> org.apache.xmlbeans.impl.values.XmlObjectBase.set_BigDecimal(XmlObjectBase.
>java:1989) at
> org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1608)
> at
> org.apache.xmlbeans.impl.values.XmlObjectBase.set_BigInteger(XmlObjectBase.
>java:1987) at
> org.apache.xmlbeans.impl.values.XmlObjectBase.set_long(XmlObjectBase.java:1
>969) at
> org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1596)
> at
> org.apache.xmlbeans.impl.values.XmlObjectBase.setLongValue(XmlObjectBase.ja
>va:1537) at
> com.convera.taw.qa.ws.databinding.com.convera.taw.qa.ws.data.impl.ItemImpl.
>setModificationStamp(ItemImpl.java:244) ... 28 more
>
> Am I doing anything wrong here?
>
> Thanks,
> Steve

-- 

Re: [Axis2] Databinding

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hmm...
Interesting issue.. I always thought XMLBeans could handle this properly
(For startes, ADB would spit out an error message because of complex content
element)
It could be an issue in the XmlBeans code (please check whether the
generated Message receiver does the right thing, if it does then it's
definitley an issue with the XMLbeans side). It would be better if you ask
this in the XMLBeans list as well

On 1/3/06, Eran Chinthaka <ch...@opensource.lk> wrote:
>
> Forwarding with correct prefix.
>
> -------- Original Message --------  Subject: Databinding  Date: Tue, 03
> Jan 2006 12:01:27 -0500  From: Steve Molloy <sm...@convera.com>  Reply-To:
> axis-user@ws.apache.org  To: axis-user@ws.apache.org
>
> Hi,
>
> 	I'm new to Axis 2 (0.93) and am trying to convert my Axis 1 services to
> it. I'm having a problem with the databindings generated and was
> wondering if anyone ran into this and, much more importantly, if anyone
> had a solution... My messages use the following types:
>
> <complexType name="Item">
> 	<sequence>
> 		<element name="id" nillable="true" type="xsd:anyType"/>
> 		<element name="latest" nillable="true" type="tns1:Version"/>
> 		<element name="modificationStamp" type="xsd:long"/>
> 		<element name="versions" nillable="true" type="apachesoap:Vector"/>
> 	</sequence>
> </complexType>
> <complexType name="BatchTest">
> 	<complexContent>
> 		<extension base="tns1:Item">
> 			<sequence>
> 				<element name="info" nillable="true" type="tns1:BatchTestInfo"/>
> 			</sequence>
> 		</extension>
> 	</complexContent>
> </complexType>
>
> While the generated (WSDL2Java using xmlbeans) java code seems fine,
> when I actually try to use it, the server throws a
> XmlValueOutOfRangeException because it gets into XmlObjectBase code
> instead of XmlLong when trying to set the modificationTimeStamp field
> with a long (yes, System.currentTimeMillis()). StackTrace:
>
> ...
> Caused by: org.apache.xmlbeans.impl.values.XmlValueNotSupportedException
>       at org.apache.xmlbeans.impl.values.XmlObjectBase.set_BigDecimal(XmlObjectBase.java:1989)
>       at org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1608)
>       at org.apache.xmlbeans.impl.values.XmlObjectBase.set_BigInteger(XmlObjectBase.java:1987)
>       at org.apache.xmlbeans.impl.values.XmlObjectBase.set_long(XmlObjectBase.java:1969)
>       at org.apache.xmlbeans.impl.values.XmlObjectBase.set(XmlObjectBase.java:1596)
>       at org.apache.xmlbeans.impl.values.XmlObjectBase.setLongValue(XmlObjectBase.java:1537)
>       at com.convera.taw.qa.ws.databinding.com.convera.taw.qa.ws.data.impl.ItemImpl.setModificationStamp(ItemImpl.java:244)
> ... 28 more
>
> Am I doing anything wrong here?
>
> Thanks,
> Steve
>
>


--
Ajith Ranabahu