As part of the promotion of the Axis project to a top level project, we have decided to create separate mailing lists for Axis 1 and Axis2. For all Axis 1 related questions please subscribe and post to [email protected]. Thanks!
Andreas On Wed, Nov 10, 2010 at 06:06, JOSE L MARTINEZ-AVIAL <[email protected]> wrote: > Hello all, > I'm using Axis 1.4, and I'm trying to use a Enum as a parameter for a > webservices. I've the following class: > > public class BoxWebService { > > public boolean doUpload(MyEnum by,String userName, String contentType, > String fileName,byte[] content){ > return false; > } > } > > The enum MyEnum is as follows: > public enum MyEnum { > _USER,_SYSTEM,_PUBLICATIONS_MANAGER; > } > > And I'm using the following wsdd to deploy the service: > > <?xml version="1.0" ?> > <deployment > xmlns="http://xml.apache.org/axis/wsdd/" > xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> > > <service name="DocumentService.ws" provider="java:RPC"> > > <!-- Nombre de la clase que implementa los metodos expuestos --> > <parameter name="className" > value="com.spb.eco.modules.box.controller.webservice.BoxWebService"/> > <parameter name="dotNetSoapEncFix" value="true"/> > <!-- Expone todos los metodos como visibles desde el exterior --> > <parameter name="allowedMethods" value="doUpload"/> > > <parameter name="wsdlTargetNamespace" value="wsdl.test"/> > > <typeMapping > xmlns:ns="urn:wsdl.test" > qname="ns:role" > type="java:com.spb.eco.services.box.util.MyEnum" > serializer="org.apache.axis.encoding.ser.EnumSerializerFactory" > deserializer="org.apache.axis.encoding.ser.EnumDeserializerFactory" > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> > </service> > > <handler name="LocalResponder" > type="java:org.apache.axis.transport.local.LocalResponder"/> > <handler name="URLMapper" > type="java:org.apache.axis.handlers.http.URLMapper"/> > > > <transport name="http"> > <requestFlow> > <handler type="URLMapper"/> > <handler > type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/> > </requestFlow> > <parameter name="qs:list" > value="org.apache.axis.transport.http.QSListHandler"/> > <parameter name="qs:wsdl" > value="org.apache.axis.transport.http.QSWSDLHandler"/> > <parameter name="qs.list" > value="org.apache.axis.transport.http.QSListHandler"/> > <parameter name="qs.method" > value="org.apache.axis.transport.http.QSMethodHandler"/> > <parameter name="qs:method" > value="org.apache.axis.transport.http.QSMethodHandler"/> > <parameter name="qs.wsdl" > value="org.apache.axis.transport.http.QSWSDLHandler"/> > </transport> > <transport name="local"> > <responseFlow> > <handler type="LocalResponder"/> > </responseFlow> > </transport> > > </deployment> > > But the WSDL generated has not restriction over MyEnum. What I'm doing > wrong? Is it possible to use a enum as a parameter?: > > <?xml version="1.0" encoding="UTF-8" ?> > - <wsdl:definitions targetNamespace="wsdl.test" > xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="wsdl.test" > xmlns:intf="wsdl.test" > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:tns1="urn:wsdl.test" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema"> > - <!-- > > WSDL created by Apache Axis version: 1.4 > > Built on Apr 22, 2006 (06:55:48 PDT) > > --> > - <wsdl:types> > - <schema targetNamespace="urn:wsdl.test" > xmlns="http://www.w3.org/2001/XMLSchema"> > <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> > - <simpleType name="role"> > <restriction base="xsd:string" /> > </simpleType> > </schema> > </wsdl:types> > - <wsdl:message name="doUploadResponse"> > <wsdl:part name="doUploadReturn" type="xsd:boolean" /> > </wsdl:message> > - <wsdl:message name="doUploadRequest"> > <wsdl:part name="by" type="tns1:role" /> > <wsdl:part name="userName" type="soapenc:string" /> > <wsdl:part name="contentType" type="soapenc:string" /> > <wsdl:part name="fileName" type="soapenc:string" /> > <wsdl:part name="content" type="soapenc:base64Binary" /> > </wsdl:message> > - <wsdl:portType name="BoxWebService"> > - <wsdl:operation name="doUpload" parameterOrder="by userName contentType > fileName content"> > <wsdl:input message="impl:doUploadRequest" name="doUploadRequest" /> > <wsdl:output message="impl:doUploadResponse" name="doUploadResponse" /> > </wsdl:operation> > </wsdl:portType> > - <wsdl:binding name="DocumentService.wsSoapBinding" > type="impl:BoxWebService"> > <wsdlsoap:binding style="rpc" > transport="http://schemas.xmlsoap.org/soap/http" /> > - <wsdl:operation name="doUpload"> > <wsdlsoap:operation soapAction="" /> > - <wsdl:input name="doUploadRequest"> > <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > namespace="http://webservice.controller.box.modules.eco.spb.com" > use="encoded" /> > </wsdl:input> > - <wsdl:output name="doUploadResponse"> > <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > namespace="wsdl.test" use="encoded" /> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > - <wsdl:service name="BoxWebServiceService"> > - <wsdl:port binding="impl:DocumentService.wsSoapBinding" > name="DocumentService.ws"> > <wsdlsoap:address > location="http://naboo:8080/prototype-miamara/services/DocumentService.ws" > /> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
