[Fedora-suds-list] Empty string instead of xsi:nil in request

Jeff Ortel jortel at redhat.com
Mon Aug 17 22:25:54 UTC 2009


Hey Piotr :)  See below:

On 08/17/2009 08:06 AM, Piotr Szrajber wrote:
> Hello,
>
> I am trying to invoke a php webservice method which expects one of the
> parameters (for brevity let's call it just "parameter1") as either
> string or null. Unfortunately, when I invoke it in SUDS client, either
> with passing it explicitly as None or when ignoring it:
>
> <pre>
> service.method(parameter0, parameter1=None)
> service.method(parameter0),
> </pre>
>
> I see in debug information that SUDS is sending empty string instead of
> xsi:nil:
>
> <pre>
> <SOAP-ENV:Body>
> <ns0:method>
> <parameter0 xsi:type="ns1:integer">325</parameter0>
> <parameter1 xsi:type="ns1:string"/>
> </ns0:method>
> </SOAP-ENV:Body>
> </pre>
>
> How can I deal with that?

Suds should set the xsi:nil="true" when the schema defines that element as nillable.  Does 
the schema do that?

>
> If it's service provider fault, can I somewhat manually filter the
> request to replace "<parameter1 xsi:type="ns1:string"/>" with
> "<parameter1 xsi:nil="true"/>"?

In any case, suds currently doesn't provide a way to "doctor up" the message but probably 
should do something like the schema doctor.  Let me see what I can do.

>
> Kind Regards,
> Piotr Szrajber
>
> _______________________________________________
> fedora-suds-list mailing list
> fedora-suds-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-suds-list

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3360 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.fedoraproject.org/pipermail/suds/attachments/20090817/fb9a436b/attachment.bin 


More information about the suds mailing list