[Fedora-suds-list] namespace, schema and encoding style

Elena Bernardi elena at evectors.it
Tue Jul 28 16:32:03 UTC 2009


Hi everyone,
I have to call richiestaIscrizioneServizio method of a web service.
One parameter of richiestaIscrizioneServizio method is  
listaAttributiUtente, that is an array of custom object.

The server is AXIS.

I would like to generate this part of message with suds:

< listaAttributiUtente SOAP-ENC:arrayType="ns1: AttributoUtenteWs[1]"  
xsi:type="SOAP-ENC:Array">
	<item xsi:type="ns1:AttributoUtenteWs">
		<valoriAttributoUtente SOAP-ENC:arrayType="xsd:string[1]" 	 
xsi:type="SOAP-ENC:Array">
			<item xsi:type="xsd:string">testE3</item>
		</valoriAttributoUtente>
		<idAttributo xsi:type="xsd:string">username</idAttributo>
	</item>
</listaAttributiUtente>

ns1 is: xmlns:ns1="urn:RegisterWebService"

Anyone can help me, please ?

I don't understand how I can set the encoding style, I can specify the  
prefix or the schema and the type but not the encoding style ...
I am not able to generate:
< listaAttributiUtente SOAP-ENC:arrayType="ns1: AttributoUtenteWs[1]"  
xsi:type="SOAP-ENC:Array">

This is my python code:
atts = self.client.factory.create('ArrayOf_xsd_anyType')

  attributoUtente1 = self.client.factory.create('ns3:AttributoUtenteWs')
  attributoUtente1.idAttributo = 'attributo_36'
  attributoUtente1.valoriAttributoUtente =  
self.client.factory.create('ArrayOf_xsd_string')
  attributoUtente1.valoriAttributoUtente.item = ['','']

  atts.item = [attributoUtente1]

But this code generate this:

  <listaAttributiUtente xsi:type="ns0:ArrayOf_xsd_anyType">
             <item xsi:type="ns3:AttributoUtenteWs">
                <idAttributo xsi:type="ns1:string">attributo_36</ 
idAttributo>
                <valoriAttributoUtente  
xsi:type="ns0:ArrayOf_xsd_string">
                   <item xsi:type="ns1:string"></item>
                   <item xsi:type="ns1:string"></item>
                </valoriAttributoUtente>
             </item>
</listaAttributiUtente>

Here  the WSDL MESSAGE definition:

<wsdl:message name="richiestaIscrizioneServizioRequest">
	<wsdl:part name="cdArea" type="xsd:string"/>
	<wsdl:part name="cdApplicazione" type="xsd:string"/>
	<wsdl:part name="cdServizio" type="xsd:string"/>
	<wsdl:part name="language" type="xsd:string"/>
	<wsdl:part name="country" type="xsd:string"/>
	<wsdl:part name="listaAttributiUtente"  
type="impl:ArrayOf_xsd_anyType"/>
	<wsdl:part name="urlConfermaEmail" type="xsd:string"/>
	<wsdl:part name="avvisoSeUtenteDaMigrare" type="xsd:boolean"/>
	<wsdl:part name="idUtenteMigrazione" type="xsd:long"/>
</wsdl:message>

Here the WSDL TYPES:

<schema targetNamespace="urn:RegisterWebService">
	<import namespace="http://xml.apache.org/xml-soap"/>
	<import namespace="http://custom.service.it/services/urn:RegisterWebService 
"/>
	<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>

	<complexType name="AttributoUtenteWs">
		<sequence>
			<element name="idAttributo" nillable="true" type="xsd:string"/>
			<element name="valoriAttributoUtente" nillable="true"  
type="impl:ArrayOf_xsd_string"/>
		</sequence>
	</complexType>
</schema>

<schema targetNamespace="http://custom.service.it/services/urn:RegisterWebService 
">
	<import namespace="http://xml.apache.org/xml-soap"/>
	<import namespace="urn:RegisterWebService"/>
	<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
	
	<complexType name="ArrayOf_xsd_string">
		<complexContent>
			<restriction base="soapenc:Array">
				<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
			</restriction>
		</complexContent>
	</complexType>

	<complexType name="ArrayOf_xsd_anyType">
	<complexContent>
		<restriction base="soapenc:Array">
			<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[]"/>
		</restriction>
	</complexContent>
	</complexType>

Thanks very much in advance.

Elena
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-suds-list/attachments/20090728/880f89d6/attachment.htm>


More information about the fedora-suds-list mailing list