[Soap-Python] Customizing rpclib with types that modify the schema

Burak Arslan burak.arslan at arskom.com.tr
Wed Apr 4 10:20:40 CEST 2012


On 04/03/12 17:51, Burak Arslan wrote:
> hi alex,
>
> here's a test case for us to work on:
>
> https://gist.github.com/2292401
>
> seems to be working with my latest patch (which fixed some other 
> problem) could you try to reproduce your issue using that one?
>
> best,
> burak
>
>
> On 04/03/12 13:41, Alex wrote:
>> Burak, thank you for the feedback.
>>
>>
>>>> I skimmed the spec very quick and from what I gather, you want an<any>
>>>> tag instead of an<element>  tag inside the<complexType><sequence>  
>>>> (...)
>>>> </complexType></sequence>  hierarchy, right? (correct me if i'm 
>>>> wrong here.)
>> Yes.
>>
>>
>> It took me some time to "begin to begin to get started", because I
>> wasn't familiar with git. After dealing with that, I set up a
>> development environment that would allow me to tinker with the code
>> you provided.
>>
>>
>> For now, I just want to deal with one piece of the puzzle - produce
>> the schema that looks exactly like the spec says.
>>
>> This is what I do (based on the example from your last email):
>>
>> class SomeType(ComplexModel):
>>     arbitraryElement = AnyXml(
>>                      schema_tag='{%s}any' % rpclib.const.xml_ns.xsd,
>>                      namespace='##other',
>>                      process_contents='lax')
>>
>>
>> This is what I get:
>>
>> <xs:complexType name="SomeType">
>> <xs:sequence>
>> <xs:element name="arbitraryElement" type="xs:anyType"
>> minOccurs="0" nillable="true" />
>> </xs:sequence>
>> </xs:complexType>
>>
>>
>> What I expected:
>>
>> <xs:complexType name="SomeType">
>> <xs:sequence>
>> <xs:any namespace="##other" processContents="lax" />
>> </xs:sequence>
>> </xs:complexType>
>>
>>
>>
>> Having examined the diff, I saw that it was supposed to work, at least
>> partially. This is based on the fact that
>> \interface\xml_schema\model\complex.py does verify whether the type is
>> AnyXml, and it attempts to set processContents, if it is present in
>> the declaration.
>>
>> I set a breakpoint in the beginning of complex_add, but the breakpoint
>> is never hit. For some reason, the function is never called, thus the
>> schema is generated in a regular fashion.
>>
>>
>> There are no calls to complex_add anywhere in the code, but the
>> function is set as a handler for ComplexModelBase.
>>
>> As you can see in the definition above, SomeType is derived from
>> ComplexModel, which is derived from ComplexModelBase. I cannot make
>> sense of it, everything looks right, but not quite. This is where I
>> got stuck.
>>
>>
>> Can you shed some light on this?
>>
>>
>>
>>
>> I created a new RST file that reflects what I know so far. There's not
>> much content yet, just two paragraphs :-) Questions related to this
>> part:
>> 1. what's the most appropriate name for this section? I chose
>> "Creating advanced custom types", but this tutorial is XML-centric, so
>> that should be reflected somewhere.
>> 2. should this be a new file, or should I extend an existing one 
>> [which one]?
>> 3. are there any parts in the manual one should read before trying to
>> write such patches? I've read everything that seems to be related, but
>> my vision is still blurry. Maybe I missed something?
>>
>>
>> Alex
>



More information about the Soap mailing list