edu edu
Posts: 1
Nickname: soriaedu
Registered: Nov, 2005
HELP PLEASE!! Problems returning an array inside of another array
Posted: Nov 7, 2005 8:53 AM
Advertisement
Hello, I have a problem with my WS and I´m a little bit desperated. I am develoving the web service using Axis 1.1 and a Jboss server. I have a web service that returns an array of objects. One field of this object is an array of objects also. The code in the server works fine but when the server send to the client the answer, the client can´t read it correctly. There are no problems encoding the first array, but encoding the internal array I obtain always an array with only one component, instead of n components. I suposse that is a problem of some property of my wsdd but I can´t find if. I have made millions of tests but all of them went wrong :( This is my wsdl and my wsdd. ----- WSDL ------- <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra" xmlns:intf="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="java:modelo.alejandra.rima.hp.com" xmlns="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <schema elementFormDefault="qualified" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="java:modelo.alejandra.rima.hp.com"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <complexType name="ConectividadPuertoVLan"> <sequence> <element name="idVLan" nillable="true" type="xsd:string" /> <element name="agingEnabled" type="xsd:int" /> <element name="agingPeriod" nillable="true" type="xsd:string" /> <element name="framesPerVLan_Src" nillable="true" type="xsd:string" /> <element name="agePerVLan_Src" nillable="true" type="xsd:string" /> <element name="framesPerVLan_Dst" nillable="true" type="xsd:string" /> <element name="agePerVLan_Dst" nillable="true" type="xsd:string" /> </sequence> </complexType> <complexType name="StatusPuerto"> <sequence> <element name="estadoAdministrativo" nillable="true" type="xsd:string" /> <element name="estadoEnlace" nillable="true" type="xsd:string" /> <element name="puertoDesactivado" nillable="true" type="xsd:string" /> <element name="tiempoRecuperacion" nillable="true" type="xsd:string" /> </sequence> </complexType> <complexType name="EstadoVLanPuerto"> <sequence> <element name="idVLan" nillable="true" type="xsd:string" /> <element name="puertoInhabilitado" nillable="true" type="xsd:string" /> </sequence> </complexType> <complexType name="InformacionEstadoPuerto"> <sequence> <element name="nombreAdministrativoSW" nillable="true" type="xsd:string" /> <element name="descripcion" nillable="true" type="xsd:string" /> <element name="ipLoopback" nillable="true" type="xsd:string" /> <element name="nombrePuerto" nillable="true" type="xsd:string" /> <element name="statusPuerto" nillable="true" type="tns1:StatusPuerto" /> <element name="statusVLans" nillable="true" type="tns1:ArrayOfEstadoVLanPuerto" /> </sequence> </complexType> <complexType name="ElementoConectado"> <sequence> <element name="tipo" nillable="true" type="xsd:string" /> <element name="nombre" nillable="true" type="xsd:string" /> <element name="mac" nillable="true" type="xsd:string" /> </sequence> </complexType> <complexType name="InformacionConectividadPuerto"> <sequence> <element name="nombreAdministrativoSW" nillable="true" type="xsd:string" /> <element name="descripcion" nillable="true" type="xsd:string" /> <element name="ipLoopback" nillable="true" type="xsd:string" /> <element name="nombrePuerto" nillable="true" type="xsd:string" /> <element name="nombreAdminEquipoExtremo" nillable="true" type="xsd:string" /> <element name="nombreInterfazUnionExtremo" nillable="true" type="xsd:string" /> <element name="conectividades" nillable="true" type="tns1:ArrayOfConectividadPuertoVLan" /> </sequence> </complexType> <complexType name="VLan"> <sequence> <element name="tipo" nillable="true" type="xsd:string" /> <element name="numero" nillable="true" type="xsd:string" /> </sequence> </complexType> <complexType name="ArrayOfEstadoVLanPuerto"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:EstadoVLanPuerto[]" /> </restriction> </complexContent> </complexType> < ;complexType name="ArrayOfConectividadPuertoVLan"> <complexContent> <restricti on base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:ConectividadPuertoVLan[]" /> </restriction> </complexContent> </complexType> < ;complexType name="ArrayOfVLan"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:VLan[]" /> </restriction> </complexContent> </complexType> < ;complexType name="ArrayOfInformacionEstadoPuerto"> <complexContent> <restrict ion base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:InformacionEstadoPuerto[]" /> </restriction> </complexContent> </complexType> < ;complexType name="ArrayOfInformacionConectividadPuerto"> <complexContent> <re striction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:InformacionConectividadPuerto[]" /> </restriction> </complexContent> </complexType> < ;/schema> </wsdl:types> <wsdl:message name="conectividadRequest"> <wsdl:part name="man" type="xsd:string" /> <wsdl:part name="elemento" type="tns1:ElementoConectado" /> <wsdl:part name="vlans" type="tns1:ArrayOfVLan" /> </wsdl:message> <wsdl:message name="estadoPuertoRequest"> <wsdl:part name="man" type="xsd:string" /> <wsdl:part name="elemento" type="tns1:ElementoConectado" /> <wsdl:part name="vlans" type="tns1:ArrayOfVLan" /> </wsdl:message> <wsdl:message name="conectividadResponse"> <wsdl:part name="resumenResultado" type="xsd:int" /> <wsdl:part name="codigoError" type="xsd:string" /> <wsdl:part name="descripcionError" type="xsd:string" /> <wsdl:part name="resultado" type="xsd:string" /> <wsdl:part name="resNoEstructurado" type="xsd:string" /> <wsdl:part name="infoConectividadPuerto" type="tns1:ArrayOfInformacionConectividadPuerto" /> </wsdl:message> <wsdl:message name="estadoPuertoResponse"> <wsdl:part name="resumenResultado" type="xsd:int" /> <wsdl:part name="codigoError" type="xsd:string" /> <wsdl:part name="descripcionError" type="xsd:string" /> <wsdl:part name="resultado" type="xsd:string" /> <wsdl:part name="resNoEstructurado" type="xsd:string" /> <wsdl:part name="infoEstadoPuerto" type="tns1:ArrayOfInformacionEstadoPuerto" /> </wsdl:message> <wsdl:portType name="SOAPport"> <wsdl:operation name="estadoPuerto" parameterOrder="man elemento vlans resumenResultado codigoError descripcionError resultado resNoEstructurado infoEstadoPuerto"> <wsdl:input name="estadoPuertoRequest" message="intf:estadoPuertoRequest" /> <wsdl:output name="estadoPuertoResponse" message="intf:estadoPuertoResponse" /> </wsdl:operation> <wsdl:operation name="conectividad" parameterOrder="man elemento vlans resumenResultado codigoError descripcionError resultado resNoEstructurado infoConectividadPuerto"> <wsdl:input name="conectividadRequest" message="intf:conectividadRequest" /> <wsdl:output name="conectividadResponse" message="intf:conectividadResponse" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="DiagnosticoAlejandraSoapBinding" type="intf:SOAPport"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="estadoPuerto"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="estadoPuertoRequest"> <wsdlsoap:body use="literal" namespace="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra" /> </wsdl:input> <wsdl:output name="estadoPuertoResponse"> <wsdlsoap:body use="literal" namespace="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="conectividad"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="conectividadRequest"> <wsdlsoap:body use="literal" namespace="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra" /> </wsdl:input> <wsdl:output name="conectividadResponse"> <wsdlsoap:body use="literal" namespace="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra" /> </wsdl:output> </wsdl:operation> </wsdl:binding> &l t;wsdl:service name="DiagnosticoAlejandra"> <wsdl:port name="DiagnosticoAlejandra" binding="intf:DiagnosticoAlejandraSoapBinding"> <wsdlsoap:address location="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra" /> </wsdl:port> </wsdl:service> </wsdl:definitions> - ------- WSDD --------- <!-- Use this file to deploy some handlers/chains and services --> <!-- Two ways to do this: --> <!-- java org.apache.axis.client.AdminClient deploy.wsdd --> <!-- after the axis server is running --> <!-- or --> <!-- java org.apache.axis.utils.Admin client|server deploy.wsdd --> <!-- from the same directory that the Axis engine runs --> <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="htt p://xml.apache.org/axis/wsdd/providers/java"> <!-- Services from DiagnosticoAlejandra WSDL service --> <service name="DiagnosticoAlejandra" provider="java:RPC" style="rpc" use="literal"> <parameter name="wsdlTargetNamespace" value="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra"/> <par ameter name="wsdlServiceElement" value="DiagnosticoAlejandra"/> <parameter name="wsdlServicePort" value="DiagnosticoAlejandra"/> <parameter name="className" value="DiagnosticoAlejandra"/> <parameter name="wsdlPortType" value="SOAPport"/> <operation name="estadoPuerto" qname="operNS:estadoPuerto" xmlns:operNS="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra" > <parameter name="man" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/> <parameter name="elemento" type="tns:ElementoConectado" xmlns:tns="java:modelo.alejandra.rima.hp.com"/> <parameter name="vlans" type="tns:ArrayOfVLan" xmlns:tns="java:modelo.alejandra.rima.hp.com"/> <parameter name="resumenResultado" type="tns:int" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/> <parameter name="codigoError" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/> <parameter name="descripcionError" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/> <parameter name="resultado" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/> <parameter name="resNoEstructurado" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/> <parameter name="infoEstadoPuerto" type="tns:ArrayOfInformacionEstadoPuerto" xmlns:tns="java:modelo.alejandra.rima.hp.com" mode="OUT"/> </operation> <operation name="conectividad" qname="operNS:conectividad" xmlns:operNS="http://172.22.4.72:8080/axis/services/DiagnosticoAlejandra" > <parameter name="man" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema"/> <parameter name="elemento" type="tns:ElementoConectado" xmlns:tns="java:modelo.alejandra.rima.hp.com"/> <parameter name="vlans" type="tns:ArrayOfVLan" xmlns:tns="java:modelo.alejandra.rima.hp.com"/> <parameter name="resumenResultado" type="tns:int" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/> <parameter name="codigoError" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/> <parameter name="descripcionError" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/> <parameter name="resultado" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/> <parameter name="resNoEstructurado" type="tns:string" xmlns:tns="http://www.w3.org/2001/XMLSchema" mode="OUT"/> <parameter name="infoConectividadPuerto" type="tns:ArrayOfInformacionConectividadPuerto" xmlns:tns="java:modelo.alejandra.rima.hp.com" mode="OUT"/> </operation> <parameter name="allowedMethods" value="estadoPuerto conectividad"/> <typeMapping xmlns:ns="java:modelo.alejandra.rima.hp.com " qname="ns:ConectividadPuertoVLan" type="java:com.hp.rima.alejandra.modelo.Cone ctividadPuertoVLan" serializer="org.apache.axis.encoding.ser.BeanSerializerFacto ry" deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encoding Style="" /> <typeMapping xmlns:ns="java:modelo.alejandra.rima.hp.com" qnam e="ns:StatusPuerto" type="java:com.hp.rima.alejandra.modelo.StatusPuerto" serial izer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apac he.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="" /> <typeMap ping xmlns:ns="java:modelo.alejandra.rima.hp.com" qname="ns:ArrayOfEstadoVLanPue rto" type="java:com.hp.rima.alejandra.modelo.EstadoVLanPuerto[]" serializer="org .apache.axis.encoding.ser.ArraySerializerFactory" deserializer="org.apache.axis. encoding.ser.ArrayDeserializerFactory" encodingStyle="" /> <typeMapping xm lns:ns="java:modelo.alejandra.rima.hp.com" qname="ns:ArrayOfInformacionConectivi dadPuerto" type="java:com.hp.rima.alejandra.modelo.InformacionConectividadPuerto []" serializer="org.apache.axis.encoding.ser.ArraySerializerFactory" deserialize r="org.apache.axis.encoding.ser.ArrayDeserializerFactory" encodingStyle="" /> <typeMapping xmlns:ns="java:modelo.alejandra.rima.hp.com" qname="ns:EstadoVL anPuerto" type="java:com.hp.rima.alejandra.modelo.EstadoVLanPuerto" serializer=" org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apache.axi s.encoding.ser.BeanDeserializerFactory" encodingStyle="" /> <typeMapping x mlns:ns="java:modelo.alejandra.rima.hp.com" qname="ns:ArrayOfVLan" type="java:co m.hp.rima.alejandra.modelo.VLan[]" serializer="org.apache.axis.encoding.ser.Arra ySerializerFactory" deserializer="org.apache.axis.encoding.ser.ArrayDeserializer Factory" encodingStyle="" /> <typeMapping xmlns:ns="java:modelo.alejandra. rima.hp.com" qname="ns:InformacionConectividadPuerto" type="java:com.hp.rima.ale jandra.modelo.InformacionConectividadPuerto" serializer="org.apache.axis.encodin g.ser.BeanSerializerFactory" deserializer="org.apache.axis.encoding.ser.BeanDese rializerFactory" encodingStyle="" /> <typeMapping xmlns:ns="java:modelo.al ejandra.rima.hp.com" qname="ns:ArrayOfConectividadPuertoVLan" type="java:com.hp. rima.alejandra.modelo.ConectividadPuertoVLan[]" serializer="org.apache.axis.enco ding.ser.ArraySerializerFactory" deserializer="org.apache.axis.encoding.ser.Arra yDeserializerFactory" encodingStyle="" /> <typeMapping xmlns:ns="java:mode lo.alejandra.rima.hp.com" qname="ns:VLan" type="java:com.hp.rima.alejandra.model o.VLan" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserial izer="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="" /&g t; <typeMapping xmlns:ns="java:modelo.alejandra.rima.hp.com" qname="ns:Inform acionEstadoPuerto" type="java:com.hp.rima.alejandra.modelo.InformacionEstadoPuer to" serializer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer ="org.apache.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="" /> & lt;typeMapping xmlns:ns="java:modelo.alejandra.rima.hp.com" qname="ns:ArrayOfInf ormacionEstadoPuerto" type="java:com.hp.rima.alejandra.modelo.InformacionEstadoP uerto[]" serializer="org.apache.axis.encoding.ser.ArraySerializerFactory" deseri alizer="org.apache.axis.encoding.ser.ArrayDeserializerFactory" encodingStyle="" /> <typeMapping xmlns:ns="java:modelo.alejandra.rima.hp.com" qname="ns:Ele mentoConectado" type="java:com.hp.rima.alejandra.modelo.ElementoConectado" seria lizer="org.apache.axis.encoding.ser.BeanSerializerFactory" deserializer="org.apa che.axis.encoding.ser.BeanDeserializerFactory" encodingStyle="" /> </servi ce> </deployment> --------------------------- The problem is in the estadoPuerto operation, with the field statusVLans of the return object InformacionEstadoPuerto. I have used wsdl2java for generating the wsdd, the libraries of estructures and the client program. Please it´s really important for me find the mistake. Thank you really much in advance. Eduardo.