Axis and complex types

Hi

I'm trying to develop a webservice using apache axis. I started by writting the java interface and then used the Java2WSDL tool to generate the WSDL file.

However my service uses a complex type (basically an array of simple objects) which is not correctly represented in the generated WSDL. This is the generated wsdl snippet:

<wsdl:types>

<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://somenamespace">

<import namespace="http://somenamespace"/>

<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>

<complexType name="MySimpleObject">

<sequence/>

</complexType>

</schema>

<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://somenamespace">

<import namespace="http://somenamespace"/>

<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>

<complexType name="ArrayOf_tns2_MySimpleObject">

<complexContent>

<restriction base="soapenc:Array">

<attribute ref="soapenc:arrayType" wsdl:arrayType="tns2:MySimpleObject[]"/>

</restriction>

</complexContent>

</complexType>

</schema>

</wsdl:types>

Shouldn't the first ComplexType tag contain the definition of my object? Am I supposed to edit the file manually and add the information? Shouldn't Axis generate the correct definition?

Thanks in advance!

Pedro

[2006 byte] By [pedroesa] at [2007-9-25]
# 1

Hi,

I recommend you to use gSOAP if you are trying to implement a client in C/C++/.NET, it's powerful. http://www.cs.fsu.edu/~engelen/soap.html

Axis have a lot of problems representing java Objects.

if your client will be implemented in Java, use ws-compile and ws-deploy, check JWSDP doc,

palereitora at 2007-7-15 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 2

lo olvidaba,

Try not to Use the java Object, its better you define exactly an specific object (String, Integer, etc) in the case you use a java Map, for example, implement your own class to represent it,

Java:

HashMap<Object,Object>

implement your own HashMap

Kmap<String,String>

palereitora at 2007-7-15 > top of java,Enterprise & Remote Computing,Enterprise Technologies...