Buongiorno a tutti voi.
Ho un problema riguardo l'utilizzo di Cmdbuild - in particolare, riguardo l'utilizzo dei metodi SOAP Web Service.
Leggendo il Webservice.wsdl, ed il "webservice-manual", sono riuscito a utilizzare praticamente tutti i metodi di mio interesse.
Le funzioni SOAP vengono invocate tramite Python, con le classi create da ZSI (wdsl2py).
Il problema su cui sono ancora bloccato riguarda i Lookup - nello specifico, le funzionalità getLookupList e createLookup.
getLookupList:
In accordo al wdsl:
<xs:element name="getLookupList">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" name="type" nillable="false"
type="xs:string" maxOccurs="1" />
<xs:element minOccurs="0" name="value" nillable="true"
type="xs:string" />
<xs:element minOccurs="1" name="parentList" type="xs:boolean"
maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
creo una richiesta di tipo "getLookupList", con in "name" il nome del lookup che voglio selezionare, e per "parentList" il valore xmlschema "false".
Es di richiesta:
<SOAP-ENV:Body xmlns:ns1="http://soap.services.cmdbuild.org"><ns1:getLookupList><ns1:type>ApparatoTipo</ns1:type><ns1:parentList>true</ns1:parentList></ns1:getLookupList></SOAP-ENV:Body>
Mi viene risposto con un errore 500 dal server.
Ho provato con tutte le possibili combinazioni (mettendo all'interno del valore parentList 'true', 'false', '0', '1') ma la situazione non cambia.
Nel "nome" ho indicato il nome del lookup, lo stesso che trovo nell'elenco di "Gestione Lookup".
Qual'è il problema?
createLookup:
In accordo al wdsl:
<xs:element name="createLookupResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" name="return" type="xs:int"
maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="Lookup">
<xs:sequence>
<xs:element minOccurs="0" name="code" nillable="true"
type="xs:string" />
<xs:element minOccurs="0" name="description" nillable="true"
type="xs:string" />
<xs:element minOccurs="0" name="id" type="xs:int" />
<xs:element minOccurs="0" name="notes" nillable="true"
type="xs:string" />
<xs:element minOccurs="0" name="parent" nillable="true"
type="ax22:Lookup" />
<xs:element minOccurs="0" name="parentId" type="xs:int" />
<xs:element minOccurs="0" name="position" type="xs:int" />
<xs:element minOccurs="1" name="type" nillable="false"
type="xs:string" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
Creo la richiesta per inserire un nuovo lookup:
<SOAP-ENV:Body xmlns:ns1="http://soap.services.cmdbuild.org"><ns1:createLookup><lookup><ns1:code>mio</ns1:code><ns1:description>mio</ns1:description><ns1:notes>mio</ns1:notes><ns1:parentId>0</ns1:parentId><ns1:position>0</ns1:position><ns1:type>Gruppo</ns1:type></lookup></ns1:createLookup></SOAP-ENV:Body></SOAP-ENV:Envelope>
Anche qui, ho provato a giocare con i vari campi in tutti i modi...
Ma in ogni caso, il Lookup che mi viene creato in Cmdbuild, ha codice con valore "mio", ma descrizione con valore sempre vuoto.
Anche qui, cosa sto sbagliando?
Ringranziandovi in anticipo per il supporto, vi faccio i miei complimenti per l'ottimo prodotto.