Ciao a tutti, volevo chiedervi gentilmente se qualcuno può aiutarmi nel risolvere un problemino che ormai da qualche giorno mi rende inquieto.
Sto lavorando per la mia tesi con AXIS2. Nell'ambito della scrittura del file WSDL ho la necessità di definire un complexType Array che viene ritornato al client in seguito all'invocazione del servizio.
La definizione del complexType è la seguente:
<complexType name="ArrayOfString">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="string[]"/>
</restriction>
</complexContent>
</complexType>
Altro frammento del WSDL in cui ArrayOfString viene richiamato è:
<xs:element name="getDataResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" nillable="true"
type="xs:ArrayOfString"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Altre parti dello schema WSDL coinvolte sono:
<wsdl:definitions
xmlns:axis2="http://EmsService.test/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:ns="http://EmsService.test/xsd"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://EmsService.test/">
ed ancora:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://EmsService.test/xsd"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding">
Il mio problema sta nel fatto che compilando mi viene fuori questo errore:
java.lang.RuntimeException: Cannot unwrap element {http://EmsService.test/xsd}getDataResponse: no abstract mapping definition found for type {http://www.w3.org/2001/XMLSchema}ArrayOfString (used by element {http://EmsService.test/xsd}return)
Il mio sospetto è che non essendo l'array un tipo di dato standard, potrebbe non esser definito in xs="http://www.w3.org/2001/XMLSchema". Per cui suppongo che si dovrebbe definire magari: xxx:"http://......." in cui viene definito l'array. Come fare questo usando axis in localhost?
Qualcuno può aiutarmi?
Vi ringrazio!!!Ciao

Rispondi quotando

