From tomvons at gmail.com Tue May 5 21:17:31 2009 From: tomvons at gmail.com (Tom von Schwerdtner) Date: Tue, 5 May 2009 17:17:31 -0400 Subject: [Fedora-suds-list] list (apparently) being sent as '[]' instead of [] Message-ID: <29C9130D-CA82-49C4-9180-D03AE218C03B@gmail.com> Greetings folks, I'm trying to figure out whose fault this is and would appreciate some input. In short, I have a service call that takes a FilterRules type as an argument (pulled from the client factory), which is configured as follows: >>> print filter (FilterRules){ marketClassIds[] = vehicleTypes[] = } The spec for this service says that marketClassIds should be an array of integers, however when I assign it to an array as follows: >>> filter.marketClassIds = [1, 2] >>> print filter (FilterRules){ marketClassIds[] = 1, 2, vehicleTypes[] = } and I submit it, I get the following error: suds.WebFault: Server raised fault: 'JAXRPC.TIE.01: caught exception while handling request: deserialization error: java.lang.NumberFormatException: For input string: "[1, 2]"' FWIW, I have seen (but not executed, yet) PHP code for the service that simply assigns an empty array to marketClassIds, doing so with python results in a similar input string error. So it seems the server is interpreting the marketClassIds as the __str__ of the array, and not as an actual array. If I set marketClassIds to a non-array integer, eg: filter.marketClassIds = 1 It works. So, my question is, am I doing something wrong, is suds doing something wrong, or is the server I'm hitting doing something wrong? Any tips on further debugging this? I'd love to provide working samples but unfortunately this is a proprietary service. I can give more information if needed, I'm not too familiar with SOAP so I wasn't sure what to provide. Regards, Tom From jortel at redhat.com Tue May 5 21:22:51 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 05 May 2009 17:22:51 -0400 Subject: [Fedora-suds-list] list (apparently) being sent as '[]' instead of [] In-Reply-To: <29C9130D-CA82-49C4-9180-D03AE218C03B@gmail.com> References: <29C9130D-CA82-49C4-9180-D03AE218C03B@gmail.com> Message-ID: <4A00AE2B.9090306@redhat.com> Hey Tom, I believe this is fixed on trunk (0.3.6 beta). Regards, Jeff Tom von Schwerdtner wrote: > Greetings folks, I'm trying to figure out whose fault this is and would > appreciate some input. > > In short, I have a service call that takes a FilterRules type as an > argument (pulled from the client factory), which is configured as follows: > > >>> print filter > > (FilterRules){ > marketClassIds[] = > vehicleTypes[] = > } > > > The spec for this service says that marketClassIds should be an array of > integers, however when I assign it to an array as follows: > > >>> filter.marketClassIds = [1, 2] > >>> print filter > > (FilterRules){ > marketClassIds[] = > 1, > 2, > vehicleTypes[] = > } > > and I submit it, I get the following error: > > suds.WebFault: Server raised fault: 'JAXRPC.TIE.01: caught exception > while handling request: deserialization error: > java.lang.NumberFormatException: For input string: "[1, 2]"' > > FWIW, I have seen (but not executed, yet) PHP code for the service that > simply assigns an empty array to marketClassIds, doing so with python > results in a similar input string error. > > So it seems the server is interpreting the marketClassIds as the __str__ > of the array, and not as an actual array. If I set marketClassIds to a > non-array integer, eg: > > filter.marketClassIds = 1 > > It works. > > So, my question is, am I doing something wrong, is suds doing something > wrong, or is the server I'm hitting doing something wrong? Any tips on > further debugging this? I'd love to provide working samples but > unfortunately this is a proprietary service. > > I can give more information if needed, I'm not too familiar with SOAP so > I wasn't sure what to provide. > > Regards, > Tom > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list From tomvons at gmail.com Tue May 5 21:28:25 2009 From: tomvons at gmail.com (Tom von Schwerdtner) Date: Tue, 5 May 2009 17:28:25 -0400 Subject: [Fedora-suds-list] list (apparently) being sent as '[]' instead of [] In-Reply-To: <4A00AE2B.9090306@redhat.com> References: <29C9130D-CA82-49C4-9180-D03AE218C03B@gmail.com> <4A00AE2B.9090306@redhat.com> Message-ID: Yup, works from trunk! Thanks, Tom On May 5, 2009, at 5:22 PM, Jeff Ortel wrote: > Hey Tom, > > I believe this is fixed on trunk (0.3.6 beta). > > Regards, > > Jeff > > Tom von Schwerdtner wrote: >> Greetings folks, I'm trying to figure out whose fault this is and >> would appreciate some input. >> In short, I have a service call that takes a FilterRules type as >> an argument (pulled from the client factory), which is configured >> as follows: >> >>> print filter >> (FilterRules){ >> marketClassIds[] = >> vehicleTypes[] = >> } >> The spec for this service says that marketClassIds should be an >> array of integers, however when I assign it to an array as follows: >> >>> filter.marketClassIds = [1, 2] >> >>> print filter >> (FilterRules){ >> marketClassIds[] = >> 1, >> 2, >> vehicleTypes[] = >> } >> and I submit it, I get the following error: >> suds.WebFault: Server raised fault: 'JAXRPC.TIE.01: caught >> exception while handling request: deserialization error: >> java.lang.NumberFormatException: For input string: "[1, 2]"' >> FWIW, I have seen (but not executed, yet) PHP code for the service >> that simply assigns an empty array to marketClassIds, doing so >> with python results in a similar input string error. >> So it seems the server is interpreting the marketClassIds as the >> __str__ of the array, and not as an actual array. If I set >> marketClassIds to a non-array integer, eg: >> filter.marketClassIds = 1 >> It works. >> So, my question is, am I doing something wrong, is suds doing >> something wrong, or is the server I'm hitting doing something >> wrong? Any tips on further debugging this? I'd love to provide >> working samples but unfortunately this is a proprietary service. >> I can give more information if needed, I'm not too familiar with >> SOAP so I wasn't sure what to provide. >> Regards, >> Tom >> _______________________________________________ >> fedora-suds-list mailing list >> fedora-suds-list at redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-suds-list From straycat000 at yahoo.com Tue May 12 06:05:51 2009 From: straycat000 at yahoo.com (Matthew) Date: Mon, 11 May 2009 23:05:51 -0700 (PDT) Subject: [Fedora-suds-list] help with mlb.com wsdl's again Message-ID: <741777.29253.qm@web30201.mail.mud.yahoo.com> Hi guys, Looks like mlb.com's wsdl's are a little iffy once again. Last time it was their MediaService.wsdl. This time I'd like to use their IdentityPointService.wsdl to perform authentication. The wsdl in question is here: http://www.mlb.com/flash/mediaplayer/v4/wsdl/IdentityPointService.wsdl and it's xsd here: http://www.mlb.com/flash/mediaplayer/v4/wsdl/IdentityPointService.xsd Here's the code I'm trying: import sys import logging logging.basicConfig(level=logging.INFO) import suds from suds.client import Client from suds.xsd.sxbasic import Import logging.getLogger('suds.client').setLevel(logging.DEBUG) url = 'file:///home/matthew/mlb-2009/sudsy/IdentityPointService.wsdl' client = Client(url) And the error I get: >>> client = Client(url) Traceback (most recent call last): File "", line 1, in ? File "build/bdist.linux-i686/egg/suds/client.py", line 109, in __init__ File "build/bdist.linux-i686/egg/suds/servicedefinition.py", line 52, in __init__ File "build/bdist.linux-i686/egg/suds/servicedefinition.py", line 132, in paramtypes File "build/bdist.linux-i686/egg/suds/xsd/sxbasic.py", line 156, in resolve suds.TypeNotFound: Type not found: '(identityPoint, http://services.bamnetworks.com/registration/types/1.4, )' I don't have any control over their WSDL/XSD so if you guys can tell me what lines need to change, I will use local copies of these files using file:// url's to make requests. Thanks, Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: From jortel at redhat.com Tue May 12 13:32:26 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 12 May 2009 09:32:26 -0400 Subject: [Fedora-suds-list] help with mlb.com wsdl's again In-Reply-To: <741777.29253.qm@web30201.mail.mud.yahoo.com> References: <741777.29253.qm@web30201.mail.mud.yahoo.com> Message-ID: <4A097A6A.4090205@redhat.com> Matthew, I see two problems here. 1) The wsdl is broken because by definition, xs:import is used to import schema with a different namespace. They are the same here so they should have used xs:include. 2) Suds implementation of xs:include is broken. I'll fix and get back with you. Depending on how I fix this, you may be able to use the wsdl as is (without changing the xs:import to xs:include). But, no guarantees. Regards, Jeff Matthew wrote: > Hi guys, > > Looks like mlb.com's wsdl's are a little iffy once again. Last time it > was their MediaService.wsdl. This time I'd like to use their > IdentityPointService.wsdl to perform authentication. > > The wsdl in question is here: > http://www.mlb.com/flash/mediaplayer/v4/wsdl/IdentityPointService.wsdl > > and it's xsd here: > http://www.mlb.com/flash/mediaplayer/v4/wsdl/IdentityPointService.xsd > > Here's the code I'm trying: > import sys > import logging > logging.basicConfig(level=logging.INFO) > > import suds > from suds.client import Client > from suds.xsd.sxbasic import Import > > logging.getLogger('suds.client').setLevel(logging.DEBUG) > > url = 'file:///home/matthew/mlb-2009/sudsy/IdentityPointService.wsdl' > > client = Client(url) > > And the error I get: > > >>> client = Client(url) > Traceback (most recent call last): > File "", line 1, in ? > File "build/bdist.linux-i686/egg/suds/client.py", line 109, in __init__ > File "build/bdist.linux-i686/egg/suds/servicedefinition.py", line 52, > in __init__ > File "build/bdist.linux-i686/egg/suds/servicedefinition.py", line 132, > in paramtypes > File "build/bdist.linux-i686/egg/suds/xsd/sxbasic.py", line 156, in > resolve > suds.TypeNotFound: Type not found: '(identityPoint, > http://services.bamnetworks.com/registration/types/1.4, )' > > I don't have any control over their WSDL/XSD so if you guys can tell me > what lines need to change, I will use local copies of these files using > file:// url's to make requests. > > Thanks, > Matthew > > > ------------------------------------------------------------------------ > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list From tomvons at gmail.com Tue May 12 19:58:39 2009 From: tomvons at gmail.com (Tom von Schwerdtner) Date: Tue, 12 May 2009 19:58:39 +0000 Subject: [Fedora-suds-list] Ticket #64: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )' Message-ID: <1637530faefb15d485276095b649d5fe@mail.civicit.com> Does anyone know of a work-around for this, or have ideas on how to solve it? Also, how do I get an account in the Trac site to get on the CC list for this bug? Thanks, Tom From tomvons at gmail.com Tue May 12 20:16:02 2009 From: tomvons at gmail.com (Tom von Schwerdtner) Date: Tue, 12 May 2009 20:16:02 +0000 Subject: [Fedora-suds-list] Ticket #64: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )' In-Reply-To: <1637530faefb15d485276095b649d5fe@mail.civicit.com> References: <1637530faefb15d485276095b649d5fe@mail.civicit.com> Message-ID: <523604421959d8e2c5b3a78a8ba17fee@mail.civicit.com> Actually my real problem may be #8 (https://fedorahosted.org/suds/ticket/8) since the service I'm calling seems to use ref="s:schema", or at least that's my current theory. The xml in question is here: http://civicit.com/~tvon/problematic-wsdl.xml I could use any advice on working around this or ideas on implementing the required changes in suds (I'm a handy Pythoner, but not at all familiar with suds or xml processing) as I'm on a bit of a deadline and need to get this worked out. -Tom On Tue, 12 May 2009 19:58:39 +0000, Tom von Schwerdtner wrote: > Does anyone know of a work-around for this, or have ideas on how to solve > it? > > Also, how do I get an account in the Trac site to get on the CC list for > this bug? > > Thanks, > Tom > > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list From jortel at redhat.com Tue May 12 22:04:37 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 12 May 2009 18:04:37 -0400 Subject: [Fedora-suds-list] Ticket #64: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )' In-Reply-To: <1637530faefb15d485276095b649d5fe@mail.civicit.com> References: <1637530faefb15d485276095b649d5fe@mail.civicit.com> Message-ID: <4A09F275.5060506@redhat.com> Tom von Schwerdtner wrote: > Does anyone know of a work-around for this, or have ideas on how to solve > it? Looks like ticket #8 & #64 are the same problem. I'll take a look at this and get back with you tomorrow. > > Also, how do I get an account in the Trac site to get on the CC list for > this bug? https://admin.fedoraproject.org/accounts/user/new > > Thanks, > Tom > > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list From jortel at redhat.com Wed May 13 15:58:59 2009 From: jortel at redhat.com (Jeff Ortel) Date: Wed, 13 May 2009 11:58:59 -0400 Subject: [Fedora-suds-list] Ticket #64: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )' In-Reply-To: <523604421959d8e2c5b3a78a8ba17fee@mail.civicit.com> References: <1637530faefb15d485276095b649d5fe@mail.civicit.com> <523604421959d8e2c5b3a78a8ba17fee@mail.civicit.com> Message-ID: <4A0AEE43.7090807@redhat.com> Tom, I'm assuming that the @ref="s:schema" is referencing the element in the schema for XSD itself (http://www.w3.org/2001/XMLSchema.xsd) and that the content of the referencing element is XSD content. The best workaround at the moment is to add: To the schema contained in the wsdl. This is missing which causes the schema to be broken. I committed a patch to: - Statically bind the schemaLocation for the http://www.w3.org/2001/XMLSchema namespace. - Update the sax parser so it will not follow the bogus DTD reference in XSD schema. So, you'll need r507+ or the latest 0.3.6 beta release. Does this work for you? I have started working on a schema /Doctor/ class that will fix broken schemas like this one and others I've come across. But it will probably be a few weeks getting into the code base. The Doctor will be extensible so users can plug in additional fixes. Regards, Jeff Tom von Schwerdtner wrote: > Actually my real problem may be #8 (https://fedorahosted.org/suds/ticket/8) > since the service I'm calling seems to use ref="s:schema", or at least > that's my current theory. The xml in question is here: > http://civicit.com/~tvon/problematic-wsdl.xml > > I could use any advice on working around this or ideas on implementing the > required changes in suds (I'm a handy Pythoner, but not at all familiar > with suds or xml processing) as I'm on a bit of a deadline and need to get > this worked out. > > -Tom > > On Tue, 12 May 2009 19:58:39 +0000, Tom von Schwerdtner > wrote: >> Does anyone know of a work-around for this, or have ideas on how to solve >> it? >> >> Also, how do I get an account in the Trac site to get on the CC list for >> this bug? >> >> Thanks, >> Tom >> >> >> _______________________________________________ >> fedora-suds-list mailing list >> fedora-suds-list at redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-suds-list > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list From zxvdr.au at gmail.com Wed May 13 19:41:59 2009 From: zxvdr.au at gmail.com (David Robinson) Date: Wed, 13 May 2009 20:41:59 +0100 Subject: [Fedora-suds-list] Ticket #64: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )' In-Reply-To: <4A0AEE43.7090807@redhat.com> References: <1637530faefb15d485276095b649d5fe@mail.civicit.com> <523604421959d8e2c5b3a78a8ba17fee@mail.civicit.com> <4A0AEE43.7090807@redhat.com> Message-ID: Hi Jeff, fwiw, modifying the wsdl in the way you suggested appears to have fixed the problem I was having (the wsdl and sample code were in ticket #64). I made the change below to the wsdl, and it now no longer throws the TypeNotFound exception (using r507, however 0.3.5 also works after modifying the wsdl). --- NSConfig.wsdl.orig 2009-01-12 22:32:37.000000000 +0000 +++ NSConfig.wsdl 2009-05-13 19:58:54.000000000 +0100 @@ -4,6 +4,7 @@ + The doctor class sounds promising :-) --Dave On Wed, May 13, 2009 at 4:58 PM, Jeff Ortel wrote: > Tom, > > I'm assuming that the @ref="s:schema" is referencing the element > in the schema for XSD itself (http://www.w3.org/2001/XMLSchema.xsd) and that > the content of the referencing element is XSD content. > > The best workaround at the moment is to add: > ? > To the schema contained in the wsdl. This is missing which causes the schema > to be broken. > > I committed a patch to: > ?- Statically bind the schemaLocation for the > http://www.w3.org/2001/XMLSchema namespace. > ?- Update the sax parser so it will not follow the bogus DTD reference in > XSD schema. > > So, you'll need r507+ or the latest 0.3.6 beta release. > > Does this work for you? > > I have started working on a schema /Doctor/ class that will fix broken > schemas like this one and others I've come across. ?But it will probably be > a few ?weeks getting into the code base. ?The Doctor will be extensible so > users can plug in additional fixes. > > Regards, > > Jeff > > Tom von Schwerdtner wrote: >> >> Actually my real problem may be #8 >> (https://fedorahosted.org/suds/ticket/8) >> since the service I'm calling seems to use ref="s:schema", or at least >> that's my current theory. ?The xml in question is here: >> http://civicit.com/~tvon/problematic-wsdl.xml >> >> I could use any advice on working around this or ideas on implementing the >> required changes in suds (I'm a handy Pythoner, but not at all familiar >> with suds or xml processing) as I'm on a bit of a deadline and need to get >> this worked out. >> >> -Tom >> >> On Tue, 12 May 2009 19:58:39 +0000, Tom von Schwerdtner >> >> wrote: >>> >>> Does anyone know of a work-around for this, or have ideas on how to solve >>> it? >>> >>> Also, how do I get an account in the Trac site to get on the CC list for >>> this bug? >>> >>> Thanks, >>> Tom >>> >>> >>> _______________________________________________ >>> fedora-suds-list mailing list >>> fedora-suds-list at redhat.com >>> https://www.redhat.com/mailman/listinfo/fedora-suds-list >> >> _______________________________________________ >> fedora-suds-list mailing list >> fedora-suds-list at redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-suds-list > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list > From zxvdr.au at gmail.com Wed May 13 19:41:49 2009 From: zxvdr.au at gmail.com (David Robinson) Date: Wed, 13 May 2009 20:41:49 +0100 Subject: [Fedora-suds-list] Ticket #64: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )' In-Reply-To: <4A0AEE43.7090807@redhat.com> References: <1637530faefb15d485276095b649d5fe@mail.civicit.com> <523604421959d8e2c5b3a78a8ba17fee@mail.civicit.com> <4A0AEE43.7090807@redhat.com> Message-ID: Hi Jeff, fwiw, modifying the wsdl in the way you suggested appears to have fixed the problem I was having (the wsdl and sample code were in ticket #64). I made the change below to the wsdl, and it now no longer throws the TypeNotFound exception (using r507, however 0.3.5 also works after modifying the wsdl). --- NSConfig.wsdl.orig 2009-01-12 22:32:37.000000000 +0000 +++ NSConfig.wsdl 2009-05-13 19:58:54.000000000 +0100 @@ -4,6 +4,7 @@ + The doctor class sounds promising :-) --Dave On Wed, May 13, 2009 at 4:58 PM, Jeff Ortel wrote: > Tom, > > I'm assuming that the @ref="s:schema" is referencing the element > in the schema for XSD itself (http://www.w3.org/2001/XMLSchema.xsd) and that > the content of the referencing element is XSD content. > > The best workaround at the moment is to add: > ? > To the schema contained in the wsdl. This is missing which causes the schema > to be broken. > > I committed a patch to: > ?- Statically bind the schemaLocation for the > http://www.w3.org/2001/XMLSchema namespace. > ?- Update the sax parser so it will not follow the bogus DTD reference in > XSD schema. > > So, you'll need r507+ or the latest 0.3.6 beta release. > > Does this work for you? > > I have started working on a schema /Doctor/ class that will fix broken > schemas like this one and others I've come across. ?But it will probably be > a few ?weeks getting into the code base. ?The Doctor will be extensible so > users can plug in additional fixes. > > Regards, > > Jeff > > Tom von Schwerdtner wrote: >> >> Actually my real problem may be #8 >> (https://fedorahosted.org/suds/ticket/8) >> since the service I'm calling seems to use ref="s:schema", or at least >> that's my current theory. ?The xml in question is here: >> http://civicit.com/~tvon/problematic-wsdl.xml >> >> I could use any advice on working around this or ideas on implementing the >> required changes in suds (I'm a handy Pythoner, but not at all familiar >> with suds or xml processing) as I'm on a bit of a deadline and need to get >> this worked out. >> >> -Tom >> >> On Tue, 12 May 2009 19:58:39 +0000, Tom von Schwerdtner >> >> wrote: >>> >>> Does anyone know of a work-around for this, or have ideas on how to solve >>> it? >>> >>> Also, how do I get an account in the Trac site to get on the CC list for >>> this bug? >>> >>> Thanks, >>> Tom >>> >>> >>> _______________________________________________ >>> fedora-suds-list mailing list >>> fedora-suds-list at redhat.com >>> https://www.redhat.com/mailman/listinfo/fedora-suds-list >> >> _______________________________________________ >> fedora-suds-list mailing list >> fedora-suds-list at redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-suds-list > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list > From tomvons at gmail.com Wed May 13 22:29:40 2009 From: tomvons at gmail.com (Tom von Schwerdtner) Date: Wed, 13 May 2009 18:29:40 -0400 Subject: [Fedora-suds-list] Ticket #64: Type not found: '(schema, http://www.w3.org/2001/XMLSchema, )' In-Reply-To: <4A0AEE43.7090807@redhat.com> References: <1637530faefb15d485276095b649d5fe@mail.civicit.com> <523604421959d8e2c5b3a78a8ba17fee@mail.civicit.com> <4A0AEE43.7090807@redhat.com> Message-ID: <90158E52-8C5F-4FE4-9D76-B1183B361FB7@gmail.com> On May 13, 2009, at 11:58 AM, Jeff Ortel wrote: > > I'm assuming that the @ref="s:schema" is referencing the > element in the schema for XSD itself (http://www.w3.org/2001/XMLSchema.xsd > ) and that the content of the referencing element is XSD content. > > The best workaround at the moment is to add: > > To the schema contained in the wsdl. This is missing which causes > the schema to be broken. Unfortunately I'm using a 3rd party web service and can't alter what they send me. > I committed a patch to: > - Statically bind the schemaLocation for the http://www.w3.org/2001/XMLSchema > namespace. > - Update the sax parser so it will not follow the bogus DTD > reference in XSD schema. > > So, you'll need r507+ or the latest 0.3.6 beta release. > > Does this work for you? I did try adding that line to my sample file (http://civicit.com/~tvon/test-wsdl.xml ) and I still got the same error (with updated suds from trunk) > I have started working on a schema /Doctor/ class that will fix > broken schemas like this one and others I've come across. But it > will probably be a few weeks getting into the code base. The > Doctor will be extensible so users can plug in additional fixes. Good to know, I'll look forward to that. I'll have to use something else in the meantime, any suggestions? I only need a client, and soaplib looks fairly painful... and I'm not sure about ZSI... Thanks, Tom > Tom von Schwerdtner wrote: >> Actually my real problem may be #8 (https://fedorahosted.org/suds/ticket/8 >> ) >> since the service I'm calling seems to use ref="s:schema", or at >> least >> that's my current theory. The xml in question is here: >> http://civicit.com/~tvon/problematic-wsdl.xml >> I could use any advice on working around this or ideas on >> implementing the >> required changes in suds (I'm a handy Pythoner, but not at all >> familiar >> with suds or xml processing) as I'm on a bit of a deadline and need >> to get >> this worked out. >> -Tom >> On Tue, 12 May 2009 19:58:39 +0000, Tom von Schwerdtner > > >> wrote: >>> Does anyone know of a work-around for this, or have ideas on how >>> to solve >>> it? >>> >>> Also, how do I get an account in the Trac site to get on the CC >>> list for >>> this bug? >>> >>> Thanks, >>> Tom >>> >>> >>> _______________________________________________ >>> fedora-suds-list mailing list >>> fedora-suds-list at redhat.com >>> https://www.redhat.com/mailman/listinfo/fedora-suds-list >> _______________________________________________ >> fedora-suds-list mailing list >> fedora-suds-list at redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-suds-list From daryld at norco.com Fri May 15 20:17:31 2009 From: daryld at norco.com (Daryl Daly) Date: Fri, 15 May 2009 13:17:31 -0700 Subject: [Fedora-suds-list] multipart reply with binary Message-ID: <4A0DCDDB.3050008@norco.com> I am new to suds and fairly new to SOAP in general. I am trying to use suds to interact with JasperServer's SOAP server. versions: Python 2.5 suds 0.3.5 (also tried 0.3.6) I am able to connect to the SOAP server and use simple commands but when I try to use the runReport method I get: xml.sax._exceptions.SAXParseException: :2:6: not well-formed (invalid token) It seems that the server is returning a multipart reply. One part of it is binary (an image). My first question is, should suds be able to handle this? Here the code I am using: from suds.client import Client client = Client('http://mxp.norco.com:8080/jasperserver/services/repository?wsdl',username='jasperadmin',password='xxxxxx') result = client.service.runReport('HTML1dunbcyc') If needed I can include the full TCP conversation but it is rather long. Here is just the beginning part of the reply: HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: multipart/related; type="text/xml"; start="<454B124F1FC5659C9A0D323DE8BD639C>"; .boundary="----=_Part_12_32920944.1242418155865" Date: Fri, 15 May 2009 20:09:15 GMT Connection: close ------=_Part_12_32920944.1242418155865 Content-Type: text/xml; charset=UTF-8 Content-Transfer-Encoding: binary Content-Id: <454B124F1FC5659C9A0D323DE8BD639C> <?xml version="1.0" encoding="UTF-8"?> <operationResult version="2.0.1"> .<returnCode><![CDATA[0]]></returnCode> </operationResult> ------=_Part_12_32920944.1242418155865 Content-Type: image/png Content-Transfer-Encoding: binary Content-Id: .PNG [...SNIP...] Thanks, Daryl. From jortel at redhat.com Mon May 18 18:44:59 2009 From: jortel at redhat.com (Jeff Ortel) Date: Mon, 18 May 2009 14:44:59 -0400 Subject: [Fedora-suds-list] multipart reply with binary In-Reply-To: <4A0DCDDB.3050008@norco.com> References: <4A0DCDDB.3050008@norco.com> Message-ID: <4A11ACAB.6000102@redhat.com> Hey Daryl, Currently, I don't thinks suds handles multipart but I need to look into how urllib2 behaves to be sure. I'll get back with you. Regards, Jeff Daryl Daly wrote: > I am new to suds and fairly new to SOAP in general. > I am trying to use suds to interact with JasperServer's SOAP server. > versions: > Python 2.5 > suds 0.3.5 (also tried 0.3.6) > > I am able to connect to the SOAP server and use simple commands but when > I try to use the runReport method I get: > xml.sax._exceptions.SAXParseException: :2:6: not well-formed > (invalid token) > > It seems that the server is returning a multipart reply. One part of it > is binary (an image). My first question is, should suds be able to > handle this? > > Here the code I am using: > > from suds.client import Client > client = > Client('http://mxp.norco.com:8080/jasperserver/services/repository?wsdl',username='jasperadmin',password='xxxxxx') > > > result = client.service.runReport(' locale="en"> name="RUN_OUTPUT_FORMAT">HTML wsType="" uriString="/reports/sales/cust_sales_chart" > isNew="false"> name="cust_no">1dunbcyc') > > > If needed I can include the full TCP conversation but it is rather long. > Here is just the beginning part of the reply: > HTTP/1.1 200 OK > Server: Apache-Coyote/1.1 > Content-Type: multipart/related; type="text/xml"; > start="<454B124F1FC5659C9A0D323DE8BD639C>"; > .boundary="----=_Part_12_32920944.1242418155865" > Date: Fri, 15 May 2009 20:09:15 GMT > Connection: close > > > ------=_Part_12_32920944.1242418155865 > Content-Type: text/xml; charset=UTF-8 > Content-Transfer-Encoding: binary > Content-Id: <454B124F1FC5659C9A0D323DE8BD639C> > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:ns1="http://axis2.ws.jasperserver.jaspersoft.com"> xsi:type="xsd:string"><?xml version="1.0" > encoding="UTF-8"?> > <operationResult version="2.0.1"> > .<returnCode><![CDATA[0]]></returnCode> > </operationResult> > > > ------=_Part_12_32920944.1242418155865 > Content-Type: image/png > Content-Transfer-Encoding: binary > Content-Id: > > .PNG > > [...SNIP...] > > Thanks, > Daryl. > > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list From jortel at redhat.com Tue May 19 14:15:44 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 19 May 2009 10:15:44 -0400 Subject: [Fedora-suds-list] schema doctor Message-ID: <4A12BF10.8090600@redhat.com> All, The schema /doctor/ was added in r512 and released in the 0.3.6 beta. The module defines the Doctor interface and provides one stock implementation. The ImportDoctor is designed to fix schemas that are missing imports. Those of you using locally stored and fixed wsdls containing or importing schemas that are missing imports such as: and can now use the schema doctor to patch these schema(s) at runtime and go back to using the wsdl provided by the service provider. Also, the Doctor interface is designed to be user extensible. Suds users can write there own doctor classes to do pretty much whatever is needed to make schema(s) work. See https://fedorahosted.org/suds/wiki/Documentation#FIXINGBROKENSCHEMAs for examples and more details. Regards, Jeff From yqiang at gmail.com Wed May 20 23:21:26 2009 From: yqiang at gmail.com (Yi Qiang) Date: Wed, 20 May 2009 16:21:26 -0700 Subject: [Fedora-suds-list] optional elements Message-ID: <3af8969a0905201621ud207c37l4078d45df8ab95f7@mail.gmail.com> Hi, The WSDL I am trying to use suds with is a bit annoying in that it defines certain elements as REQUIRED but read only. For example, it will have something like the following: So when suds generates the SOAP request, it will put the following as a default: Then the server complains that this is not valid. If I set this to say "true" or "false", the server complains that this field is read only. The only way I've been able to work around this is to download the WSDL from the server, make that element optional by changing "minOccurs" to 0. Is there anyway to tell suds to not put default elements? I.e., only create XML elements that I specifically ask for? Thanks, Yi -------------- next part -------------- An HTML attachment was scrubbed... URL: From jortel at redhat.com Thu May 21 12:50:43 2009 From: jortel at redhat.com (Jeff Ortel) Date: Thu, 21 May 2009 08:50:43 -0400 Subject: [Fedora-suds-list] optional elements In-Reply-To: <3af8969a0905201621ud207c37l4078d45df8ab95f7@mail.gmail.com> References: <3af8969a0905201621ud207c37l4078d45df8ab95f7@mail.gmail.com> Message-ID: <4A154E23.3040202@redhat.com> Hey Yi, Welcome to suds :-) That is annoying. Making input XML have elements that are required and read only is contradictory. They (the service provider) must be using these elements in reply messages as well. Anyway, The suds factory doesn't (currently) provide a way to specify a way to filter (in|out) nodes. Although, I'm very willing to discuss added this functionality if we can't find a suitable work around. In the mean time, a good workaround might be to use the schema /doctor/ functionality introduced in 0.3.6 beta. You'll have to get from trunk or wiki. You can implement a Doctor to mark these elements to minOccurs=0 like you did in your local copy. Using the schema doctor will at least keep you from having to maintain a local copy of the wsdl. You can do something like: from suds.xsd.doctor import Doctor class MyDoctor(Doctor): def examine(root): child = root.getChild('xyz') child.set('minOccurs', 0) In you code: client = Client(url, schemadoctor=MyDoctor()) Hope this helps. Please let me know how you make out. Regards, Jeff Yi Qiang wrote: > Hi, > The WSDL I am trying to use suds with is a bit annoying in that it > defines certain elements as REQUIRED but read only. For example, it will > have something like the following: > > > > So when suds generates the SOAP request, it will put the following as a > default: > > > > Then the server complains that this is not valid. If I set this to say > "true" or "false", the server complains that this field is read only. > > The only way I've been able to work around this is to download the WSDL > from the server, make that element optional by changing "minOccurs" to 0. > > Is there anyway to tell suds to not put default elements? I.e., only > create XML elements that I specifically ask for? > > Thanks, > Yi > > > ------------------------------------------------------------------------ > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list From zxie.lists at gmail.com Thu May 21 17:57:38 2009 From: zxie.lists at gmail.com (Zhiwu Xie) Date: Thu, 21 May 2009 13:57:38 -0400 Subject: [Fedora-suds-list] ImportDoctor or SAX? Message-ID: <8fe48a320905211057h11c31ea4k26bfbe6a98e54596@mail.gmail.com> Newbie here, would appreciate your help and/or hint. Not sure if it's because I didn't use ImportDoctor properly or because it's a SAX parser so it didn't reach the scheme for the namespace 'urn:theplatform-com:v4/base/' before trying to parse it, or it's the WSDL file (http://admin.theplatform.com/API/urn:service.wsdl) that's wrongly formed. Thanks a lot, Zhiwu >>> from suds.xsd.doctor import * >>> imp = Import('http://www.w3.org/2001/XMLSchema') >>> imp.filter.add('urn:theplatform-com:v4/base/') >>> doctor = ImportDoctor(imp) >>> url = 'http://admin.theplatform.com/API/urn:service.wsdl' >>> client = Client(url, schemadoctor=doctor) Traceback (most recent call last): File "", line 1, in client = Client(url, schemadoctor=doctor) File "C:\Python25\Lib\site-packages\suds\client.py", line 106, in __init__ self.wsdl = Definitions(url, options) File "C:\Python25\Lib\site-packages\suds\wsdl.py", line 193, in __init__ self.build_schema() File "C:\Python25\Lib\site-packages\suds\wsdl.py", line 255, in build_schema self.schema = container.load() File "C:\Python25\Lib\site-packages\suds\xsd\schema.py", line 92, in load child.dereference() File "C:\Python25\Lib\site-packages\suds\xsd\schema.py", line 294, in dereference midx, deps = x.dependencies() File "C:\Python25\Lib\site-packages\suds\xsd\sxbasic.py", line 783, in dependencies raise TypeNotFound(qref) TypeNotFound: Type not found: '(BusinessObject, urn:theplatform-com:v4/base/, )' -------------- next part -------------- An HTML attachment was scrubbed... URL: From jortel at redhat.com Thu May 21 20:48:57 2009 From: jortel at redhat.com (Jeff Ortel) Date: Thu, 21 May 2009 16:48:57 -0400 Subject: [Fedora-suds-list] ImportDoctor or SAX? In-Reply-To: <8fe48a320905211057h11c31ea4k26bfbe6a98e54596@mail.gmail.com> References: <8fe48a320905211057h11c31ea4k26bfbe6a98e54596@mail.gmail.com> Message-ID: <4A15BE39.1000906@redhat.com> Zhiwu Xie wrote: > Newbie here, would appreciate your help and/or hint. > > Not sure if it's because I didn't use ImportDoctor properly or because > it's a SAX parser so it didn't reach the scheme for the namespace > 'urn:theplatform-com:v4/base/' before trying to parse it, or it's the > WSDL file (http://admin.theplatform.com/API/urn:service.wsdl) that's > wrongly formed. The wsdl contains (16) schemas and (3) of them reference types in the in the 'urn:theplatform-com:v4/base/' namespace but fail to properly import the schema. Even though, the schema is defined within the same wsdl, XSD import rules apply. What you have below is very close - but backwards. The Import() constructor takes the namespace (and optional schema location) of an to add (if missing). The Import.filter takes the targetNamepsace(s) of this schema(s) to be fixed (that are missing the import(s) ). This works for me: > > url = 'http://admin.theplatform.com/API/urn:service.wsdl' > imp = Import('urn:theplatform-com:v4/base/') > imp.filter.add('urn:theplatform-com:v4/admin/value/') > imp.filter.add('urn:theplatform-com:v4/content/value/') > imp.filter.add('urn:theplatform-com:v4/rights/value/') > d = ImportDoctor(imp) > client = Client(url, schemadoctor=d) > Regards, Jeff > > Thanks a lot, > > Zhiwu > > > >>> from suds.xsd.doctor import * > >>> imp = Import('http://www.w3.org/2001/XMLSchema') > >>> imp.filter.add('urn:theplatform-com:v4/base/') > >>> doctor = ImportDoctor(imp) > >>> url = 'http://admin.theplatform.com/API/urn:service.wsdl' > >>> client = Client(url, schemadoctor=doctor) > Traceback (most recent call last): > File "", line 1, in > client = Client(url, schemadoctor=doctor) > File "C:\Python25\Lib\site-packages\suds\client.py", line 106, in __init__ > self.wsdl = Definitions(url, options) > File "C:\Python25\Lib\site-packages\suds\wsdl.py", line 193, in __init__ > self.build_schema() > File "C:\Python25\Lib\site-packages\suds\wsdl.py", line 255, in > build_schema > self.schema = container.load() > File "C:\Python25\Lib\site-packages\suds\xsd\schema.py", line 92, in load > child.dereference() > File "C:\Python25\Lib\site-packages\suds\xsd\schema.py", line 294, in > dereference > midx, deps = x.dependencies() > File "C:\Python25\Lib\site-packages\suds\xsd\sxbasic.py", line 783, in > dependencies > raise TypeNotFound(qref) > TypeNotFound: Type not found: '(BusinessObject, > urn:theplatform-com:v4/base/, )' > > > ------------------------------------------------------------------------ > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list From yqiang at gmail.com Fri May 22 17:02:06 2009 From: yqiang at gmail.com (Yi Qiang) Date: Fri, 22 May 2009 10:02:06 -0700 Subject: [Fedora-suds-list] optional elements In-Reply-To: <4A154E23.3040202@redhat.com> References: <3af8969a0905201621ud207c37l4078d45df8ab95f7@mail.gmail.com> <4A154E23.3040202@redhat.com> Message-ID: <3af8969a0905221002k24e27316k909ef75e11d1f05e@mail.gmail.com> Hi Jeff, Thanks for the quick response. The problem with the schema doctor solution is that once I mark these elements to minOccurs=0, I do not get any validation when I get the response back. When the server gives me back the XML, I _do_ want to make sure that the elements marked as required are actually there. Does that make sense? Can suds generate empty nodes with a default value in a way that .NET web services can understand better? If the the node was generated as "true" the service wouldn't choke so much. -Yi On Thu, May 21, 2009 at 5:50 AM, Jeff Ortel wrote: > Hey Yi, > > Welcome to suds :-) > > That is annoying. Making input XML have elements that are required and > read only is contradictory. They (the service provider) must be using these > elements in reply messages as well. > > Anyway, The suds factory doesn't (currently) provide a way to specify a way > to filter (in|out) nodes. Although, I'm very willing to discuss added this > functionality if we can't find a suitable work around. > > In the mean time, a good workaround might be to use the schema /doctor/ > functionality introduced in 0.3.6 beta. You'll have to get from trunk or > wiki. You can implement a Doctor to mark these elements to minOccurs=0 like > you did in your local copy. Using the schema doctor will at least keep you > from having to maintain a local copy of the wsdl. > > You can do something like: > > from suds.xsd.doctor import Doctor > > class MyDoctor(Doctor): > def examine(root): > > child = root.getChild('xyz') > child.set('minOccurs', 0) > > In you code: > > client = Client(url, schemadoctor=MyDoctor()) > > Hope this helps. > Please let me know how you make out. > > Regards, > > Jeff > > Yi Qiang wrote: > >> Hi, >> The WSDL I am trying to use suds with is a bit annoying in that it defines >> certain elements as REQUIRED but read only. For example, it will have >> something like the following: >> >> >> >> So when suds generates the SOAP request, it will put the following as a >> default: >> >> >> >> Then the server complains that this is not valid. If I set this to say >> "true" or "false", the server complains that this field is read only. >> >> The only way I've been able to work around this is to download the WSDL >> from the server, make that element optional by changing "minOccurs" to 0. >> >> Is there anyway to tell suds to not put default elements? I.e., only >> create XML elements that I specifically ask for? >> >> Thanks, >> Yi >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> fedora-suds-list mailing list >> fedora-suds-list at redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-suds-list >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexis.michon at ibcp.fr Tue May 26 19:04:25 2009 From: alexis.michon at ibcp.fr (Alexis Michon) Date: Tue, 26 May 2009 21:04:25 +0200 Subject: [Fedora-suds-list] Suds -> client and for ? the server side ? Message-ID: <4A1C3D39.2060004@ibcp.fr> Hello, My question is a little bit off the topic. Actually, i am programming some webservices and for the client part, Suds makes a very great job. This is a very userfriendly tool, a very good job have been done by developpers, thanks you guy ! But for the server side, i haven't found any tools like Suds. Do you know a python library that could make the server side of a webservice infrastructure ? Something that could be use with mod_python and apache. I found and tried ZSI, but it isn't enough and it seems to be dead. So, what library do you use in your infrastructure ? Thanks you in advance for your help. ++ Alexis -- Alexis MICHON CNRS, France IBCP, Institut de Biologie et Chimie des Proteines Mail : alexis.michon at ibcp.fr Tel : 04.72.72.26.46 Empreinte : 8FDA 1594 2C18 EEDA 681E 8A6D 56EF F0A0 6F06 892A -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 257 bytes Desc: OpenPGP digital signature URL: From waldemar.osuch at gmail.com Tue May 26 21:42:36 2009 From: waldemar.osuch at gmail.com (Waldemar Osuch) Date: Tue, 26 May 2009 15:42:36 -0600 Subject: [Fedora-suds-list] Suds -> client and for ? the server side ? In-Reply-To: <4A1C3D39.2060004@ibcp.fr> References: <4A1C3D39.2060004@ibcp.fr> Message-ID: <6fae95540905261442n2a7f6155t83513f1cb24fd0a5@mail.gmail.com> On Tue, May 26, 2009 at 1:04 PM, Alexis Michon wrote: > Hello, > > My question is a little bit off the topic. > > Actually, i am programming some webservices and for the client part, > Suds makes a very great job. > This is a very userfriendly tool, a very good job have been done by > developpers, thanks you guy ! > > But for the server side, i haven't found any tools like Suds. > > Do you know a python library that could make the server side of a > webservice infrastructure ? Something that could be use with mod_python > and apache. > I found and tried ZSI, but it isn't enough ?and it seems to be dead. > > So, what library do you use in your infrastructure ? > I have successfully used: http://trac.optio.webfactional.com/ If you have a way of serving WSGI applications it will fit very nicely Waldemar