Thanks for reply!

Unfortunately it does not work as expecting.

Send this using SUDS:

<ns1:Params>
    <ns1:Param name="foo1">bar1</ns1:Param>
    <ns1:Param name="foo2">bar2</ns1:Param>
</ns1:Params>

but on server side got this:

<ns0:Params>
    <ns0:Param>bar1</ns0:Param>
    <ns0:Param>bar2</ns0:Param>
</ns0:Params>

My code:

class Params(ComplexModel):
    __namespace__ = APP_NAMESPACE
    Param = Unicode.customize(min_occurs=0, max_occurs='unbounded')
    name = XmlAttribute(Unicode, attribute_of='Param')

and scheme looks not correctly:

<xs:complexType name="Params">
    <xs:sequence>
        <xs:element name="Param" type="xs:string" minOccurs="0"
maxOccurs="unbounded" nillable="true"/>
    </xs:sequence>

    <xs:attribute name="name" type="xs:string"/>
</xs:complexType>

How can I get "param" attributes?

Thanks
Taras

2012/11/21 Ugurcan Ergün <[email protected]>

> We created an XmlAttribute parameter called attribute_of for providing
> primitive type support.
> For example when you want to recieve a mesaage like this
>
> <ns0:some_callResponse xmlns:ns0="tns">
>   <ns0:some_callResult>
>     <ns0:b c="bar">foo</ns0:b>
>   </ns0:some_callResult>
> </ns0:some_callResponse>
>
> A model service pair like that will do the trick
> (This example is taken from the test case of this feature )
>
> class a(ComplexModel):
>     b = Unicode
>     c = XmlAttribute(Unicode, ns="spam", attribute_of="b")
>
> class SomeService(ServiceBase):
>     @srpc(_returns=a)
>     def some_call():
>         return a(b="foo",c="bar")
>
> For source code of this feature you can see
> https://github.com/arskom/spyne/pull/161
>
>
> 2012/11/20 KulaPard <[email protected]>
>
>> Hello
>> Can you please help me?
>>
>> I need to realise this part of web-service:
>> ----------------------------------------
>> <xs:element name="Params" minOccurs="0">
>>     <xs:complexType>
>>         <xs:sequence>
>>             <xs:element maxOccurs="unbounded" minOccurs="0" name="Param">
>>                 <xs:complexType>
>>                     <xs:simpleContent>
>>                         <xs:extension base="xs:string">
>>                             <xs:attribute name="name" type="xs:string"/>
>>                         </xs:extension>
>>                     </xs:simpleContent>
>>                 </xs:complexType>
>>             </xs:element>
>>         </xs:sequence>
>>     </xs:complexType>
>> </xs:element>
>> ----------------------------------------
>> to recieve message like this:
>> ----------------------------------------
>> <ns1:Params>
>>     <ns1:Param ns1:name="firstname">Blabla</ns1:Param>
>>     <ns1:Param ns1:name="lastname">Blabovich</ns1:Param>
>>     <ns1:Param ns1:name="age">20</ns1:Param>
>> </ns1:Params>
>> ----------------------------------------
>> I tried to use Spyne with XmlAttribute, but it do not support primitive
>> types yet.
>> Any ideas how to realise this functionality? Maybe you can advise me
>> other libraries?
>> Maybe some hacks or tricks with Spyne?
>>
>> Sorry for bad english :)
>> Taras
>>
>> _______________________________________________
>> Soap mailing list
>> [email protected]
>> http://mail.python.org/mailman/listinfo/soap
>>
>>
>
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to