From monty at starfief.com Tue Nov 3 14:05:21 2009 From: monty at starfief.com (Rod Montgomery) Date: Tue, 03 Nov 2009 09:05:21 -0500 Subject: [Fedora-suds-list] print client does not show types of results of methods Message-ID: <4AF038A1.9060905@starfief.com> From browsing the Suds source code, I get the impression that Suds does not even use the type info specified in the WSDL files for the results of methods. It just parses whatever XML comes back from the service, converts it to a corresponding Pythonic data structure, and returns that. I guess that's ok, except that it means that, to understand what comes back, I have to dig through the WSDL files. Do any other SOAP clients -- Pythonic or not -- actually use the WSDL-specified method-result types? For what? For error detection, how useful would it be to have a "result type does not match type declared in WSDL files" exception thrown at the point where the result comes back, rather than maybe have some random no-such-member exception(s) thrown while trying to process the result? How annoying would it be, to have a "result type does not match..." exception thrown, when the mismatch would not have affected the proper operation of the client code anyway? I wonder whether I could make Suds just remember the declared type of each method result, and display it in the "print client" output, purely as human-readable documentation? Maybe just tack another element onto the tuple that represents each method in the .ports member of the suds.servicedefinition.ServiceDefinition class, and pick it up for display in the description member function of that class? From Robert.Hector at codestreet.com Tue Nov 3 16:16:55 2009 From: Robert.Hector at codestreet.com (Robert Hector) Date: Tue, 3 Nov 2009 10:16:55 -0600 Subject: [Fedora-suds-list] Please make tar file of suds 0.3.6 available for download Message-ID: Can you please make a tar file of suds v 0.3.6 available for download? I am trying to run the salesforce python toolkit which was written for suds 0.3.6 and isn't working using 0.3.7. Thanks, Bob -------------- next part -------------- An HTML attachment was scrubbed... URL: From jortel at redhat.com Tue Nov 3 16:18:23 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 03 Nov 2009 10:18:23 -0600 Subject: [Fedora-suds-list] print client does not show types of results of methods In-Reply-To: <4AF038A1.9060905@starfief.com> References: <4AF038A1.9060905@starfief.com> Message-ID: <4AF057CF.1010801@redhat.com> On 11/03/2009 08:05 AM, Rod Montgomery wrote: > From browsing the Suds source code, I get the impression that Suds does > not even use the type info specified in the WSDL files for the results > of methods. It just parses whatever XML comes back from the service, > converts it to a corresponding Pythonic data structure, and returns that. That's not correct. Suds does match the method's returned type with that declared in the WSDL. There are two reasons for this. First, it validates that what is returned matches the schema. Second, it uses this information to convert types between XML to the correct python objects. For example, xs:int converted to a python integer. > > I guess that's ok, except that it means that, to understand what comes > back, I have to dig through the WSDL files. [1]. I agree. A good enhancement would be for suds to display the return types as part of the method signatures displayed when you print the client. > > Do any other SOAP clients -- Pythonic or not -- actually use the > WSDL-specified method-result types? For what? > > For error detection, how useful would it be to have a "result type does > not match type declared in WSDL files" exception thrown at the point > where the result comes back, rather than maybe have some random > no-such-member exception(s) thrown while trying to process the result? > > How annoying would it be, to have a "result type does not match..." > exception thrown, when the mismatch would not have affected the proper > operation of the client code anyway? > > I wonder whether I could make Suds just remember the declared type of > each method result, and display it in the "print client" output, purely > as human-readable documentation? Maybe just tack another element onto > the tuple that represents each method in the .ports member of the > suds.servicedefinition.ServiceDefinition class, and pick it up for > display in the description member function of that class? Yes. See [1] above. > > _______________________________________________ > 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From jortel at redhat.com Tue Nov 3 17:25:54 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 03 Nov 2009 11:25:54 -0600 Subject: [Fedora-suds-list] Please make tar file of suds 0.3.6 available for download In-Reply-To: References: Message-ID: <4AF067A2.6050400@redhat.com> On 11/03/2009 10:16 AM, Robert Hector wrote: > Can you please make a tar file of suds v 0.3.6 available for download? > I am trying to run the salesforce python toolkit which was written for > suds 0.3.6 and isn?t working using 0.3.7. Sure. I added links for older releases here https://fedorahosted.org/suds/wiki/ReleaseHistory and added a link to "Downloads" section on the main page https://fedorahosted.org/suds/#Resources > > Thanks, > > Bob > > > > _______________________________________________ > 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From monty at starfief.com Tue Nov 3 21:18:58 2009 From: monty at starfief.com (Rod Montgomery) Date: Tue, 03 Nov 2009 16:18:58 -0500 Subject: [Fedora-suds-list] Does servicedefinition.py class ServiceDefinition method findport have a bad comparison? Message-ID: <4AF09E42.8050506@starfief.com> In file servicedefinition.py, the findport method of class ServiceDefinition reads as follows: def findport(self, port): """ Find and return a port tuple for the specified port. Created and added when not found. @param port: A port. @type port: I{service.Port} @return: A port tuple. @rtype: (port, [method]) """ for p in self.ports: if p[0] == p: return p p = (port, []) self.ports.append(p) return p Should not the comparison be if p[0] == port rather than if p[0] == p ? I don't quite see how to trigger the failure. It would have to be a situation in which the same port had to be looked up a second time. The only invocation of the findport method is from the addports method immediately above it, and the only invocation of addports is from the __init__ method for the class. I think that means it would take a second appearance of the same port in the WSDL to trigger a failure. Maybe a situation in which some methods for a port are defined in one WSDL file, and others in a second WSDL file? From mcauthorn at gmail.com Tue Nov 3 21:57:50 2009 From: mcauthorn at gmail.com (Matt C) Date: Tue, 3 Nov 2009 16:57:50 -0500 Subject: [Fedora-suds-list] print client does not show types of results of methods In-Reply-To: <4AF057CF.1010801@redhat.com> References: <4AF038A1.9060905@starfief.com> <4AF057CF.1010801@redhat.com> Message-ID: <42ea979e0911031357k28fbd9deo73a1208df72b5832@mail.gmail.com> This may or may not be the best way to do this, but I've been digging around for this type of information as well and came up with some useful information here (for my particular WSDLs): method = c.sd[0].ports[0][0].method('get_list') In [15]: method.soap.input Out[15]: (Input){ body = (Body){ parts[] = use = "encoded" namespace[] = "b0", "urn:iControl:LocalLB/VirtualServer", wrapped = False } headers[] = } -- and -- In [16]: method.soap.output Out[16]: (Output){ body = (Body){ parts[] = (Part){ root = name = "return" qname[] = "return", "urn:iControl", element = "None" type = "(u'Common.StringSequence', urn:iControl)" }, use = "literal" namespace[] = "tns", "urn:iControl", wrapped = False } headers[] = } Which allows for stuff like: In [19]: for x in method.soap.output.body.parts: ....: print x.name, x.type ....: ....: return (u'Common.StringSequence', urn:iControl) This may or may not be useful for you here, but in the event it saves someone some cycles I wanted to put this out to the list. I found this a handy way to inspect input/output for a particular method. -Matt On Tue, Nov 3, 2009 at 11:18 AM, Jeff Ortel wrote: > > > On 11/03/2009 08:05 AM, Rod Montgomery wrote: >> >> ?From browsing the Suds source code, I get the impression that Suds does >> not even use the type info specified in the WSDL files for the results >> of methods. It just parses whatever XML comes back from the service, >> converts it to a corresponding Pythonic data structure, and returns that. > > That's not correct. ?Suds does match the method's returned type with that > declared in the WSDL. ?There are two reasons for this. ?First, it validates > that what is returned matches the schema. ?Second, it uses this information > to convert types between XML to the correct python objects. ?For example, > xs:int converted to a python integer. > >> >> I guess that's ok, except that it means that, to understand what comes >> back, I have to dig through the WSDL files. > > [1]. I agree. ?A good enhancement would be for suds to display the return > types as part of the method signatures displayed when you print the client. > >> >> Do any other SOAP clients -- Pythonic or not -- actually use the >> WSDL-specified method-result types? For what? >> >> For error detection, how useful would it be to have a "result type does >> not match type declared in WSDL files" exception thrown at the point >> where the result comes back, rather than maybe have some random >> no-such-member exception(s) thrown while trying to process the result? >> >> How annoying would it be, to have a "result type does not match..." >> exception thrown, when the mismatch would not have affected the proper >> operation of the client code anyway? >> >> I wonder whether I could make Suds just remember the declared type of >> each method result, and display it in the "print client" output, purely >> as human-readable documentation? Maybe just tack another element onto >> the tuple that represents each method in the .ports member of the >> suds.servicedefinition.ServiceDefinition class, and pick it up for >> display in the description member function of that class? > > Yes. ?See [1] above. > >> >> _______________________________________________ >> 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 alastair.irving at sjc.ox.ac.uk Wed Nov 4 16:44:51 2009 From: alastair.irving at sjc.ox.ac.uk (Alastair Irving) Date: Wed, 04 Nov 2009 16:44:51 +0000 Subject: [Fedora-suds-list] Problem parsing a wsdl Message-ID: <4AF1AF83.4000700@sjc.ox.ac.uk> Hi I'm very new to suds, so appologise in advance if I'm missing something obvious. I'm running version 0.3.7 under Windows with python 2.6. I tried running the following: from suds.client import Client c=Client('https://api.betfair.com/global/v3/BFGlobalService.wsdl') I got the following traceback: Traceback (most recent call last): File "", line 1, in File "build\bdist.win32\egg\suds\client.py", line 109, in __init__ File "build\bdist.win32\egg\suds\wsdl.py", line 194, in __init__ File "build\bdist.win32\egg\suds\wsdl.py", line 255, in build_schema File "build\bdist.win32\egg\suds\xsd\schema.py", line 90, in load File "build\bdist.win32\egg\suds\xsd\schema.py", line 277, in open_imports File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 608, in open File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 626, in download File "build\bdist.win32\egg\suds\sax\parser.py", line 134, in parse File "c:\Python26\lib\xml\sax\expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "c:\Python26\lib\xml\sax\xmlreader.py", line 123, in parse self.feed(buffer) File "c:\Python26\lib\xml\sax\expatreader.py", line 211, in feed self._err_handler.fatalError(exc) File "c:\Python26\lib\xml\sax\handler.py", line 38, in fatalError raise exception xml.sax._exceptions.SAXParseException: c:\docume~1\alasta~1\locals~1\temp\suds\s uds-649682136.http:10:2: mismatched tag The contents of the file refference by the last line are:

Something's clearly gone wrong as it surely shouldn't be fetching HTML files. However I think its unlikely that there would be a problem with the wsdl so I suspect its either a problem with suds or with my usage of it. Any help will be much appreciated. Alastair Irving From jortel at redhat.com Wed Nov 4 17:20:04 2009 From: jortel at redhat.com (Jeff Ortel) Date: Wed, 04 Nov 2009 11:20:04 -0600 Subject: [Fedora-suds-list] Problem parsing a wsdl In-Reply-To: <4AF1AF83.4000700@sjc.ox.ac.uk> References: <4AF1AF83.4000700@sjc.ox.ac.uk> Message-ID: <4AF1B7C4.3070906@redhat.com> Hey Alastair, This works for me (see output below). I'd suggest you navigate to your wsdl url below and validate that it is an XML document. Also, be sure to view the source and make sure it's really as the browser shows it. It looks good for me and suds has no problem with it. But, each web environment is different (proxies, caching, etc). Also, if you tried this and did some ctrl^c, you may have corrupted the suds cache. By default, suds uses a file-based cache and when you interrupt it while writing to the cache, it can corrupt the files. So, you can specify that suds *not* use any caching by using the /cache=None/ option as follows: > > url = 'https://api.betfair.com/global/v3/BFGlobalService.wsdl' > client = Client(url, cache=None) > And/or, you can also clear the cache. On Linux: ( rm -f /tmp/suds/* ) On Windows: sorry, don't know :) Hope this helps, Jeff ________________________________________________________________ Test @ ( https://api.betfair.com/global/v3/BFGlobalService.wsdl ) Suds ( https://fedorahosted.org/suds/ ) version: 0.3.8 (beta) build: R589-20091030 Service ( BFGlobalService ) tns="http://www.betfair.com/publicapi/v3/BFGlobalService/" Prefixes (3) ns0 = "http://schemas.xmlsoap.org/soap/encoding/" ns1 = "http://www.betfair.com/publicapi/types/global/v3/" ns2 = "http://www.betfair.com/publicapi/v3/BFGlobalService/" Ports (1): (BFGlobalService) Methods (28): addPaymentCard(ns1:AddPaymentCardReq request, ) convertCurrency(ns1:ConvertCurrencyReq request, ) createAccount(ns1:CreateAccountReq request, ) deletePaymentCard(ns1:DeletePaymentCardReq request, ) depositFromPaymentCard(ns1:DepositFromPaymentCardReq request, ) forgotPassword(ns1:ForgotPasswordReq request, ) getActiveEventTypes(ns1:GetEventTypesReq request, ) getAllCurrencies(ns1:GetCurrenciesReq request, ) getAllCurrenciesV2(ns1:GetCurrenciesV2Req request, ) getAllEventTypes(ns1:GetEventTypesReq request, ) getEvents(ns1:GetEventsReq request, ) getPaymentCard(ns1:GetPaymentCardReq request, ) getSubscriptionInfo(ns1:GetSubscriptionInfoReq request, ) keepAlive(ns1:KeepAliveReq request, ) login(ns1:LoginReq request, ) logout(ns1:LogoutReq request, ) modifyPassword(ns1:ModifyPasswordReq request, ) modifyProfile(ns1:ModifyProfileReq request, ) retrieveLIMBMessage(ns1:RetrieveLIMBMessageReq request, ) selfExclude(ns1:SelfExcludeReq request, ) setChatName(ns1:SetChatNameReq request, ) submitLIMBMessage(ns1:SubmitLIMBMessageReq request, ) transferFunds(ns1:TransferFundsReq request, ) updatePaymentCard(ns1:UpdatePaymentCardReq request, ) viewProfile(ns1:ViewProfileReq request, ) viewProfileV2(ns1:ViewProfileV2Req request, ) viewReferAndEarn(ns1:ViewReferAndEarnReq request, ) withdrawToPaymentCard(ns1:WithdrawToPaymentCardReq request, ) Types (186): ns1:APIErrorEnum ns1:APIRequest ns1:APIRequestHeader ns1:APIResponse ns1:APIResponseHeader ns1:AccountStatusEnum ns1:AccountTypeEnum ns1:AddPaymentCardErrorEnum ns1:AddPaymentCardReq ns1:AddPaymentCardResp ns0:Array ns1:ArrayOfBFEvent ns1:ArrayOfCouponLinks ns1:ArrayOfCurrency ns1:ArrayOfCurrencyV2 ns1:ArrayOfEventType ns1:ArrayOfLIMBValidationErrorsEnum ns1:ArrayOfMarketSummary ns1:ArrayOfPaymentCard ns1:ArrayOfRetrieveCardBillingAddressCheckLIMBMessage ns1:ArrayOfServiceCall ns1:ArrayOfSubmitCardBillingAddressCheckLIMBMessage ns1:ArrayOfSubscription ns1:ArrayOfValidationErrorsEnum ns1:BFEvent ns1:BillingPeriodEnum ns1:CardTypeEnum ns1:ConvertCurrencyErrorEnum ns1:ConvertCurrencyReq ns1:ConvertCurrencyResp ns1:CouponLink ns1:CreateAccountErrorEnum ns1:CreateAccountReq ns1:CreateAccountResp ns1:Currency ns1:CurrencyV2 ns1:DeletePaymentCardErrorEnum ns1:DeletePaymentCardReq ns1:DeletePaymentCardResp ns1:DepositFromPaymentCardReq ns1:DepositFromPaymentCardResp ns0:ENTITIES ns0:ENTITY ns1:EventType ns1:ForgotPasswordErrorEnum ns1:ForgotPasswordReq ns1:ForgotPasswordResp ns1:GamcareLimitFreqEnum ns1:GenderEnum ns1:GetCurrenciesReq ns1:GetCurrenciesResp ns1:GetCurrenciesV2Req ns1:GetCurrenciesV2Resp ns1:GetEventTypesReq ns1:GetEventTypesResp ns1:GetEventsErrorEnum ns1:GetEventsReq ns1:GetEventsResp ns1:GetPaymentCardErrorEnum ns1:GetPaymentCardReq ns1:GetPaymentCardResp ns1:GetSubscriptionInfoReq ns1:GetSubscriptionInfoResp ns0:ID ns0:IDREF ns0:IDREFS ns1:KYCStatusEnum ns1:KeepAliveReq ns1:KeepAliveResp ns1:LIMBValidationErrorsEnum ns1:LoginErrorEnum ns1:LoginReq ns1:LoginResp ns1:LogoutErrorEnum ns1:LogoutReq ns1:LogoutResp ns1:MarketStatusEnum ns1:MarketSummary ns1:MarketTypeEnum ns1:MarketTypeVariantEnum ns1:ModifyPasswordErrorEnum ns1:ModifyPasswordReq ns1:ModifyPasswordResp ns1:ModifyProfileErrorEnum ns1:ModifyProfileReq ns1:ModifyProfileResp ns0:NCName ns0:NMTOKEN ns0:NMTOKENS ns0:NOTATION ns0:Name ns1:PaymentCard ns1:PaymentCardStatusEnum ns1:PaymentsErrorEnum ns1:PrivacyPolicyChangeResponseEnum ns0:QName ns1:RegionEnum ns1:RetrieveAddressCheckLIMBMessage ns1:RetrieveBirthDateCheckLIMBMessage ns1:RetrieveCardBillingAddressCheckLIMBMessage ns1:RetrieveChatNameChangeLIMBMessage ns1:RetrieveContactDetailsCheckLIMBMessage ns1:RetrieveLIMBMessageErrorEnum ns1:RetrieveLIMBMessageReq ns1:RetrieveLIMBMessageResp ns1:RetrievePasswordChangeLIMBMessage ns1:RetrievePersonalLIMBMessage ns1:RetrieveTCPrivacyPolicyChangeLIMBMessage ns1:Runner ns1:SecurityQuestion1Enum ns1:SecurityQuestion2Enum ns1:SelfExcludeErrorEnum ns1:SelfExcludeReq ns1:SelfExcludeResp ns1:ServiceCall ns1:ServiceEnum ns1:SetChatNameErrorEnum ns1:SetChatNameReq ns1:SetChatNameResp ns0:Struct ns1:SubmitAddressCheckLIMBMessage ns1:SubmitBirthDateCheckLIMBMessage ns1:SubmitCardBillingAddressCheckLIMBMessage ns1:SubmitChatNameChangeLIMBMessage ns1:SubmitContactDetailsCheckLIMBMessage ns1:SubmitLIMBMessageErrorEnum ns1:SubmitLIMBMessageReq ns1:SubmitLIMBMessageResp ns1:SubmitPasswordChangeLIMBMessage ns1:SubmitPersonalLIMBMessage ns1:SubmitTCPrivacyPolicyChangeLIMBMessage ns1:Subscription ns1:SubscriptionStatusEnum ns1:TitleEnum ns1:TransferFundsErrorEnum ns1:TransferFundsReq ns1:TransferFundsResp ns1:UpdatePaymentCardErrorEnum ns1:UpdatePaymentCardReq ns1:UpdatePaymentCardResp ns1:ValidationErrorsEnum ns1:ViewProfileErrorEnum ns1:ViewProfileReq ns1:ViewProfileResp ns1:ViewProfileV2Req ns1:ViewProfileV2Resp ns1:ViewReferAndEarnErrorEnum ns1:ViewReferAndEarnReq ns1:ViewReferAndEarnResp ns1:WithdrawToPaymentCardReq ns1:WithdrawToPaymentCardResp ns0:anyURI ns0:arrayCoordinate ns0:base64 ns0:base64Binary ns0:boolean ns0:byte ns0:date ns0:dateTime ns0:decimal ns0:double ns0:duration ns0:float ns0:gDay ns0:gMonth ns0:gMonthDay ns0:gYear ns0:gYearMonth ns0:hexBinary ns0:int ns0:integer ns0:language ns0:long ns0:negativeInteger ns0:nonNegativeInteger ns0:nonPositiveInteger ns0:normalizedString ns0:positiveInteger ns0:short ns0:string ns0:time ns0:token ns0:unsignedByte ns0:unsignedInt ns0:unsignedLong ns0:unsignedShort Finished: errors = 0 On 11/04/2009 10:44 AM, Alastair Irving wrote: > Hi > > I'm very new to suds, so appologise in advance if I'm missing something > obvious. I'm running version 0.3.7 under Windows with python 2.6. > > I tried running the following: > > from suds.client import Client > c=Client('https://api.betfair.com/global/v3/BFGlobalService.wsdl') > > I got the following traceback: > > Traceback (most recent call last): > File "", line 1, in > File "build\bdist.win32\egg\suds\client.py", line 109, in __init__ > File "build\bdist.win32\egg\suds\wsdl.py", line 194, in __init__ > File "build\bdist.win32\egg\suds\wsdl.py", line 255, in build_schema > File "build\bdist.win32\egg\suds\xsd\schema.py", line 90, in load > File "build\bdist.win32\egg\suds\xsd\schema.py", line 277, in open_imports > File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 608, in open > File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 626, in download > File "build\bdist.win32\egg\suds\sax\parser.py", line 134, in parse > File "c:\Python26\lib\xml\sax\expatreader.py", line 107, in parse > xmlreader.IncrementalParser.parse(self, source) > File "c:\Python26\lib\xml\sax\xmlreader.py", line 123, in parse > self.feed(buffer) > File "c:\Python26\lib\xml\sax\expatreader.py", line 211, in feed > self._err_handler.fatalError(exc) > File "c:\Python26\lib\xml\sax\handler.py", line 38, in fatalError > raise exception > xml.sax._exceptions.SAXParseException: > c:\docume~1\alasta~1\locals~1\temp\suds\s > uds-649682136.http:10:2: mismatched tag > > The contents of the file refference by the last line are: > > "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd"> > > > > > > > > > > > > > > > > > >

> > > > Something's clearly gone wrong as it surely shouldn't be fetching HTML > files. However I think its unlikely that there would be a problem with > the wsdl so I suspect its either a problem with suds or with my usage of > it. > > Any help will be much appreciated. > > Alastair Irving > > > > > > > _______________________________________________ > 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From alastair.irving at sjc.ox.ac.uk Wed Nov 4 21:50:40 2009 From: alastair.irving at sjc.ox.ac.uk (Alastair Irving) Date: Wed, 04 Nov 2009 21:50:40 +0000 Subject: [Fedora-suds-list] Problem parsing a wsdl In-Reply-To: <4AF1B7C4.3070906@redhat.com> References: <4AF1AF83.4000700@sjc.ox.ac.uk> <4AF1B7C4.3070906@redhat.com> Message-ID: <4AF1F730.9090808@sjc.ox.ac.uk> Thank you, clearing the cache seems to have sorted it. Alastair Jeff Ortel wrote: > Hey Alastair, > > This works for me (see output below). I'd suggest you navigate to your wsdl url below and > validate that it is an XML document. Also, be sure to view the source and make sure it's > really as the browser shows it. It looks good for me and suds has no problem with it. > But, each web environment is different (proxies, caching, etc). Also, if you tried this > and did some ctrl^c, you may have corrupted the suds cache. By default, suds uses a > file-based cache and when you interrupt it while writing to the cache, it can corrupt the > files. So, you can specify that suds *not* use any caching by using the /cache=None/ > option as follows: > > > > > url = 'https://api.betfair.com/global/v3/BFGlobalService.wsdl' > > client = Client(url, cache=None) > > > > And/or, you can also clear the cache. > > On Linux: ( rm -f /tmp/suds/* ) > On Windows: sorry, don't know :) > > Hope this helps, > > Jeff > > > > > > ________________________________________________________________ > > Test @ ( https://api.betfair.com/global/v3/BFGlobalService.wsdl ) > > Suds ( https://fedorahosted.org/suds/ ) version: 0.3.8 (beta) build: R589-20091030 > > Service ( BFGlobalService ) tns="http://www.betfair.com/publicapi/v3/BFGlobalService/" > Prefixes (3) > ns0 = "http://schemas.xmlsoap.org/soap/encoding/" > ns1 = "http://www.betfair.com/publicapi/types/global/v3/" > ns2 = "http://www.betfair.com/publicapi/v3/BFGlobalService/" > Ports (1): > (BFGlobalService) > Methods (28): > addPaymentCard(ns1:AddPaymentCardReq request, ) > convertCurrency(ns1:ConvertCurrencyReq request, ) > createAccount(ns1:CreateAccountReq request, ) > deletePaymentCard(ns1:DeletePaymentCardReq request, ) > depositFromPaymentCard(ns1:DepositFromPaymentCardReq request, ) > forgotPassword(ns1:ForgotPasswordReq request, ) > getActiveEventTypes(ns1:GetEventTypesReq request, ) > getAllCurrencies(ns1:GetCurrenciesReq request, ) > getAllCurrenciesV2(ns1:GetCurrenciesV2Req request, ) > getAllEventTypes(ns1:GetEventTypesReq request, ) > getEvents(ns1:GetEventsReq request, ) > getPaymentCard(ns1:GetPaymentCardReq request, ) > getSubscriptionInfo(ns1:GetSubscriptionInfoReq request, ) > keepAlive(ns1:KeepAliveReq request, ) > login(ns1:LoginReq request, ) > logout(ns1:LogoutReq request, ) > modifyPassword(ns1:ModifyPasswordReq request, ) > modifyProfile(ns1:ModifyProfileReq request, ) > retrieveLIMBMessage(ns1:RetrieveLIMBMessageReq request, ) > selfExclude(ns1:SelfExcludeReq request, ) > setChatName(ns1:SetChatNameReq request, ) > submitLIMBMessage(ns1:SubmitLIMBMessageReq request, ) > transferFunds(ns1:TransferFundsReq request, ) > updatePaymentCard(ns1:UpdatePaymentCardReq request, ) > viewProfile(ns1:ViewProfileReq request, ) > viewProfileV2(ns1:ViewProfileV2Req request, ) > viewReferAndEarn(ns1:ViewReferAndEarnReq request, ) > withdrawToPaymentCard(ns1:WithdrawToPaymentCardReq request, ) > Types (186): > ns1:APIErrorEnum > ns1:APIRequest > ns1:APIRequestHeader > ns1:APIResponse > ns1:APIResponseHeader > ns1:AccountStatusEnum > ns1:AccountTypeEnum > ns1:AddPaymentCardErrorEnum > ns1:AddPaymentCardReq > ns1:AddPaymentCardResp > ns0:Array > ns1:ArrayOfBFEvent > ns1:ArrayOfCouponLinks > ns1:ArrayOfCurrency > ns1:ArrayOfCurrencyV2 > ns1:ArrayOfEventType > ns1:ArrayOfLIMBValidationErrorsEnum > ns1:ArrayOfMarketSummary > ns1:ArrayOfPaymentCard > ns1:ArrayOfRetrieveCardBillingAddressCheckLIMBMessage > ns1:ArrayOfServiceCall > ns1:ArrayOfSubmitCardBillingAddressCheckLIMBMessage > ns1:ArrayOfSubscription > ns1:ArrayOfValidationErrorsEnum > ns1:BFEvent > ns1:BillingPeriodEnum > ns1:CardTypeEnum > ns1:ConvertCurrencyErrorEnum > ns1:ConvertCurrencyReq > ns1:ConvertCurrencyResp > ns1:CouponLink > ns1:CreateAccountErrorEnum > ns1:CreateAccountReq > ns1:CreateAccountResp > ns1:Currency > ns1:CurrencyV2 > ns1:DeletePaymentCardErrorEnum > ns1:DeletePaymentCardReq > ns1:DeletePaymentCardResp > ns1:DepositFromPaymentCardReq > ns1:DepositFromPaymentCardResp > ns0:ENTITIES > ns0:ENTITY > ns1:EventType > ns1:ForgotPasswordErrorEnum > ns1:ForgotPasswordReq > ns1:ForgotPasswordResp > ns1:GamcareLimitFreqEnum > ns1:GenderEnum > ns1:GetCurrenciesReq > ns1:GetCurrenciesResp > ns1:GetCurrenciesV2Req > ns1:GetCurrenciesV2Resp > ns1:GetEventTypesReq > ns1:GetEventTypesResp > ns1:GetEventsErrorEnum > ns1:GetEventsReq > ns1:GetEventsResp > ns1:GetPaymentCardErrorEnum > ns1:GetPaymentCardReq > ns1:GetPaymentCardResp > ns1:GetSubscriptionInfoReq > ns1:GetSubscriptionInfoResp > ns0:ID > ns0:IDREF > ns0:IDREFS > ns1:KYCStatusEnum > ns1:KeepAliveReq > ns1:KeepAliveResp > ns1:LIMBValidationErrorsEnum > ns1:LoginErrorEnum > ns1:LoginReq > ns1:LoginResp > ns1:LogoutErrorEnum > ns1:LogoutReq > ns1:LogoutResp > ns1:MarketStatusEnum > ns1:MarketSummary > ns1:MarketTypeEnum > ns1:MarketTypeVariantEnum > ns1:ModifyPasswordErrorEnum > ns1:ModifyPasswordReq > ns1:ModifyPasswordResp > ns1:ModifyProfileErrorEnum > ns1:ModifyProfileReq > ns1:ModifyProfileResp > ns0:NCName > ns0:NMTOKEN > ns0:NMTOKENS > ns0:NOTATION > ns0:Name > ns1:PaymentCard > ns1:PaymentCardStatusEnum > ns1:PaymentsErrorEnum > ns1:PrivacyPolicyChangeResponseEnum > ns0:QName > ns1:RegionEnum > ns1:RetrieveAddressCheckLIMBMessage > ns1:RetrieveBirthDateCheckLIMBMessage > ns1:RetrieveCardBillingAddressCheckLIMBMessage > ns1:RetrieveChatNameChangeLIMBMessage > ns1:RetrieveContactDetailsCheckLIMBMessage > ns1:RetrieveLIMBMessageErrorEnum > ns1:RetrieveLIMBMessageReq > ns1:RetrieveLIMBMessageResp > ns1:RetrievePasswordChangeLIMBMessage > ns1:RetrievePersonalLIMBMessage > ns1:RetrieveTCPrivacyPolicyChangeLIMBMessage > ns1:Runner > ns1:SecurityQuestion1Enum > ns1:SecurityQuestion2Enum > ns1:SelfExcludeErrorEnum > ns1:SelfExcludeReq > ns1:SelfExcludeResp > ns1:ServiceCall > ns1:ServiceEnum > ns1:SetChatNameErrorEnum > ns1:SetChatNameReq > ns1:SetChatNameResp > ns0:Struct > ns1:SubmitAddressCheckLIMBMessage > ns1:SubmitBirthDateCheckLIMBMessage > ns1:SubmitCardBillingAddressCheckLIMBMessage > ns1:SubmitChatNameChangeLIMBMessage > ns1:SubmitContactDetailsCheckLIMBMessage > ns1:SubmitLIMBMessageErrorEnum > ns1:SubmitLIMBMessageReq > ns1:SubmitLIMBMessageResp > ns1:SubmitPasswordChangeLIMBMessage > ns1:SubmitPersonalLIMBMessage > ns1:SubmitTCPrivacyPolicyChangeLIMBMessage > ns1:Subscription > ns1:SubscriptionStatusEnum > ns1:TitleEnum > ns1:TransferFundsErrorEnum > ns1:TransferFundsReq > ns1:TransferFundsResp > ns1:UpdatePaymentCardErrorEnum > ns1:UpdatePaymentCardReq > ns1:UpdatePaymentCardResp > ns1:ValidationErrorsEnum > ns1:ViewProfileErrorEnum > ns1:ViewProfileReq > ns1:ViewProfileResp > ns1:ViewProfileV2Req > ns1:ViewProfileV2Resp > ns1:ViewReferAndEarnErrorEnum > ns1:ViewReferAndEarnReq > ns1:ViewReferAndEarnResp > ns1:WithdrawToPaymentCardReq > ns1:WithdrawToPaymentCardResp > ns0:anyURI > ns0:arrayCoordinate > ns0:base64 > ns0:base64Binary > ns0:boolean > ns0:byte > ns0:date > ns0:dateTime > ns0:decimal > ns0:double > ns0:duration > ns0:float > ns0:gDay > ns0:gMonth > ns0:gMonthDay > ns0:gYear > ns0:gYearMonth > ns0:hexBinary > ns0:int > ns0:integer > ns0:language > ns0:long > ns0:negativeInteger > ns0:nonNegativeInteger > ns0:nonPositiveInteger > ns0:normalizedString > ns0:positiveInteger > ns0:short > ns0:string > ns0:time > ns0:token > ns0:unsignedByte > ns0:unsignedInt > ns0:unsignedLong > ns0:unsignedShort > > > > Finished: errors = 0 > > > On 11/04/2009 10:44 AM, Alastair Irving wrote: >> Hi >> >> I'm very new to suds, so appologise in advance if I'm missing something >> obvious. I'm running version 0.3.7 under Windows with python 2.6. >> >> I tried running the following: >> >> from suds.client import Client >> c=Client('https://api.betfair.com/global/v3/BFGlobalService.wsdl') >> >> I got the following traceback: >> >> Traceback (most recent call last): >> File "", line 1, in >> File "build\bdist.win32\egg\suds\client.py", line 109, in __init__ >> File "build\bdist.win32\egg\suds\wsdl.py", line 194, in __init__ >> File "build\bdist.win32\egg\suds\wsdl.py", line 255, in build_schema >> File "build\bdist.win32\egg\suds\xsd\schema.py", line 90, in load >> File "build\bdist.win32\egg\suds\xsd\schema.py", line 277, in open_imports >> File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 608, in open >> File "build\bdist.win32\egg\suds\xsd\sxbasic.py", line 626, in download >> File "build\bdist.win32\egg\suds\sax\parser.py", line 134, in parse >> File "c:\Python26\lib\xml\sax\expatreader.py", line 107, in parse >> xmlreader.IncrementalParser.parse(self, source) >> File "c:\Python26\lib\xml\sax\xmlreader.py", line 123, in parse >> self.feed(buffer) >> File "c:\Python26\lib\xml\sax\expatreader.py", line 211, in feed >> self._err_handler.fatalError(exc) >> File "c:\Python26\lib\xml\sax\handler.py", line 38, in fatalError >> raise exception >> xml.sax._exceptions.SAXParseException: >> c:\docume~1\alasta~1\locals~1\temp\suds\s >> uds-649682136.http:10:2: mismatched tag >> >> The contents of the file refference by the last line are: >> >> > "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd"> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>

>> >> >> >> Something's clearly gone wrong as it surely shouldn't be fetching HTML >> files. However I think its unlikely that there would be a problem with >> the wsdl so I suspect its either a problem with suds or with my usage of >> it. >> >> Any help will be much appreciated. >> >> Alastair Irving >> >> >> >> >> >> >> _______________________________________________ >> fedora-suds-list mailing list >> fedora-suds-list at redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-suds-list From photon3 at gmail.com Fri Nov 6 08:02:20 2009 From: photon3 at gmail.com (Paul Nicolette) Date: Fri, 6 Nov 2009 03:02:20 -0500 Subject: [Fedora-suds-list] Soapenc: vs soap-enc: vs SOAP-ENC:? Message-ID: <5820dc680911060002y3ae5127ck79cbd6b5c924b059@mail.gmail.com> With SUDS 0.3.7 on Python 2.6.1, I need to uppercase the "soap-enc" in a local copy of http://njgin.state.nj.us/OIT_AddrMatch/OIT_AddrMatch?WSDLbefore it will find an Array type in the . Similar error when I try the mssoapinterop part of the test at http://svn.fedorahosted.org/svn/suds/tags/release-0.3.2/tests/public.py. I get *Type not found: '(Array, http://schemas.xmlsoap.org/soap/encoding/, )' *This WSDL uses "soapenc:Array" syntax. As a Python/SUDS newbie, is my installation wrong? I'm trying to use the doctors to fix things, but am struggling to understand how they work. Are there any examples with input and post-doc output?. I am extremely impressed by SUDS' capabilities, but my install seems not to be implementing Postel's Lawfor WSDLs, at least tonight! Any ideas will be much appreciated. Paul Nicolette -------------- next part -------------- An HTML attachment was scrubbed... URL: From jortel at redhat.com Fri Nov 6 14:55:49 2009 From: jortel at redhat.com (Jeff Ortel) Date: Fri, 06 Nov 2009 08:55:49 -0600 Subject: [Fedora-suds-list] Soapenc: vs soap-enc: vs SOAP-ENC:? In-Reply-To: <5820dc680911060002y3ae5127ck79cbd6b5c924b059@mail.gmail.com> References: <5820dc680911060002y3ae5127ck79cbd6b5c924b059@mail.gmail.com> Message-ID: <4AF438F5.7020904@redhat.com> On 11/06/2009 02:02 AM, Paul Nicolette wrote: > With SUDS 0.3.7 on Python 2.6.1, I need to uppercase the "soap-enc" in a > local copy of http://njgin.state.nj.us/OIT_AddrMatch/OIT_AddrMatch?WSDL > before it will find an Array type in the . I think your install is somehow not right. Where did you install from? I tried your wsdl with 0.3.7 and it seemed to parse the wsdl just find. See attached, "suds.txt" which is 0.3.8 beta but I got the same result with 0.3.7. In the example I essentially did: > > from suds.client import Client > print Client('http://njgin.state.nj.us/OIT_AddrMatch/OIT_AddrMatch?WSDL') > output attached: suds.txt Also, after looking at the wsdl, it maps prefix soap-enc correctly as follows: xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/". Can you be more specific about what your doing when you get the error and include more information about the error? > > Similar error when I try the mssoapinterop part of the test at > http://svn.fedorahosted.org/svn/suds/tags/release-0.3.2/tests/public.p > y. > I get /Type not found: '(Array, > http://schemas.xmlsoap.org/soap/encoding/, )' /This WSDL uses > "soapenc:Array" syntax. Sorry, the WIKI references the wrong version of public.py here. I've updated to point to the latest in trunk. > > As a Python/SUDS newbie, is my installation wrong? I'm trying to use > the doctors to fix things, but am struggling to understand how they > work. Are there any examples with input and post-doc output?. Yes, something seems wrong although I can't think of what it could be. Let's take things one step at a time. Based on my test, I don't know why you need to use the doctors. The WSDL seems ok. Are you using the doctor for the perceived Array problem above? If you use IRC, join #suds on FreeNode and we can work this out (jortel). Or, please include more info so we can work though this. > > I am extremely impressed by SUDS' capabilities, Thanks! but my install seems not > to be implementing Postel's Law > for WSDLs, at least > tonight! Any ideas will be much appreciated. Heh, yeah, seems that way. > > Paul Nicolette > > > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: suds.txt URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From photon3 at gmail.com Fri Nov 6 17:05:04 2009 From: photon3 at gmail.com (Paul Nicolette) Date: Fri, 6 Nov 2009 12:05:04 -0500 Subject: [Fedora-suds-list] Soapenc: vs soap-enc: vs SOAP-ENC:? In-Reply-To: <4AF438F5.7020904@redhat.com> References: <5820dc680911060002y3ae5127ck79cbd6b5c924b059@mail.gmail.com> <4AF438F5.7020904@redhat.com> Message-ID: <5820dc680911060905p15e11f64p6bf39a328455ac3a@mail.gmail.com> Jeff, Thanks for your gracious help to an embarrassed newbie. I'm running Portable Python 1.1 on Vista Home Premium with the 0.3.7 \suds tree extracted to \Lib. Using PyScripter 1.9.9.6 for IDE. My code: from suds.client import Client url = 'http://njgin.state.nj.us/OIT_AddrMatch/OIT_AddrMatch?WSDL' client = Client(url) print client With a cleared ...\temp\suds directory, I get [Dbg]>>> Traceback (most recent call last): File "", line 129, in run File "C:\PortablePython_1.1_py2.6.1\App\lib\bdb.py", line 368, in run exec cmd in globals, locals File "C:\Users\Staples\Documents\module2.py", line 3, in client = Client(url) File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\client.py", line 109, in __init__ self.wsdl = Definitions(url, options) File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 194, in __init__ self.build_schema() File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 255, in build_schema self.schema = container.load() File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line 90, in load child.open_imports() File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line 277, in open_imports imported = imp.open() File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line 608, in open result = self.download() File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line 626, in download root = Parser(transport).parse(url=url).root() File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\sax\parser.py", line 134, in parse sax.parse(fp) File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\expatreader.py", line 107, in parse xmlreader.IncrementalParser.parse(self, source) File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\xmlreader.py", line 123, in parse self.feed(buffer) File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\expatreader.py", line 211, in feed self._err_handler.fatalError(exc) File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\handler.py", line 38, in fatalError raise exception xml.sax._exceptions.SAXParseException: c:\users\staples\appdata\local\temp\suds\suds-649682136.http:10:2: mismatched tag Looked like Ticket #256. Not knowing better, I tried replacing the suds-649682136.http tempfile with some valid(?) innocuous(?) XML and making it read-only: After this change, I get [Dbg]>>> Traceback (most recent call last): File "", line 129, in run File "C:\PortablePython_1.1_py2.6.1\App\lib\bdb.py", line 368, in run exec cmd in globals, locals File "C:\Users\Staples\Documents\module2.py", line 3, in client = Client(url) File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\client.py", line 109, in __init__ self.wsdl = Definitions(url, options) File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 194, in __init__ self.build_schema() File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 255, in build_schema self.schema = container.load() File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line 92, in load child.dereference() File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line 295, in dereference midx, deps = x.dependencies() File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line 330, in dependencies raise TypeNotFound(self.ref) suds.TypeNotFound: Type not found: '(Array, http://schemas.xmlsoap.org/soap/encoding/, )' What would you suggest next? (When I copied the WSDL local and changed "soap-enc:" to "SOAP-ENC:" it went further but then I think it tried to open the real service URL as a local file and couldn't resolve the name for some reason ;-) I could try: a clean install of Python (but which version?) and properly install a newer suds library (but would need pathetically detailed instructions) and am even willing to replace my new best friend IDE with someone else (but who?), and then have no idea whether I might still catch: pandemic obscurebugitis. >>> > >> Similar error when I try the mssoapinterop part of the test at >> http://svn.fedorahosted.org/svn/suds/tags/release-0.3.2/tests/public.p >> > >y. >> >> I get /Type not found: '(Array, >> http://schemas.xmlsoap.org/soap/encoding/, )' /This WSDL uses >> "soapenc:Array" syntax. >> > > Sorry, the WIKI references the wrong version of public.py here. I've > updated to point to the latest in trunk. Thank you sir for all your help! Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcauthorn at gmail.com Fri Nov 6 17:30:26 2009 From: mcauthorn at gmail.com (Matt C) Date: Fri, 6 Nov 2009 12:30:26 -0500 Subject: Fwd: [Fedora-suds-list] Soapenc: vs soap-enc: vs SOAP-ENC:? In-Reply-To: <42ea979e0911060919y33b998b3ma9c470113d703cac@mail.gmail.com> References: <5820dc680911060002y3ae5127ck79cbd6b5c924b059@mail.gmail.com> <4AF438F5.7020904@redhat.com> <5820dc680911060905p15e11f64p6bf39a328455ac3a@mail.gmail.com> <42ea979e0911060919y33b998b3ma9c470113d703cac@mail.gmail.com> Message-ID: <42ea979e0911060930o63c189b9tfb2413ec8bb971cc@mail.gmail.com> Forgot to reply all here... Paul: I too was able to parse this wsdl without needing the doctor class: In [1]: url2 = 'http://njgin.state.nj.us/OIT_AddrMatch/OIT_AddrMatch?WSDL' In [2]: from suds.client import Client In [6]: c = Client(url2, cache = None) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (129, 0)) The error above ends with a stack trace for 'mismatched tag', which is one of the cache bugs you may run into. I simply run the same command again (no cache delete, etc. required): In [7]: c = Client(url2, cache = None) ?<<< client object successfully creates now. In [8]: print c Suds ( https://fedorahosted.org/suds/ ) ?version: 0.3.7 GA ?build: R580-20091016 Service ( OIT_AddrMatch ) tns="urn:OIT_AddrMatch/wsdl" ? Prefixes (2) ? ? ?ns0 = "http://schemas.xmlsoap.org/soap/encoding/" ? ? ?ns1 = "urn:OIT_AddrMatch/types" ? Ports (1): ? ? ?(OIT_AddrMatchRPCPort) ? ? ? ? Methods (1): ? ? ? ? ? ?getAddrMatch(ns1:AddrMatchIO AddrMatchIO_1, ) ? ? ? ? Types (50): ? ? ? ? ? ?ns1:AddrMatchIO ? ? ? ? ? ?ns0:Array ? ? ? ? ? ?ns1:ArrayOfAddrMatchIO ? ? ? ? ? ?ns0:ENTITIES ...Etc. So the short story: if you get that mismatched tag error, repeat the same command again and it should build. I got no import errors at all, so this should be clean aside from any cache issues. -Matt On Fri, Nov 6, 2009 at 12:05 PM, Paul Nicolette wrote: > Jeff, > Thanks for your gracious help to an embarrassed newbie. ?I'm running > Portable Python 1.1 on Vista Home Premium with the 0.3.7 \suds tree > extracted to \Lib. ?Using PyScripter 1.9.9.6 for IDE. > My code: > > from suds.client import Client > url = 'http://njgin.state.nj.us/OIT_AddrMatch/OIT_AddrMatch?WSDL' > client = Client(url) > print client > > With a cleared ...\temp\suds directory, I get > > [Dbg]>>> > Traceback (most recent call last): > ??File "", line 129, in run > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\bdb.py", line 368, in run > ?? ?exec cmd in globals, locals > ??File "C:\Users\Staples\Documents\module2.py", line 3, in > ?? ?client = Client(url) > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\client.py", line 109, in > __init__ > ?? ?self.wsdl = Definitions(url, options) > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 194, in > __init__ > ?? ?self.build_schema() > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 255, in > build_schema > ?? ?self.schema = container.load() > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line 90, > in load > ?? ?child.open_imports() > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line 277, > in open_imports > ?? ?imported = imp.open() > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line > 608, in open > ?? ?result = self.download() > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line > 626, in download > ?? ?root = Parser(transport).parse(url=url).root() > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\sax\parser.py", line 134, > in parse > ?? ?sax.parse(fp) > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\expatreader.py", line > 107, in parse > ?? ?xmlreader.IncrementalParser.parse(self, source) > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\xmlreader.py", line > 123, in parse > ?? ?self.feed(buffer) > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\expatreader.py", line > 211, in feed > ?? ?self._err_handler.fatalError(exc) > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\handler.py", line 38, > in fatalError > ?? ?raise exception > xml.sax._exceptions.SAXParseException: > c:\users\staples\appdata\local\temp\suds\suds-649682136.http:10:2: > mismatched tag > > Looked like Ticket #256. ?Not knowing better, I tried replacing the > suds-649682136.http tempfile with some valid(?) innocuous(?) XML and making > it read-only: > > > > > After this change, I get > > [Dbg]>>> > Traceback (most recent call last): > ??File "", line 129, in run > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\bdb.py", line 368, in run > ?? ?exec cmd in globals, locals > ??File "C:\Users\Staples\Documents\module2.py", line 3, in > ?? ?client = Client(url) > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\client.py", line 109, in > __init__ > ?? ?self.wsdl = Definitions(url, options) > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 194, in > __init__ > ?? ?self.build_schema() > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 255, in > build_schema > ?? ?self.schema = container.load() > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line 92, > in load > ?? ?child.dereference() > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line 295, > in dereference > ?? ?midx, deps = x.dependencies() > ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line > 330, in dependencies > ?? ?raise TypeNotFound(self.ref) > suds.TypeNotFound: Type not found: '(Array, > http://schemas.xmlsoap.org/soap/encoding/, )' > > What would you suggest next? ?(When I copied the WSDL local and changed > "soap-enc:" to "SOAP-ENC:" it went further but then I think it tried to open > the real service URL as a local file and couldn't resolve the name for some > reason ;-) > I could try: > ?? ?a clean install of Python (but which version?) and > ?? ?properly install a newer suds library (but would need pathetically > detailed instructions) and am even willing to > ?? ?replace my new best friend IDE with someone else (but who?), and then > have no idea whether I might still > catch: > ?? ?pandemic obscurebugitis. >>>> > >>> >>> Similar error when I try the mssoapinterop part of the test at >>> http://svn.fedorahosted.org/svn/suds/tags/release-0.3.2/tests/public.p >>> >>> y. >>> ? I get /Type not found: '(Array, >>> http://schemas.xmlsoap.org/soap/encoding/, )' /This WSDL uses >>> "soapenc:Array" syntax. >> >> Sorry, the WIKI references the wrong version of public.py here. ?I've >> updated to point to the latest in trunk. > > Thank you sir for all your help! > Paul > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list > From mcauthorn at gmail.com Fri Nov 6 17:33:32 2009 From: mcauthorn at gmail.com (Matt C) Date: Fri, 6 Nov 2009 12:33:32 -0500 Subject: [Fedora-suds-list] Persistent connections - anyone else interested / suggest howto / working on it? In-Reply-To: <4ADFC9BB.7090305@starfief.com> References: <4ADF1537.2090705@starfief.com> <6fae95540910211020v6960b339i3403351245dd7973@mail.gmail.com> <4ADF48A0.3040008@redhat.com> <4ADFC9BB.7090305@starfief.com> Message-ID: <42ea979e0911060933t135a0c90k34318e5904d398f4@mail.gmail.com> Twisted definitely takes some getting used to. That said, it's got some advantages that I'm very interested in using for a project later on down the road. For example, it's pretty easy to get at socket level options to, say, enable or disable TCP_NODELAY which can have performance implications for this type of traffic... I'll post anything useful that I come up with using twisted for transport. -Matt On Wed, Oct 21, 2009 at 9:55 PM, Rod Montgomery wrote: > Jeff Ortel wrote, On 10/21/2009 01:45 PM: >> >> On 10/21/2009 12:20 PM, Waldemar Osuch wrote: >>> >>> On Wed, Oct 21, 2009 at 8:05 AM, Rod Montgomery >>> wrote: >>>> >>>> Currently (i.e. r580 / 0.3.7 release candidate) Suds uses urllib2, which >>>> uses urllib, both from the standard Python library. >>>> >>>> I'm interested in making Suds able to use persistent connections. >>>> >>>> Twisted (twistedmatrix.com) seems to have an elaborate HTTP/1.1 Client >>> >>>> Another possibility is httplib2: >>> >>> Yes, it looks like the Client is using urllib2 by default but you should >>> be able to replace it with a custom transport. >>> >>> Client.options.transport = YourFancyPersistentConnection() >>> >>> As long as YourFancyPersistentConnection confirms to Transport interface >>> from suds.transport it should work. >> >> Yup. ?The transport functionality as factored out into the Transport >> (interface) and urllib2 based implementations for just this reason. > > Aha! That sounds promising! I had not grasped that from the Documentation. > Thanks! > >>> I think you will have more luck with httplib2 than Twisted version >>> unless you are versed in Twisted ways. > > You are now the second person who has warned me that Twisted may be more > challenging than I want. > >>> By the way you probably want: >>> http://httplib2.googlecode.com/files/httplib2-0.5.0.tar.gz >>> and not the Python3 version you have linked above. > > It seems httplib2 is also available in a repository from my Linux > distribution, Ubuntu. > > There is also apparently a urllib3, which also claims to be thread-safe: > > http://pypi.python.org/pypi/urllib3/0.2 > > I think I'll try both httplib2 and urllib3, and report my results back to > the List. > > Thanks for the prompt, informative responses! > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list > From photon3 at gmail.com Fri Nov 6 17:43:17 2009 From: photon3 at gmail.com (Paul Nicolette) Date: Fri, 6 Nov 2009 12:43:17 -0500 Subject: [Fedora-suds-list] Re: Soapenc: vs soap-enc: vs SOAP-ENC:? In-Reply-To: <42ea979e0911060919y33b998b3ma9c470113d703cac@mail.gmail.com> References: <5820dc680911060002y3ae5127ck79cbd6b5c924b059@mail.gmail.com> <4AF438F5.7020904@redhat.com> <5820dc680911060905p15e11f64p6bf39a328455ac3a@mail.gmail.com> <42ea979e0911060919y33b998b3ma9c470113d703cac@mail.gmail.com> Message-ID: <5820dc680911060943h33ebe677wf32cf6cb9e895eea@mail.gmail.com> Matt, Thanks for testing. Which versions of Python, Suds and OS platform did you use? Paul On 11/6/09, Matt C wrote: > Paul: I too was able to parse this wsdl without needing the doctor class: > > In [1]: url2 = 'http://njgin.state.nj.us/OIT_AddrMatch/OIT_AddrMatch?WSDL' > In [2]: from suds.client import Client > > In [6]: c = Client(url2, cache = None) > ERROR: An unexpected error occurred while tokenizing input > The following traceback may be corrupted or invalid > The error message is: ('EOF in multi-line statement', (129, 0)) > > The error above ends with a stack trace for 'mismatched tag', which is > one of the cache bugs you may run into. I simply run the same command > again (no cache delete, etc. required): > > In [7]: c = Client(url2, cache = None) <<< client object successfully > creates now. > > In [8]: print c > > Suds ( https://fedorahosted.org/suds/ ) version: 0.3.7 GA build: > R580-20091016 > > Service ( OIT_AddrMatch ) tns="urn:OIT_AddrMatch/wsdl" > Prefixes (2) > ns0 = "http://schemas.xmlsoap.org/soap/encoding/" > ns1 = "urn:OIT_AddrMatch/types" > Ports (1): > (OIT_AddrMatchRPCPort) > Methods (1): > getAddrMatch(ns1:AddrMatchIO AddrMatchIO_1, ) > Types (50): > ns1:AddrMatchIO > ns0:Array > ns1:ArrayOfAddrMatchIO > ns0:ENTITIES > > ...Etc. > > So the short story: if you get that mismatched tag error, repeat the > same command again and it should build. I got no import errors at all, > so this should be clean aside from any cache issues. > > -Matt > > On Fri, Nov 6, 2009 at 12:05 PM, Paul Nicolette wrote: >> Jeff, >> Thanks for your gracious help to an embarrassed newbie. ?I'm running >> Portable Python 1.1 on Vista Home Premium with the 0.3.7 \suds tree >> extracted to \Lib. ?Using PyScripter 1.9.9.6 for IDE. >> My code: >> >> from suds.client import Client >> url = 'http://njgin.state.nj.us/OIT_AddrMatch/OIT_AddrMatch?WSDL' >> client = Client(url) >> print client >> >> With a cleared ...\temp\suds directory, I get >> >> [Dbg]>>> >> Traceback (most recent call last): >> ??File "", line 129, in run >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\bdb.py", line 368, in run >> ?? ?exec cmd in globals, locals >> ??File "C:\Users\Staples\Documents\module2.py", line 3, in >> ?? ?client = Client(url) >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\client.py", line 109, >> in >> __init__ >> ?? ?self.wsdl = Definitions(url, options) >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 194, in >> __init__ >> ?? ?self.build_schema() >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 255, in >> build_schema >> ?? ?self.schema = container.load() >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line >> 90, >> in load >> ?? ?child.open_imports() >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line >> 277, >> in open_imports >> ?? ?imported = imp.open() >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line >> 608, in open >> ?? ?result = self.download() >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line >> 626, in download >> ?? ?root = Parser(transport).parse(url=url).root() >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\sax\parser.py", line >> 134, >> in parse >> ?? ?sax.parse(fp) >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\expatreader.py", >> line >> 107, in parse >> ?? ?xmlreader.IncrementalParser.parse(self, source) >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\xmlreader.py", line >> 123, in parse >> ?? ?self.feed(buffer) >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\expatreader.py", >> line >> 211, in feed >> ?? ?self._err_handler.fatalError(exc) >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\handler.py", line >> 38, >> in fatalError >> ?? ?raise exception >> xml.sax._exceptions.SAXParseException: >> c:\users\staples\appdata\local\temp\suds\suds-649682136.http:10:2: >> mismatched tag >> >> Looked like Ticket #256. ?Not knowing better, I tried replacing the >> suds-649682136.http tempfile with some valid(?) innocuous(?) XML and >> making >> it read-only: >> >> >> >> >> After this change, I get >> >> [Dbg]>>> >> Traceback (most recent call last): >> ??File "", line 129, in run >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\bdb.py", line 368, in run >> ?? ?exec cmd in globals, locals >> ??File "C:\Users\Staples\Documents\module2.py", line 3, in >> ?? ?client = Client(url) >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\client.py", line 109, >> in >> __init__ >> ?? ?self.wsdl = Definitions(url, options) >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 194, in >> __init__ >> ?? ?self.build_schema() >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 255, in >> build_schema >> ?? ?self.schema = container.load() >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line >> 92, >> in load >> ?? ?child.dereference() >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line >> 295, >> in dereference >> ?? ?midx, deps = x.dependencies() >> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line >> 330, in dependencies >> ?? ?raise TypeNotFound(self.ref) >> suds.TypeNotFound: Type not found: '(Array, >> http://schemas.xmlsoap.org/soap/encoding/, )' >> >> What would you suggest next? ?(When I copied the WSDL local and changed >> "soap-enc:" to "SOAP-ENC:" it went further but then I think it tried to >> open >> the real service URL as a local file and couldn't resolve the name for >> some >> reason ;-) >> I could try: >> ?? ?a clean install of Python (but which version?) and >> ?? ?properly install a newer suds library (but would need pathetically >> detailed instructions) and am even willing to >> ?? ?replace my new best friend IDE with someone else (but who?), and then >> have no idea whether I might still >> catch: >> ?? ?pandemic obscurebugitis. >>>>> >> >>>> >>>> Similar error when I try the mssoapinterop part of the test at >>>> http://svn.fedorahosted.org/svn/suds/tags/release-0.3.2/tests/public.p >>>> >>>> y. >>>> ? I get /Type not found: '(Array, >>>> http://schemas.xmlsoap.org/soap/encoding/, )' /This WSDL uses >>>> "soapenc:Array" syntax. >>> >>> Sorry, the WIKI references the wrong version of public.py here. ?I've >>> updated to point to the latest in trunk. >> >> Thank you sir for all your help! >> Paul >> _______________________________________________ >> fedora-suds-list mailing list >> fedora-suds-list at redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-suds-list >> > From Michael_Taylor at playstation.sony.com Fri Nov 6 19:13:10 2009 From: Michael_Taylor at playstation.sony.com (Michael_Taylor at playstation.sony.com) Date: Fri, 06 Nov 2009 11:13:10 -0800 Subject: [Fedora-suds-list] Persistent connections - anyone else interested / suggest howto / working on it? In-Reply-To: <42ea979e0911060933t135a0c90k34318e5904d398f4@mail.gmail.com> References: <4ADF1537.2090705@starfief.com> <6fae95540910211020v6960b339i3403351245dd7973@mail.gmail.com> <4ADF48A0.3040008@redhat.com> <4ADFC9BB.7090305@starfief.com> <42ea979e0911060933t135a0c90k34318e5904d398f4@mail.gmail.com> Message-ID: <4AF47546.3030509@playstation.sony.com> Matt, First a disclaimer, I too am not convinced that Twisted would be a good fit for creating persistent connections in suds. My reasoning is that I would assume suds is generally used from within other python projects (ie django), so adding the complication of running twisted inside another framework seems to be the wrong direction to go. However, if a project is already running on twisted, then being able to switch out the tcp connection to a twisted managed one might prove useful. I make use of twisted pretty extensively, so I'd be happy to help with any twisted questions you might have. To give you some insight, the class you're probably interested in for getting the TCPClient to automatically reconnect is twisted.internet.protocol.ReconnectingClientFactory. One thing I do when I make use of this class is set the maxDelay attribute to put a cap on the scaled back reconnects (or else the soap server may come up and you'll find yourself waiting up to the default of 3600 seconds before trying to reconnect again). In order to get at the underlying socket to set socket options, the following should help: The reactor.connectTCP (which internet.TCPClient is a wrapper around if your using the application framework) takes a factory (that produces protocols) and returns back a Connector (who was handed the factory through __init__). The Connector has a _makeTransport method which creates a new Client (which is the tcp client, the connector passes a handle to itself to the Client through __init__). Client asks the connector for a protocol via connector.buildProtocol, which delegates to the factory buildProtocol. The protocol returned by the factory allows you to grab it's underlying transport, which is actually an instance of a Connection. You can then set socket level options on this Connection. The proper way to set the socket options (at least as far as I've been able to tell) is to override the Protocol connectionMade method and set the options on the transport, ala (If I want to set set the tcp keepalive and keep alive interval for a socket): def connectionMade(self): # Set the keep alive. self.transport.setTcpKeepAlive(1) self.transport.socket.setsockopt(socket.SOL_TCP, socket.TCP_KEEPINTVL, 200) One thing to remember is that the reactor is a singleton, so you'll need to take into account the reactor already being started (again if suds is being used by code already running inside twisted). Feel free to run by me what you come up with for plugging twisted connections in and I'll see if I can add anything to it. Thanks, Mike Matt C wrote: > Twisted definitely takes some getting used to. That said, it's got > some advantages that I'm very interested in using for a project later > on down the road. For example, it's pretty easy to get at socket level > options to, say, enable or disable TCP_NODELAY which can have > performance implications for this type of traffic... > > I'll post anything useful that I come up with using twisted for transport. > > -Matt > > On Wed, Oct 21, 2009 at 9:55 PM, Rod Montgomery wrote: > >> Jeff Ortel wrote, On 10/21/2009 01:45 PM: >> >>> On 10/21/2009 12:20 PM, Waldemar Osuch wrote: >>> >>>> On Wed, Oct 21, 2009 at 8:05 AM, Rod Montgomery >>>> wrote: >>>> >>>>> Currently (i.e. r580 / 0.3.7 release candidate) Suds uses urllib2, which >>>>> uses urllib, both from the standard Python library. >>>>> >>>>> I'm interested in making Suds able to use persistent connections. >>>>> >>>>> Twisted (twistedmatrix.com) seems to have an elaborate HTTP/1.1 Client >>>>> >>>>> Another possibility is httplib2: >>>>> >>>> Yes, it looks like the Client is using urllib2 by default but you should >>>> be able to replace it with a custom transport. >>>> >>>> Client.options.transport = YourFancyPersistentConnection() >>>> >>>> As long as YourFancyPersistentConnection confirms to Transport interface >>>> from suds.transport it should work. >>>> >>> Yup. The transport functionality as factored out into the Transport >>> (interface) and urllib2 based implementations for just this reason. >>> >> Aha! That sounds promising! I had not grasped that from the Documentation. >> Thanks! >> >> >>>> I think you will have more luck with httplib2 than Twisted version >>>> unless you are versed in Twisted ways. >>>> >> You are now the second person who has warned me that Twisted may be more >> challenging than I want. >> >> >>>> By the way you probably want: >>>> http://httplib2.googlecode.com/files/httplib2-0.5.0.tar.gz >>>> and not the Python3 version you have linked above. >>>> >> It seems httplib2 is also available in a repository from my Linux >> distribution, Ubuntu. >> >> There is also apparently a urllib3, which also claims to be thread-safe: >> >> http://pypi.python.org/pypi/urllib3/0.2 >> >> I think I'll try both httplib2 and urllib3, and report my results back to >> the List. >> >> Thanks for the prompt, informative responses! >> >> _______________________________________________ >> 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 mcauthorn at gmail.com Fri Nov 6 20:22:58 2009 From: mcauthorn at gmail.com (Matt C) Date: Fri, 6 Nov 2009 15:22:58 -0500 Subject: [Fedora-suds-list] Re: Soapenc: vs soap-enc: vs SOAP-ENC:? In-Reply-To: <5820dc680911060943h33ebe677wf32cf6cb9e895eea@mail.gmail.com> References: <5820dc680911060002y3ae5127ck79cbd6b5c924b059@mail.gmail.com> <4AF438F5.7020904@redhat.com> <5820dc680911060905p15e11f64p6bf39a328455ac3a@mail.gmail.com> <42ea979e0911060919y33b998b3ma9c470113d703cac@mail.gmail.com> <5820dc680911060943h33ebe677wf32cf6cb9e895eea@mail.gmail.com> Message-ID: <42ea979e0911061222i11b96aben9b4580d4db818b05@mail.gmail.com> Python 2.5, suds 0.3.7 on Windows XP. On Fri, Nov 6, 2009 at 12:43 PM, Paul Nicolette wrote: > Matt, > > Thanks for testing. ?Which versions of Python, Suds and OS platform did you use? > > Paul > > On 11/6/09, Matt C wrote: >> Paul: I too was able to parse this wsdl without needing the doctor class: >> >> In [1]: url2 = 'http://njgin.state.nj.us/OIT_AddrMatch/OIT_AddrMatch?WSDL' >> In [2]: from suds.client import Client >> >> In [6]: c = Client(url2, cache = None) >> ERROR: An unexpected error occurred while tokenizing input >> The following traceback may be corrupted or invalid >> The error message is: ('EOF in multi-line statement', (129, 0)) >> >> The error above ends with a stack trace for 'mismatched tag', which is >> one of the cache bugs you may run into. I simply run the same command >> again (no cache delete, etc. required): >> >> In [7]: c = Client(url2, cache = None) ?<<< client object successfully >> creates now. >> >> In [8]: print c >> >> Suds ( https://fedorahosted.org/suds/ ) ?version: 0.3.7 GA ?build: >> R580-20091016 >> >> Service ( OIT_AddrMatch ) tns="urn:OIT_AddrMatch/wsdl" >> ? ?Prefixes (2) >> ? ? ? ns0 = "http://schemas.xmlsoap.org/soap/encoding/" >> ? ? ? ns1 = "urn:OIT_AddrMatch/types" >> ? ?Ports (1): >> ? ? ? (OIT_AddrMatchRPCPort) >> ? ? ? ? ?Methods (1): >> ? ? ? ? ? ? getAddrMatch(ns1:AddrMatchIO AddrMatchIO_1, ) >> ? ? ? ? ?Types (50): >> ? ? ? ? ? ? ns1:AddrMatchIO >> ? ? ? ? ? ? ns0:Array >> ? ? ? ? ? ? ns1:ArrayOfAddrMatchIO >> ? ? ? ? ? ? ns0:ENTITIES >> >> ...Etc. >> >> So the short story: if you get that mismatched tag error, repeat the >> same command again and it should build. I got no import errors at all, >> so this should be clean aside from any cache issues. >> >> -Matt >> >> On Fri, Nov 6, 2009 at 12:05 PM, Paul Nicolette wrote: >>> Jeff, >>> Thanks for your gracious help to an embarrassed newbie. ?I'm running >>> Portable Python 1.1 on Vista Home Premium with the 0.3.7 \suds tree >>> extracted to \Lib. ?Using PyScripter 1.9.9.6 for IDE. >>> My code: >>> >>> from suds.client import Client >>> url = 'http://njgin.state.nj.us/OIT_AddrMatch/OIT_AddrMatch?WSDL' >>> client = Client(url) >>> print client >>> >>> With a cleared ...\temp\suds directory, I get >>> >>> [Dbg]>>> >>> Traceback (most recent call last): >>> ??File "", line 129, in run >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\bdb.py", line 368, in run >>> ?? ?exec cmd in globals, locals >>> ??File "C:\Users\Staples\Documents\module2.py", line 3, in >>> ?? ?client = Client(url) >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\client.py", line 109, >>> in >>> __init__ >>> ?? ?self.wsdl = Definitions(url, options) >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 194, in >>> __init__ >>> ?? ?self.build_schema() >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 255, in >>> build_schema >>> ?? ?self.schema = container.load() >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line >>> 90, >>> in load >>> ?? ?child.open_imports() >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line >>> 277, >>> in open_imports >>> ?? ?imported = imp.open() >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line >>> 608, in open >>> ?? ?result = self.download() >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line >>> 626, in download >>> ?? ?root = Parser(transport).parse(url=url).root() >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\sax\parser.py", line >>> 134, >>> in parse >>> ?? ?sax.parse(fp) >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\expatreader.py", >>> line >>> 107, in parse >>> ?? ?xmlreader.IncrementalParser.parse(self, source) >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\xmlreader.py", line >>> 123, in parse >>> ?? ?self.feed(buffer) >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\expatreader.py", >>> line >>> 211, in feed >>> ?? ?self._err_handler.fatalError(exc) >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\xml\sax\handler.py", line >>> 38, >>> in fatalError >>> ?? ?raise exception >>> xml.sax._exceptions.SAXParseException: >>> c:\users\staples\appdata\local\temp\suds\suds-649682136.http:10:2: >>> mismatched tag >>> >>> Looked like Ticket #256. ?Not knowing better, I tried replacing the >>> suds-649682136.http tempfile with some valid(?) innocuous(?) XML and >>> making >>> it read-only: >>> >>> >>> >>> >>> After this change, I get >>> >>> [Dbg]>>> >>> Traceback (most recent call last): >>> ??File "", line 129, in run >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\bdb.py", line 368, in run >>> ?? ?exec cmd in globals, locals >>> ??File "C:\Users\Staples\Documents\module2.py", line 3, in >>> ?? ?client = Client(url) >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\client.py", line 109, >>> in >>> __init__ >>> ?? ?self.wsdl = Definitions(url, options) >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 194, in >>> __init__ >>> ?? ?self.build_schema() >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\wsdl.py", line 255, in >>> build_schema >>> ?? ?self.schema = container.load() >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line >>> 92, >>> in load >>> ?? ?child.dereference() >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\schema.py", line >>> 295, >>> in dereference >>> ?? ?midx, deps = x.dependencies() >>> ??File "C:\PortablePython_1.1_py2.6.1\App\lib\suds\xsd\sxbasic.py", line >>> 330, in dependencies >>> ?? ?raise TypeNotFound(self.ref) >>> suds.TypeNotFound: Type not found: '(Array, >>> http://schemas.xmlsoap.org/soap/encoding/, )' >>> >>> What would you suggest next? ?(When I copied the WSDL local and changed >>> "soap-enc:" to "SOAP-ENC:" it went further but then I think it tried to >>> open >>> the real service URL as a local file and couldn't resolve the name for >>> some >>> reason ;-) >>> I could try: >>> ?? ?a clean install of Python (but which version?) and >>> ?? ?properly install a newer suds library (but would need pathetically >>> detailed instructions) and am even willing to >>> ?? ?replace my new best friend IDE with someone else (but who?), and then >>> have no idea whether I might still >>> catch: >>> ?? ?pandemic obscurebugitis. >>>>>> >>> >>>>> >>>>> Similar error when I try the mssoapinterop part of the test at >>>>> http://svn.fedorahosted.org/svn/suds/tags/release-0.3.2/tests/public.p >>>>> >>>>> y. >>>>> ? I get /Type not found: '(Array, >>>>> http://schemas.xmlsoap.org/soap/encoding/, )' /This WSDL uses >>>>> "soapenc:Array" syntax. >>>> >>>> Sorry, the WIKI references the wrong version of public.py here. ?I've >>>> updated to point to the latest in trunk. >>> >>> Thank you sir for all your help! >>> Paul >>> _______________________________________________ >>> 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 Fri Nov 6 21:41:43 2009 From: jortel at redhat.com (Jeff Ortel) Date: Fri, 06 Nov 2009 15:41:43 -0600 Subject: [Fedora-suds-list] better soap encoded Arrays in 0.3.8 Message-ID: <4AF49817.50809@redhat.com> All, I've always thought that soap (section 5) encoded arrays support in suds could stand much improvement. The delay in doing this improvement has been due to priorities and a belief that most of the web services providers were moving quickly towards document/literal services and that rpc/encoded was going away. Anyway, after a few years now rpc/encoded services are still very prevalent so time to make this better :) So, 0.3.8 contains the following improvements: * Arrays may be passed as parameters and nested object attributes using simple python list|tuple. Although it is still supported, users no longer need to use the Client.Factory.create() to create encoded array objects. * soap-enc:arrayType attribute on soap messages now supported and added to array elements in the soap message. Eg: rover 3 rover 3 * Arrays work for rpc/encoded services work the same way as they have in document/literal services since the beginning of suds. For ex: version <= 0.3.7 > > client = Client(url) > array = client.factory.create('ns0:ArrayOfInt') > array.item = [10, 20] > client.foo(array) > version 0.3.8 (beta) r592+ supports the above plus: > > client = Client(url) > client.foo([10, 20]) > Or, > > client = Client(url) > dogs = [] > dog = client.factory.create('ns0:Dog') > dog.name = 'rover' > dog.age = 3 > dogs.append(dog) > dog = client.factory.create('ns0:Dog') > dog.name = 'fido' > dog.age = 5 > dogs.append(dog) > client.foo(dogs) > Or, > > client = Client(url) > person = client.factory.create('ns0:Person') > dogs = [] > dog = client.factory.create('ns0:Dog') > dog.name = 'rover' > dog.age = 3 > dogs.append(dog) > dog = client.factory.create('ns0:Dog') > dog.name = 'fido' > dog.age = 7 > dogs.append(dog) > person.dogs = dogs > client.foo(person) > I've tested against my (axis1,axis2 & jboss) servers. Also, tested against public.py. Hope you find this helpful. Regards, Jeff -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From stecuratti at tiscali.it Thu Nov 12 16:28:16 2009 From: stecuratti at tiscali.it (stecuratti at tiscali.it) Date: Thu, 12 Nov 2009 17:28:16 +0100 (CET) Subject: [Fedora-suds-list] suds removing whitespaces Message-ID: <11159188.157931258043296910.JavaMail.defaultUser@defaultHost> Hello there, i'm having some problems with suds client: when i try to get a string from from a particular web service, all leading and following withespaces are omitted. Here's an example: client=Client ('http://www.pdb.org/pdb/services/pdbws?wsdl') print client.service. getKabschSander('103M','A') Result is 'HHHHHHHHHHHHHHGGGHHHHHHHHHHHHHHH GGGGGG TTTTT SHHHHHH HHHHHHHHHHHHHHHHHHHTTT HHHHHHHHHHHHHTS HHHHHHHHHHHHHHHHHH GGG HHHHHHHHHHHHHHHHHHHHHHHHTT' but it should be ' HHHHHHHHHHHHHHGGGHHHHHHHHHHHHHHH GGGGGG TTTTT SHHHHHH HHHHHHHHHHHHHHHHHHHTTT HHHHHHHHHHHHHTS HHHHHHHHHHHHHHHHHH GGG HHHHHHHHHHHHHHHHHHHHHHHHTT ' I'm quite new to wsdl, and to be honest i'd like to avoid getting into it (that's why i'm using suds)... hope someone can help, thanks and regards Stefano Passa a Tiscali Tutto Incluso Light: telefono + adsl 8 Mb senza limiti a soli 9,95 euro al mese fino al 01/04/2010. Gratis la Sim Tiscali Mobile con 25 euro di traffico. L?offerta ? valida solo se attivi entro il 12/11/09 http://abbonati.tiscali.it/telefono-adsl/prodotti/tc/tuttoincluso_light/?WT.mc_id=01fw From mcauthorn at gmail.com Sat Nov 14 14:44:58 2009 From: mcauthorn at gmail.com (Matt C) Date: Sat, 14 Nov 2009 09:44:58 -0500 Subject: [Fedora-suds-list] Status of clone() Message-ID: <42ea979e0911140644vf209433ya2da939d7c105ba2@mail.gmail.com> All: does anyone know the status of Client().clone()? I see some activity lately but the warnings on its use are still in place. Just curious, as this is an extremely attractive feature for me at this point :). -Matt From jortel at redhat.com Mon Nov 16 14:12:01 2009 From: jortel at redhat.com (Jeff Ortel) Date: Mon, 16 Nov 2009 08:12:01 -0600 Subject: [Fedora-suds-list] Status of clone() In-Reply-To: <42ea979e0911140644vf209433ya2da939d7c105ba2@mail.gmail.com> References: <42ea979e0911140644vf209433ya2da939d7c105ba2@mail.gmail.com> Message-ID: <4B015DB1.1010600@redhat.com> Hey Matt, The Client.clone() method is complete in 0.3.8. In 0.3.7, the ''self.messages'' attribute is missing. -jeff On 11/14/2009 08:44 AM, Matt C wrote: > All: does anyone know the status of Client().clone()? I see some > activity lately but the warnings on its use are still in place. Just > curious, as this is an extremely attractive feature for me at this > point :). > > -Matt > > _______________________________________________ > 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From mcauthorn at gmail.com Tue Nov 17 18:41:05 2009 From: mcauthorn at gmail.com (Matt C) Date: Tue, 17 Nov 2009 13:41:05 -0500 Subject: [Fedora-suds-list] Return type challenge Message-ID: <42ea979e0911171041n26710474xc4b48f60a3b4f091@mail.gmail.com> All - I've got some return types coming back from a service that get fairly deep (this is a smaller example): (Array){ item[] = (item){ item[] = (item){ address[] = "1.2.3.4", port[] = "80", }, }, (item){ item[] = (item){ address[] = "10.20.20.10", port[] = "80", }, (item){ address[] = "10.20.20.11", port[] = "80", }, (item){ address[] = "10.20.20.12", port[] = "80", }, }, } Do any of you know an easy way to "flatten" this structure into normal python types? Ideally I'd like to convert it to: [ [{'address':'1.2.3.4', 'port':80}], [{'address': '10.20.20.10', 'port': 80}, {'address': '10.20.20.11', 'port': 80}, {'address': '10.20.20.12', 'port':80}] ] I figured I'd ask the group before I went and reinvented a wheel. -Matt From JG6871 at att.com Tue Nov 17 18:44:19 2009 From: JG6871 at att.com (GLADE, JEFFREY (ATTSI)) Date: Tue, 17 Nov 2009 13:44:19 -0500 Subject: [Fedora-suds-list] Same as ticket #262 Message-ID: I am having the same issue as ticket #262, but there haven't been any solutions posted. Can you please tell me how to use either progressWorkflowAction or the updateIssue function? They both are giving me the SAXException. -Jeffrey -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcauthorn at gmail.com Tue Nov 17 18:47:59 2009 From: mcauthorn at gmail.com (Matt C) Date: Tue, 17 Nov 2009 13:47:59 -0500 Subject: [Fedora-suds-list] Status of clone() In-Reply-To: <4B015DB1.1010600@redhat.com> References: <42ea979e0911140644vf209433ya2da939d7c105ba2@mail.gmail.com> <4B015DB1.1010600@redhat.com> Message-ID: <42ea979e0911171047v23630e94wb02fefc9ce90b113@mail.gmail.com> Thanks Jeff. It sure seemed so, but I saw the warnings in the code and wanted to ask. Thanks for the killer feature - really useful. -Matt On Mon, Nov 16, 2009 at 9:12 AM, Jeff Ortel wrote: > Hey Matt, > > The Client.clone() method is complete in 0.3.8. ?In 0.3.7, the > ''self.messages'' attribute is missing. > > -jeff > > On 11/14/2009 08:44 AM, Matt C wrote: >> >> All: does anyone know the status of Client().clone()? I see some >> activity lately but the warnings on its use are still in place. Just >> curious, as this is an extremely attractive feature for me at this >> point :). >> >> -Matt >> >> _______________________________________________ >> 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 jortel at redhat.com Tue Nov 17 20:17:27 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 17 Nov 2009 14:17:27 -0600 Subject: [Fedora-suds-list] Same as ticket #262 In-Reply-To: References: Message-ID: <4B0304D7.8070808@redhat.com> Jeffrey, I enhanced the rpc/encoded as described in https://fedorahosted.org/suds/ticket/262#comment:1 about 2 weeks ago in 0.3.8. The initial commit for this is r593. I still need to run a few tests to see if I can pass dict instead of suds objects created with the factory for complex objects but the array stuff has been simplified to work like document/literal. On 11/17/2009 12:44 PM, GLADE, JEFFREY (ATTSI) wrote: > I am having the same issue as ticket #262, but there haven?t been any > solutions posted. Can you please tell me how to use either > progressWorkflowAction or the updateIssue function? They both are giving > me the SAXException. > > -Jeffrey > > > > _______________________________________________ > 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From jortel at redhat.com Tue Nov 17 21:06:31 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 17 Nov 2009 15:06:31 -0600 Subject: [Fedora-suds-list] Status of clone() In-Reply-To: <42ea979e0911171047v23630e94wb02fefc9ce90b113@mail.gmail.com> References: <42ea979e0911140644vf209433ya2da939d7c105ba2@mail.gmail.com> <4B015DB1.1010600@redhat.com> <42ea979e0911171047v23630e94wb02fefc9ce90b113@mail.gmail.com> Message-ID: <4B031057.7020205@redhat.com> I'll remove the warning in the epydocs. On 11/17/2009 12:47 PM, Matt C wrote: > Thanks Jeff. It sure seemed so, but I saw the warnings in the code and > wanted to ask. Thanks for the killer feature - really useful. You're welcome. > > -Matt > > On Mon, Nov 16, 2009 at 9:12 AM, Jeff Ortel wrote: >> Hey Matt, >> >> The Client.clone() method is complete in 0.3.8. In 0.3.7, the >> ''self.messages'' attribute is missing. >> >> -jeff >> >> On 11/14/2009 08:44 AM, Matt C wrote: >>> >>> All: does anyone know the status of Client().clone()? I see some >>> activity lately but the warnings on its use are still in place. Just >>> curious, as this is an extremely attractive feature for me at this >>> point :). >>> >>> -Matt >>> >>> _______________________________________________ >>> 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 >> -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From jortel at redhat.com Wed Nov 18 15:50:31 2009 From: jortel at redhat.com (Jeff Ortel) Date: Wed, 18 Nov 2009 09:50:31 -0600 Subject: [Fedora-suds-list] suds removing whitespaces In-Reply-To: <11159188.157931258043296910.JavaMail.defaultUser@defaultHost> References: <11159188.157931258043296910.JavaMail.defaultUser@defaultHost> Message-ID: <4B0417C7.6030204@redhat.com> Hey Stefano, I'm not surprised. Suds trims leading and trailing whitespace to account for formatted XML. I'll add an option so you can turn it off if you want. Regards, Jeff On 11/12/2009 10:28 AM, stecuratti at tiscali.it wrote: > Hello there, > i'm having some problems with suds client: when i try to > get a string from from a particular web service, all leading and > following withespaces are omitted. > > Here's an example: > > client=Client > ('http://www.pdb.org/pdb/services/pdbws?wsdl') > print client.service. > getKabschSander('103M','A') > > > Result is > > 'HHHHHHHHHHHHHHGGGHHHHHHHHHHHHHHH GGGGGG TTTTT SHHHHHH > HHHHHHHHHHHHHHHHHHHTTT HHHHHHHHHHHHHTS HHHHHHHHHHHHHHHHHH GGG > HHHHHHHHHHHHHHHHHHHHHHHHTT' > > but it should be > ' > HHHHHHHHHHHHHHGGGHHHHHHHHHHHHHHH GGGGGG TTTTT SHHHHHH > HHHHHHHHHHHHHHHHHHHTTT HHHHHHHHHHHHHTS HHHHHHHHHHHHHHHHHH GGG > HHHHHHHHHHHHHHHHHHHHHHHHTT ' > > I'm quite new to wsdl, and to be honest > i'd like to avoid getting into it (that's why i'm using suds)... > > hope > someone can help, > thanks and regards > Stefano > > > > > > Passa a Tiscali Tutto Incluso Light: telefono + adsl 8 Mb senza limiti a soli 9,95 euro al mese fino al 01/04/2010. Gratis la Sim Tiscali Mobile con 25 euro di traffico. > > L???offerta ?? valida solo se attivi entro il 12/11/09 > > http://abbonati.tiscali.it/telefono-adsl/prodotti/tc/tuttoincluso_light/?WT.mc_id=01fw > > _______________________________________________ > 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From sommersd at nimssc.net Wed Nov 18 20:44:38 2009 From: sommersd at nimssc.net (Dan Sommers) Date: Wed, 18 Nov 2009 15:44:38 -0500 Subject: [Fedora-suds-list] Complex Return Types (Again?) Message-ID: <20091118204438.GF17031@sommersd.nimssc.lan> Greetings, I'm calling a web service whose return value is a complex type, and I'm trying to recover the "original" XML from the SOAP response rather than the python object (so that I can store that XML in my database for further analysis later). I thumbed through the archives, and found these: https://www.redhat.com/archives/fedora-suds-list/2009-November/msg00021.html, https://www.redhat.com/archives/fedora-suds-list/2009-September/msg00009.html, https://www.redhat.com/archives/fedora-suds-list/2009-August/msg00022.html, https://www.redhat.com/archives/fedora-suds-list/2009-August/msg00022.html but no real solution. I can recover something close by calling last_received method of the client, or equivalently by setting the retxml option of the client, but I'm having an awful time fixing up all of the namespaces and getting rid of the elements with xsi:nil="true" attributes. Is there a (simple?) solution to this issue? I can provide WSDL and an actual SOAP response if that would help, but I think that this is a generic issue (and I'd certainly like to solve it that way). It would seem that if suds can parse WSDL and SOAP messages, then there should be enough infrastructure to recover the XML from the server. (In fact, it seems that suds almost has to recover that XML in order to build the python object that it does.) Or maybe it's just easy for me to say that because I'm relatively new at SOAP. ;-) Thanks, Dan From jortel at redhat.com Wed Nov 18 23:29:00 2009 From: jortel at redhat.com (Jeff Ortel) Date: Wed, 18 Nov 2009 17:29:00 -0600 Subject: [Fedora-suds-list] Complex Return Types (Again?) In-Reply-To: <20091118204438.GF17031@sommersd.nimssc.lan> References: <20091118204438.GF17031@sommersd.nimssc.lan> Message-ID: <4B04833C.3030301@redhat.com> On 11/18/2009 02:44 PM, Dan Sommers wrote: > Greetings, Hey Dan :) > > I'm calling a web service whose return value is a complex type, and I'm > trying to recover the "original" XML from the SOAP response rather than > the python object (so that I can store that XML in my database for > further analysis later). I thumbed through the archives, and found > these: > > https://www.redhat.com/archives/fedora-suds-list/2009-November/msg00021.html, > https://www.redhat.com/archives/fedora-suds-list/2009-September/msg00009.html, > https://www.redhat.com/archives/fedora-suds-list/2009-August/msg00022.html, > https://www.redhat.com/archives/fedora-suds-list/2009-August/msg00022.html > > but no real solution. > > I can recover something close by calling last_received method of the > client, or equivalently by setting the retxml option of the client, but > I'm having an awful time fixing up all of the namespaces and getting rid > of the elements with xsi:nil="true" attributes. Both last_received() and using setting the 'retxml' option results in giving you access to the sax parsed XML returned by the server. The suds.sax.element.Element object can be easily converted to a string for storage by: d = client.last_received() s = str(d) client.set_options(retxml=True) d = client.service.foo() s = str(d) but, I'm assuming that is somehow not what you're looking for. Can you be more specific about how this does not meet you needs? Is it because the str() of the DOM tree is a reconstruction of the string XML and not the raw string XML? There should be almost no difference them. Also, won't you have the same problems with: > I'm having an awful time fixing up all of the namespaces and getting rid > of the elements with xsi:nil="true" attributes. even if you had the raw string XML? > > Is there a (simple?) solution to this issue? I can provide WSDL and an > actual SOAP response if that would help, but I think that this is a > generic issue (and I'd certainly like to solve it that way). Generic, yes. That is where the two methods for getting the returned XML you mentioned above came from. > > It would seem that if suds can parse WSDL and SOAP messages, then there > should be enough infrastructure to recover the XML from the server. (In > fact, it seems that suds almost has to recover that XML in order to > build the python object that it does.) Or maybe it's just easy for me > to say that because I'm relatively new at SOAP. ;-) The exact XML (stream) returned by the server is consumed by the sax parser (inline) and isn't really available. To capture it, I would have to read the entire document into memory then sax parse the string. > > Thanks, > Dan > > _______________________________________________ > 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From waldemar.osuch at gmail.com Thu Nov 19 00:10:37 2009 From: waldemar.osuch at gmail.com (Waldemar Osuch) Date: Wed, 18 Nov 2009 17:10:37 -0700 Subject: [Fedora-suds-list] Complex Return Types (Again?) In-Reply-To: <20091118204438.GF17031@sommersd.nimssc.lan> References: <20091118204438.GF17031@sommersd.nimssc.lan> Message-ID: <6fae95540911181610j2ba69bb8pbd8e9cac19270ddb@mail.gmail.com> On Wed, Nov 18, 2009 at 1:44 PM, Dan Sommers wrote: > Greetings, > > I'm calling a web service whose return value is a complex type, and I'm > trying to recover the "original" XML from the SOAP response rather than > the python object (so that I can store that XML in my database for > further analysis later). If you really, really have to have the xml in the raw form maybe you should look into a different library. Before suds came along (thanks Jeff) I have been successfully using elementsoap by effbot http://effbot.org/zone/element-soap.htm. It is much lower level library than suds (no WSDL processing) but you have full control over what is happening. Waldemar From bwatts at modeln.com Thu Nov 19 02:18:58 2009 From: bwatts at modeln.com (Bill Watts) Date: Wed, 18 Nov 2009 18:18:58 -0800 Subject: [Fedora-suds-list] How to set SOAP-ENC:arrayType Message-ID: <5E8088E28550E0458987B1D7B738719E077C91A0@hdqmail1.modeln.com> Hi, I have been using suds for about a week now, and I am very impressed with the capabilities and ease of use of this API. Outstanding work! I am using suds to work with a fairly complex WSDL, and have almost everything working, with the exception of the arrayType encoding. I downloaded and installed the beta of 0.3.8 because I saw a posting stating that the beta supports setting the arrayType. After spending a couple of hours grepping through the code and trying different things, I am still unable to determine how to set the arrayType. I can make successful requests using SoapUi, and the section I am trying to generate looks like this: owner_id 321 The API is generating: owner_id 321 Here is my code: def createParameter(client, name, value): item = client.factory.create('parameterValue') item.name = name item.value = client.factory.create('SOAP-ENC:Array') spvi = client.factory.create('simpleParmValueItem') spvi.use = value item.value.item = [spvi] The WSDL is almost 1MB, so I won't include it here. Any help is very much appreciated. Thanks, -Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: From sommersd at nimssc.net Thu Nov 19 12:54:01 2009 From: sommersd at nimssc.net (Dan Sommers) Date: Thu, 19 Nov 2009 07:54:01 -0500 Subject: [Fedora-suds-list] Complex Return Types (Again?) In-Reply-To: <4B04833C.3030301@redhat.com> References: <20091118204438.GF17031@sommersd.nimssc.lan> <4B04833C.3030301@redhat.com> Message-ID: <20091119125401.GG17031@sommersd.nimssc.lan> On 2009-11-18 at 17:29:00 -0600, Jeff Ortel wrote: > On 11/18/2009 02:44 PM, Dan Sommers wrote: > d = client.last_received() > s = str(d) That was my first try, and it worked smashingly until one of my users found some XML that contained an ampersand ("&") and a less than symbol ("<") within its text nodes. Somewhere in there, suds decoded the entities twice, and str returned ill-formed XML (i.e., XML containing actual ampersands and less than symbols in its text nodes instead of "&"s and "<"s). > client.set_options(retxml=True) > d = client.service.foo() > s = str(d) That's what my code looks like now, but without that last string conversion (which apparently triggers that extra level of decoding?): client.set_options( retxml = True ) s = client.service.foo( ... ) x = lxml.etree.XML( s ) ... > ... Also, won't you have the same problems with: > > > I'm having an awful time fixing up all of the namespaces and getting > > rid of the elements with xsi:nil="true" attributes. > > even if you had the raw string XML? My tactical mistake was prematurely extracting an XML fragment from the response and losing an essential xmlns attribute or three. Oops. ;-) So now I take the *whole* response (i.e., the soapenv:Envelope element) and run it through an XSL transform that pulls out the fragment I need, re-wraps that fragment in a new element, and removes elements with xsi:nil="true" attributes. The namespace issue went away once I fixed my approach. > The exact XML (stream) returned by the server is consumed by the sax > parser (inline) and isn't really available. To capture it, I would > have to read the entire document into memory then sax parse the > string. What you're doing is definitely the right approach (not that you need my approval!). My use of the word "original" referred to the character entity issue I described above. Thank you, for both suds and your reply. Dan From jortel at redhat.com Thu Nov 19 14:49:34 2009 From: jortel at redhat.com (Jeff Ortel) Date: Thu, 19 Nov 2009 08:49:34 -0600 Subject: [Fedora-suds-list] Complex Return Types (Again?) In-Reply-To: <20091119125401.GG17031@sommersd.nimssc.lan> References: <20091118204438.GF17031@sommersd.nimssc.lan> <4B04833C.3030301@redhat.com> <20091119125401.GG17031@sommersd.nimssc.lan> Message-ID: <4B055AFE.3030101@redhat.com> On 11/19/2009 06:54 AM, Dan Sommers wrote: > On 2009-11-18 at 17:29:00 -0600, > Jeff Ortel wrote: > >> On 11/18/2009 02:44 PM, Dan Sommers wrote: > >> d = client.last_received() >> s = str(d) > > That was my first try, and it worked smashingly until one of my users > found some XML that contained an ampersand ("&") and a less than symbol > ("<") within its text nodes. Somewhere in there, suds decoded the > entities twice, and str returned ill-formed XML (i.e., XML containing > actual ampersands and less than symbols in its text nodes instead of > "&"s and "<"s). Ah, very interesting. Let's fix this! Can you send me sample XML that the suds sax package does not handle correctly? Also, what version of suds are you using? > >> client.set_options(retxml=True) >> d = client.service.foo() >> s = str(d) > > That's what my code looks like now, but without that last string > conversion (which apparently triggers that extra level of decoding?): > > client.set_options( retxml = True ) > s = client.service.foo( ... ) > x = lxml.etree.XML( s ) > ... > >> ... Also, won't you have the same problems with: >> >>> I'm having an awful time fixing up all of the namespaces and getting >>> rid of the elements with xsi:nil="true" attributes. >> >> even if you had the raw string XML? > > My tactical mistake was prematurely extracting an XML fragment from the > response and losing an essential xmlns attribute or three. Oops. ;-) > > So now I take the *whole* response (i.e., the soapenv:Envelope element) > and run it through an XSL transform that pulls out the fragment I need, > re-wraps that fragment in a new element, and removes elements with > xsi:nil="true" attributes. The namespace issue went away once I fixed > my approach. > >> The exact XML (stream) returned by the server is consumed by the sax >> parser (inline) and isn't really available. To capture it, I would >> have to read the entire document into memory then sax parse the >> string. > > What you're doing is definitely the right approach (not that you need my > approval!). My use of the word "original" referred to the character > entity issue I described above. > > Thank you, for both suds and your reply. > > Dan -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From jortel at redhat.com Thu Nov 19 15:05:55 2009 From: jortel at redhat.com (Jeff Ortel) Date: Thu, 19 Nov 2009 09:05:55 -0600 Subject: [Fedora-suds-list] How to set SOAP-ENC:arrayType In-Reply-To: <5E8088E28550E0458987B1D7B738719E077C91A0@hdqmail1.modeln.com> References: <5E8088E28550E0458987B1D7B738719E077C91A0@hdqmail1.modeln.com> Message-ID: <4B055ED3.6040904@redhat.com> Hey Bill - On 11/18/2009 08:18 PM, Bill Watts wrote: > Hi, > > I have been using suds for about a week now, and I am very impressed > with the capabilities and ease of use of this API. Outstanding work! Thanks :) > > I am using suds to work with a fairly complex WSDL, and have almost > everything working, with the exception of the arrayType encoding. I > downloaded and installed the beta of 0.3.8 because I saw a posting > stating that the beta supports setting the arrayType. After spending a > couple of hours grepping through the code and trying different things, I > am still unable to determine how to set the arrayType. > > I can make successful requests using SoapUi, and the section I am trying > to generate looks like this: > > > > owner_id > > > > > > 321 > > > > > > > > The API is generating: > > > > owner_id > > > > > > > > > > 321 > > > > > > The enhancements discussed in 0.3.8 are not yet included in the documentation (looks like I need to get it updated). What you're doing here is correct according to the documentation but does not take advantage of the 0.3.8 enhancements. Based on your code and without seeing the WSDL, I'd suggest (think) you want to do: def createParameter(client, name, value): item = client.factory.create('parameterValue') item.name = name spvi = client.factory.create('simpleParmValueItem') spvi.use = value item.value = [spvi] In the 0.3.8 rpc/encoded enhancement, you no longer want (or need to) create the SOAP-ENC:Array. You can also join me on IRC FreeNode #suds and we can discuss further. > > Here is my code: > > def createParameter(client, name, value): > > item = client.factory.create('parameterValue') > > item.name = name > > item.value = client.factory.create('SOAP-ENC:Array') > > spvi = client.factory.create('simpleParmValueItem') > > spvi.use = value > > item.value.item = [spvi] > > The WSDL is almost 1MB, so I won?t include it here. Any help is very > much appreciated. > > Thanks, > > -Bill > > > > _______________________________________________ > 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From sommersd at nimssc.net Thu Nov 19 16:50:46 2009 From: sommersd at nimssc.net (Dan Sommers) Date: Thu, 19 Nov 2009 11:50:46 -0500 Subject: [Fedora-suds-list] Complex Return Types (Again?) In-Reply-To: <4B055AFE.3030101@redhat.com> References: <20091118204438.GF17031@sommersd.nimssc.lan> <4B04833C.3030301@redhat.com> <20091119125401.GG17031@sommersd.nimssc.lan> <4B055AFE.3030101@redhat.com> Message-ID: <20091119165046.GH17031@sommersd.nimssc.lan> On 2009-11-19 at 08:49:34 -0600, Jeff Ortel wrote: > On 11/19/2009 06:54 AM, Dan Sommers wrote: >> On 2009-11-18 at 17:29:00 -0600, >> Jeff Ortel wrote: >> >>> On 11/18/2009 02:44 PM, Dan Sommers wrote: >> >>> d = client.last_received() >>> s = str(d) >> >> That was my first try, and it worked smashingly until one of my users >> found some XML that contained an ampersand ("&") and a less than >> symbol ("<") within its text nodes. Somewhere in there, suds decoded >> the entities twice, and str returned ill-formed XML (i.e., XML >> containing actual ampersands and less than symbols in its text nodes >> instead of "&"s and "<"s). > > Ah, very interesting. Let's fix this! Can you send me sample XML > that the suds sax package does not handle correctly? Also, what > version of suds are you using? It's suds 0.3.7 (and Python 2.6.2 on Ubuntu). For the moment, it's not my XML to send. That said, you should be able to confirm this behavior with any SOAP response that contains an XML-special character within a text node. Meanwhile, I will verify the legal status of the XML and go from there. Thanks, Dan From goschtl at googlemail.com Fri Nov 20 12:23:58 2009 From: goschtl at googlemail.com (Christian Klinger) Date: Fri, 20 Nov 2009 13:23:58 +0100 Subject: [Fedora-suds-list] Error with Suds: error: suds.TypeNotFound: Type not found: 'BETRIEB' Message-ID: <4B068A5E.3040607@googlemail.com> Hi i try to access a soap service with this script: from suds.client import Client def ga(): client = Client('http://ws_mub_prod:8080/BETRWS.wsdl') print client BETRIEB_EING = client.factory.create('ETBSRV2-BETRWS-BETRIEB_EING') BETRIEB_EING = "0101010001" result = client.service.BETRWS(BETRIEB_EING) print result The result/traceback of this script is this: svcdrupanet01:/tmp/sudstest # bin/python sd.py Suds ( https://fedorahosted.org/suds/ ) version: 0.3.7 GA build: R580-20091016 Service ( BETRWS ) tns="http://namespaces.softwareag.com/entirex/xml/me" Prefixes (1) ns0 = "http://namespaces.softwareag.com/entirex/xml/me" Ports (1): (ETBSRV2Port) Methods (1): BETRWS(ETBSRV2-BETRWS-BETRIEB_EING BETRIEB_EING, ) Types (2): ETBSRV2-BETRWS-Array ETBSRV2-BETRWS-BETRIEB_EING No handlers could be found for logger "suds.umx.typed" Traceback (most recent call last): File "sd.py", line 11, in ? print ga() File "sd.py", line 8, in ga result = client.service.BETRWS(BETRIEB_EING) File "/tmp/sudstest/suds/suds/client.py", line 535, in __call__ return client.invoke(args, kwargs) File "/tmp/sudstest/suds/suds/client.py", line 595, in invoke result = self.send(msg) File "/tmp/sudstest/suds/suds/client.py", line 624, in send result = self.succeeded(binding, reply.message) File "/tmp/sudstest/suds/suds/client.py", line 656, in succeeded r, p = binding.get_reply(self.method, reply) File "/tmp/sudstest/suds/suds/bindings/binding.py", line 149, in get_reply result = self.replycomposite(rtypes, nodes) File "/tmp/sudstest/suds/suds/bindings/binding.py", line 206, in replycomposite sobject = unmarshaller.process(node, resolved) File "/tmp/sudstest/suds/suds/umx/typed.py", line 57, in process return Core.process(self, content) File "/tmp/sudstest/suds/suds/umx/core.py", line 48, in process data, result = self.append(content) File "/tmp/sudstest/suds/suds/umx/core.py", line 64, in append self.append_children(content) File "/tmp/sudstest/suds/suds/umx/core.py", line 141, in append_children cdata, cval = self.append(cont) File "/tmp/sudstest/suds/suds/umx/core.py", line 64, in append self.append_children(content) File "/tmp/sudstest/suds/suds/umx/core.py", line 141, in append_children cdata, cval = self.append(cont) File "/tmp/sudstest/suds/suds/umx/core.py", line 62, in append self.start(content) File "/tmp/sudstest/suds/suds/umx/typed.py", line 71, in start raise TypeNotFound(content.node.qname()) suds.TypeNotFound: Type not found: 'BETRIEB' And here is the wsdl file: Thanks for your help.... If you need more information please ask. Christian From mcauthorn at gmail.com Fri Nov 20 13:11:06 2009 From: mcauthorn at gmail.com (Matt C) Date: Fri, 20 Nov 2009 08:11:06 -0500 Subject: [Fedora-suds-list] Error with Suds: error: suds.TypeNotFound: Type not found: 'BETRIEB' In-Reply-To: <4B068A5E.3040607@googlemail.com> References: <4B068A5E.3040607@googlemail.com> Message-ID: <42ea979e0911200511wa0390e6hb44bbc52c88a707e@mail.gmail.com> Try modifying the attribute of this type, then passing it in. From an iPython console and your wsdl: In [5]: c.factory.create('ETBSRV2-BETRWS-BETRIEB_EING') Out[5]: (ETBSRV2-BETRWS-BETRIEB_EING){ P_KNR_E = None P_ISN_E = None P_NAME-1_E = None P_NAME-2_E = None P_NAME-3_E = None P_STRASSE_E = None P_HAUSNR_E = None P_PLZ_E = None P_ORT_E = None } So try and set the appropriate attribute, as opposed to the actual object itself. e.g., BETRIEB_EING = "0101010001" is likely to be something like: BETRIEB_EING.P_NAME-2_E = "0101010001" Instead (of course I am randomly guessing that the P_NAME-2_E attribute is the one you want to set here :). HTH, -Matt On Fri, Nov 20, 2009 at 7:23 AM, Christian Klinger wrote: > Hi > > ?i try to access a soap service with this script: > > from suds.client import Client > > def ga(): > ? ?client = Client('http://ws_mub_prod:8080/BETRWS.wsdl') > ? ?print client > ? ?BETRIEB_EING = client.factory.create('ETBSRV2-BETRWS-BETRIEB_EING') > ? ?BETRIEB_EING = "0101010001" > ? ?result = client.service.BETRWS(BETRIEB_EING) > ? ?print result > > The result/traceback of this script is this: > > svcdrupanet01:/tmp/sudstest # bin/python sd.py > > Suds ( https://fedorahosted.org/suds/ ) ?version: 0.3.7 GA ?build: > R580-20091016 > > Service ( BETRWS ) tns="http://namespaces.softwareag.com/entirex/xml/me" > ? Prefixes (1) > ? ? ?ns0 = "http://namespaces.softwareag.com/entirex/xml/me" > ? Ports (1): > ? ? ?(ETBSRV2Port) > ? ? ? ? Methods (1): > ? ? ? ? ? ?BETRWS(ETBSRV2-BETRWS-BETRIEB_EING BETRIEB_EING, ) > ? ? ? ? Types (2): > ? ? ? ? ? ?ETBSRV2-BETRWS-Array > ? ? ? ? ? ?ETBSRV2-BETRWS-BETRIEB_EING > > > No handlers could be found for logger "suds.umx.typed" > Traceback (most recent call last): > ?File "sd.py", line 11, in ? > ? ?print ga() > ?File "sd.py", line 8, in ga > ? ?result = client.service.BETRWS(BETRIEB_EING) > ?File "/tmp/sudstest/suds/suds/client.py", line 535, in __call__ > ? ?return client.invoke(args, kwargs) > ?File "/tmp/sudstest/suds/suds/client.py", line 595, in invoke > ? ?result = self.send(msg) > ?File "/tmp/sudstest/suds/suds/client.py", line 624, in send > ? ?result = self.succeeded(binding, reply.message) > ?File "/tmp/sudstest/suds/suds/client.py", line 656, in succeeded > ? ?r, p = binding.get_reply(self.method, reply) > ?File "/tmp/sudstest/suds/suds/bindings/binding.py", line 149, in get_reply > ? ?result = self.replycomposite(rtypes, nodes) > ?File "/tmp/sudstest/suds/suds/bindings/binding.py", line 206, in > replycomposite > ? ?sobject = unmarshaller.process(node, resolved) > ?File "/tmp/sudstest/suds/suds/umx/typed.py", line 57, in process > ? ?return Core.process(self, content) > ?File "/tmp/sudstest/suds/suds/umx/core.py", line 48, in process > ? ?data, result = self.append(content) > ?File "/tmp/sudstest/suds/suds/umx/core.py", line 64, in append > ? ?self.append_children(content) > ?File "/tmp/sudstest/suds/suds/umx/core.py", line 141, in append_children > ? ?cdata, cval = self.append(cont) > ?File "/tmp/sudstest/suds/suds/umx/core.py", line 64, in append > ? ?self.append_children(content) > ?File "/tmp/sudstest/suds/suds/umx/core.py", line 141, in append_children > ? ?cdata, cval = self.append(cont) > ?File "/tmp/sudstest/suds/suds/umx/core.py", line 62, in append > ? ?self.start(content) > ?File "/tmp/sudstest/suds/suds/umx/typed.py", line 71, in start > ? ?raise TypeNotFound(content.node.qname()) > suds.TypeNotFound: Type not found: 'BETRIEB' > > > And here is the wsdl file: > > > > targetNamespace='http://namespaces.softwareag.com/entirex/xml/me' > xmlns='http://schemas.xmlsoap.org/wsdl/' > ? xmlns:xsd='http://www.w3.org/2001/XMLSchema' > xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' > ? xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' > ? xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' > xmlns:tns='http://namespaces.softwareag.com/entirex/xml/me' >> > > xmlns='http://www.w3.org/2001/XMLSchema'> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' > ? ? ? ? ? ? ? namespace='urn:com-softwareag-entirex-rpc:ETBSRV2' > ? ? ? ? ? ? ? /> > > > encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' > ? ? ? ? ? ? ? namespace='urn:com-softwareag-entirex-rpc:ETBSRV2' > ? ? ? ? ? ? ? /> > > > > > > > > > > > > Thanks for your help.... > If you need more information please ask. > > Christian > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list > From jerzyo at genesilico.pl Fri Nov 20 15:10:43 2009 From: jerzyo at genesilico.pl (Jerzy Orlowski) Date: Fri, 20 Nov 2009 15:10:43 +0000 Subject: [Fedora-suds-list] Connection time out Message-ID: <4B06B173.7090605@genesilico.pl> Hi My service takes ~5 minutes time. When I call it, I get: Traceback (most recent call last): File "test_soap_global2.py", line 2151, in result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: Jerzy Orlowski From mcauthorn at gmail.com Fri Nov 20 15:33:22 2009 From: mcauthorn at gmail.com (Matt C) Date: Fri, 20 Nov 2009 10:33:22 -0500 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <4B06B173.7090605@genesilico.pl> References: <4B06B173.7090605@genesilico.pl> Message-ID: <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2 # timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout) # this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ######################## Something like this in your Suds script may help, and is worth a shot. Please post back if this works, and good luck! -Matt On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski wrote: > Hi > > My service takes ~5 minutes time. When I call it, I get: > > Traceback (most recent call last): > ?File "test_soap_global2.py", line 2151, in > ? result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, > TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) > ?File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ > ?File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke > ?File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send > ?File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in > send > ?File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in > __open > ?File "/usr/lib/python2.6/urllib2.py", line 389, in open > ? response = self._open(req, data) > ?File "/usr/lib/python2.6/urllib2.py", line 407, in _open > ? '_open', req) > ?File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain > ? result = func(*args) > ?File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open > ? return self.do_open(httplib.HTTPConnection, req) > ?File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open > ? raise URLError(err) > urllib2.URLError: > > > Jerzy Orlowski > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list at redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list > From jerzyo at genesilico.pl Fri Nov 20 15:38:13 2009 From: jerzyo at genesilico.pl (Jerzy Orlowski) Date: Fri, 20 Nov 2009 15:38:13 +0000 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> Message-ID: <4B06B7E5.60705@genesilico.pl> I've already tried it and it does not work. This was a temporary hack and is not supported Is it possible to set a default timeout in suds when calling urllib2.open()? Jerzy Matt C wrote: > I'm not sure if this will work for you, it may be worth a shot - see > the 'missing manual' for urllib2, which shows you a way to set global > socket options: > ######################### > import socket > import urllib2 > > # timeout in seconds > timeout = 10 > socket.setdefaulttimeout(timeout) > > # this call to urllib2.urlopen now uses the default timeout > # we have set in the socket module > req = urllib2.Request('http://www.voidspace.org.uk') > response = urllib2.urlopen(req) > ######################## > > Something like this in your Suds script may help, and is worth a shot. > > Please post back if this works, and good luck! > -Matt > > On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski wrote: > >> Hi >> >> My service takes ~5 minutes time. When I call it, I get: >> >> Traceback (most recent call last): >> File "test_soap_global2.py", line 2151, in >> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ >> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke >> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in >> send >> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in >> __open >> File "/usr/lib/python2.6/urllib2.py", line 389, in open >> response = self._open(req, data) >> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >> '_open', req) >> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >> result = func(*args) >> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >> return self.do_open(httplib.HTTPConnection, req) >> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >> raise URLError(err) >> urllib2.URLError: >> >> >> Jerzy Orlowski >> >> _______________________________________________ >> fedora-suds-list mailing list >> fedora-suds-list at redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-suds-list >> >> > > > > From mcauthorn at gmail.com Fri Nov 20 15:44:03 2009 From: mcauthorn at gmail.com (Matt C) Date: Fri, 20 Nov 2009 10:44:03 -0500 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <4B06B7E5.60705@genesilico.pl> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> <4B06B7E5.60705@genesilico.pl> Message-ID: <42ea979e0911200744n78b757cfpdd6e5dc1e59f3ff1@mail.gmail.com> I think it may have to do with this. In [24]: urllib2.socket.setdefaulttimeout ? Type: builtin_function_or_method Base Class: String Form: Namespace: Interactive Docstring: setdefaulttimeout(timeout) Set the default timeout in floating seconds for new socket objects. A value of None indicates that new socket objects have no timeout. When the socket module is first imported, the default is None. ######### So if the default timeout is set to none, you're likely stuck dealing with the default TCP/IP socket timeouts on the OS. -Matt On Fri, Nov 20, 2009 at 10:38 AM, Jerzy Orlowski wrote: > I've already tried it and it does not work. This was a temporary hack and is > not supported > > Is it possible to set a default timeout in suds when calling urllib2.open()? > > Jerzy > > Matt C wrote: >> >> I'm not sure if this will work for you, it may be worth a shot - see >> the 'missing manual' for urllib2, which shows you a way to set global >> socket options: >> ######################### >> import socket >> import urllib2 >> >> # timeout in seconds >> timeout = 10 >> socket.setdefaulttimeout(timeout) >> >> # this call to urllib2.urlopen now uses the default timeout >> # we have set in the socket module >> req = urllib2.Request('http://www.voidspace.org.uk') >> response = urllib2.urlopen(req) >> ######################## >> >> Something like this in your Suds script may help, and is worth a shot. >> >> Please post back if this works, and good luck! >> -Matt >> >> On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski >> wrote: >> >>> >>> Hi >>> >>> My service takes ~5 minutes time. When I call it, I get: >>> >>> Traceback (most recent call last): >>> ?File "test_soap_global2.py", line 2151, in >>> ?result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >>> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >>> ?File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in >>> __call__ >>> ?File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke >>> ?File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >>> ?File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in >>> send >>> ?File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in >>> __open >>> ?File "/usr/lib/python2.6/urllib2.py", line 389, in open >>> ?response = self._open(req, data) >>> ?File "/usr/lib/python2.6/urllib2.py", line 407, in _open >>> ?'_open', req) >>> ?File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >>> ?result = func(*args) >>> ?File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >>> ?return self.do_open(httplib.HTTPConnection, req) >>> ?File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >>> ?raise URLError(err) >>> urllib2.URLError: >>> >>> >>> Jerzy Orlowski >>> >>> _______________________________________________ >>> fedora-suds-list mailing list >>> fedora-suds-list at redhat.com >>> https://www.redhat.com/mailman/listinfo/fedora-suds-list >>> >>> >> >> >> >> > > From jerzyo at genesilico.pl Fri Nov 20 15:44:40 2009 From: jerzyo at genesilico.pl (Jerzy Orlowski) Date: Fri, 20 Nov 2009 15:44:40 +0000 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> Message-ID: <4B06B968.7020501@genesilico.pl> changing the http.py file made it: def __open(self, u2request): socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request) else: return self.urlopener.open(u2request,timeout=500) Could you, please, add Client.settimout() For the the next release? Matt C wrote: > I'm not sure if this will work for you, it may be worth a shot - see > the 'missing manual' for urllib2, which shows you a way to set global > socket options: > ######################### > import socket > import urllib2 > > # timeout in seconds > timeout = 10 > socket.setdefaulttimeout(timeout) > > # this call to urllib2.urlopen now uses the default timeout > # we have set in the socket module > req = urllib2.Request('http://www.voidspace.org.uk') > response = urllib2.urlopen(req) > ######################## > > Something like this in your Suds script may help, and is worth a shot. > > Please post back if this works, and good luck! > -Matt > > On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski wrote: > >> Hi >> >> My service takes ~5 minutes time. When I call it, I get: >> >> Traceback (most recent call last): >> File "test_soap_global2.py", line 2151, in >> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ >> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke >> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in >> send >> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in >> __open >> File "/usr/lib/python2.6/urllib2.py", line 389, in open >> response = self._open(req, data) >> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >> '_open', req) >> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >> result = func(*args) >> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >> return self.do_open(httplib.HTTPConnection, req) >> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >> raise URLError(err) >> urllib2.URLError: >> >> >> Jerzy Orlowski >> >> _______________________________________________ >> fedora-suds-list mailing list >> fedora-suds-list at redhat.com >> https://www.redhat.com/mailman/listinfo/fedora-suds-list >> >> > > > > From jerzyo at genesilico.pl Fri Nov 20 15:55:31 2009 From: jerzyo at genesilico.pl (Jerzy Orlowski) Date: Fri, 20 Nov 2009 15:55:31 +0000 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> Message-ID: <4B06BBF3.20008@genesilico.pl> And I see why it doesn't work: You change the default timeout in /transport/http.py __open function This overrides the change you suggest You should not that this is a very nasty way of setting the timeouts. For example this might affect another modules that are inside the program Jerzy Matt C wrote: > I'm not sure if this will work for you, it may be worth a shot - see > the 'missing manual' for urllib2, which shows you a way to set global > socket options: > ######################### > import socket > import urllib2 > > # timeout in seconds > timeout = 10 > socket.setdefaulttimeout(timeout) > > # this call to urllib2.urlopen now uses the default timeout > # we have set in the socket module > req = urllib2.Request('http://www.voidspace.org.uk') > response = urllib2.urlopen(req) > ######################## > > Something like this in your Suds script may help, and is worth a shot. > > Please post back if this works, and good luck! > -Matt > > On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski wrote: > >> Hi >> >> My service takes ~5 minutes time. When I call it, I get: >> >> Traceback (most recent call last): >> File "test_soap_global2.py", line 2151, in >> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ >> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke >> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in >> send >> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in >> __open >> File "/usr/lib/python2.6/urllib2.py", line 389, in open >> response = self._open(req, data) >> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >> '_open', req) >> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >> result = func(*args) >> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >> return self.do_open(httplib.HTTPConnection, req) >> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >> raise URLError(err) >> urllib2.URLError: >> >> >> Jerzy Orlowski >> >> _______________________________________________ >> 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 Fri Nov 20 16:05:44 2009 From: jortel at redhat.com (Jeff Ortel) Date: Fri, 20 Nov 2009 10:05:44 -0600 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <4B06B968.7020501@genesilico.pl> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> <4B06B968.7020501@genesilico.pl> Message-ID: <4B06BE58.3060105@redhat.com> The socket timeout was added as a suds option in 0.3.7 (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try: client = Client(url, timeout=500) On 11/20/2009 09:44 AM, Jerzy Orlowski wrote: > changing the http.py file made it: > > def __open(self, u2request): > socket.setdefaulttimeout(self.options.timeout) > if self.urlopener is None: > return u2.urlopen(u2request) > else: > return self.urlopener.open(u2request,timeout=500) > > > > Could you, please, add > Client.settimout() > > For the the next release? > > > > Matt C wrote: >> I'm not sure if this will work for you, it may be worth a shot - see >> the 'missing manual' for urllib2, which shows you a way to set global >> socket options: >> ######################### >> import socket >> import urllib2 >> >> # timeout in seconds >> timeout = 10 >> socket.setdefaulttimeout(timeout) >> >> # this call to urllib2.urlopen now uses the default timeout >> # we have set in the socket module >> req = urllib2.Request('http://www.voidspace.org.uk') >> response = urllib2.urlopen(req) >> ######################## >> >> Something like this in your Suds script may help, and is worth a shot. >> >> Please post back if this works, and good luck! >> -Matt >> >> On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski >> wrote: >>> Hi >>> >>> My service takes ~5 minutes time. When I call it, I get: >>> >>> Traceback (most recent call last): >>> File "test_soap_global2.py", line 2151, in >>> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >>> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in >>> __call__ >>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke >>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in >>> send >>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in >>> __open >>> File "/usr/lib/python2.6/urllib2.py", line 389, in open >>> response = self._open(req, data) >>> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >>> '_open', req) >>> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >>> result = func(*args) >>> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >>> return self.do_open(httplib.HTTPConnection, req) >>> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >>> raise URLError(err) >>> urllib2.URLError: >>> >>> >>> Jerzy Orlowski >>> >>> _______________________________________________ >>> 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From jerzyo at genesilico.pl Fri Nov 20 16:16:25 2009 From: jerzyo at genesilico.pl (Jerzy Orlowski) Date: Fri, 20 Nov 2009 16:16:25 +0000 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <4B06BE58.3060105@redhat.com> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> <4B06B968.7020501@genesilico.pl> <4B06BE58.3060105@redhat.com> Message-ID: <4B06C0D9.6090207@genesilico.pl> OK,it works, but if you do it by socket.setdefaulttimeout(self.options.timeout) than it is very nasty and error prone The proper code should look stk like: def __open(self, u2request): #socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request,self.options.timeout) else: return self.urlopener.open(u2request,self.options.timeout) Jeff Ortel wrote: > The socket timeout was added as a suds option in 0.3.7 > (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try: > > client = Client(url, timeout=500) > > > On 11/20/2009 09:44 AM, Jerzy Orlowski wrote: >> changing the http.py file made it: >> >> def __open(self, u2request): >> socket.setdefaulttimeout(self.options.timeout) >> if self.urlopener is None: >> return u2.urlopen(u2request) >> else: >> return self.urlopener.open(u2request,timeout=500) >> >> >> >> Could you, please, add >> Client.settimout() >> >> For the the next release? >> >> >> >> Matt C wrote: >>> I'm not sure if this will work for you, it may be worth a shot - see >>> the 'missing manual' for urllib2, which shows you a way to set global >>> socket options: >>> ######################### >>> import socket >>> import urllib2 >>> >>> # timeout in seconds >>> timeout = 10 >>> socket.setdefaulttimeout(timeout) >>> >>> # this call to urllib2.urlopen now uses the default timeout >>> # we have set in the socket module >>> req = urllib2.Request('http://www.voidspace.org.uk') >>> response = urllib2.urlopen(req) >>> ######################## >>> >>> Something like this in your Suds script may help, and is worth a shot. >>> >>> Please post back if this works, and good luck! >>> -Matt >>> >>> On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski >>> wrote: >>>> Hi >>>> >>>> My service takes ~5 minutes time. When I call it, I get: >>>> >>>> Traceback (most recent call last): >>>> File "test_soap_global2.py", line 2151, in >>>> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >>>> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in >>>> __call__ >>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in >>>> invoke >>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>> 85, in >>>> send >>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>> 107, in >>>> __open >>>> File "/usr/lib/python2.6/urllib2.py", line 389, in open >>>> response = self._open(req, data) >>>> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >>>> '_open', req) >>>> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >>>> result = func(*args) >>>> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >>>> return self.do_open(httplib.HTTPConnection, req) >>>> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >>>> raise URLError(err) >>>> urllib2.URLError: >>>> >>>> >>>> Jerzy Orlowski >>>> >>>> _______________________________________________ >>>> 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 jerzyo at genesilico.pl Fri Nov 20 16:19:51 2009 From: jerzyo at genesilico.pl (Jerzy Orlowski) Date: Fri, 20 Nov 2009 16:19:51 +0000 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <4B06C0D9.6090207@genesilico.pl> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> <4B06B968.7020501@genesilico.pl> <4B06BE58.3060105@redhat.com> <4B06C0D9.6090207@genesilico.pl> Message-ID: <4B06C1A7.4080804@genesilico.pl> Sorry, this one doesn't work. And it seems that socket.setdefaulttimeout(self.options.timeout in http.py is not changing anything Jerzy Orlowski Jerzy Orlowski wrote: > OK,it works, but if you do it by > socket.setdefaulttimeout(self.options.timeout) than it is very nasty > and error prone > > The proper code should look stk like: > def __open(self, u2request): > #socket.setdefaulttimeout(self.options.timeout) > if self.urlopener is None: > return u2.urlopen(u2request,self.options.timeout) > else: > return self.urlopener.open(u2request,self.options.timeout) > > > > > > Jeff Ortel wrote: >> The socket timeout was added as a suds option in 0.3.7 >> (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try: >> >> client = Client(url, timeout=500) >> >> >> On 11/20/2009 09:44 AM, Jerzy Orlowski wrote: >>> changing the http.py file made it: >>> >>> def __open(self, u2request): >>> socket.setdefaulttimeout(self.options.timeout) >>> if self.urlopener is None: >>> return u2.urlopen(u2request) >>> else: >>> return self.urlopener.open(u2request,timeout=500) >>> >>> >>> >>> Could you, please, add >>> Client.settimout() >>> >>> For the the next release? >>> >>> >>> >>> Matt C wrote: >>>> I'm not sure if this will work for you, it may be worth a shot - see >>>> the 'missing manual' for urllib2, which shows you a way to set global >>>> socket options: >>>> ######################### >>>> import socket >>>> import urllib2 >>>> >>>> # timeout in seconds >>>> timeout = 10 >>>> socket.setdefaulttimeout(timeout) >>>> >>>> # this call to urllib2.urlopen now uses the default timeout >>>> # we have set in the socket module >>>> req = urllib2.Request('http://www.voidspace.org.uk') >>>> response = urllib2.urlopen(req) >>>> ######################## >>>> >>>> Something like this in your Suds script may help, and is worth a shot. >>>> >>>> Please post back if this works, and good luck! >>>> -Matt >>>> >>>> On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski >>>> wrote: >>>>> Hi >>>>> >>>>> My service takes ~5 minutes time. When I call it, I get: >>>>> >>>>> Traceback (most recent call last): >>>>> File "test_soap_global2.py", line 2151, in >>>>> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >>>>> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in >>>>> __call__ >>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in >>>>> invoke >>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >>>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>>> 85, in >>>>> send >>>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>>> 107, in >>>>> __open >>>>> File "/usr/lib/python2.6/urllib2.py", line 389, in open >>>>> response = self._open(req, data) >>>>> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >>>>> '_open', req) >>>>> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >>>>> result = func(*args) >>>>> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >>>>> return self.do_open(httplib.HTTPConnection, req) >>>>> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >>>>> raise URLError(err) >>>>> urllib2.URLError: >>>>> >>>>> >>>>> Jerzy Orlowski >>>>> >>>>> _______________________________________________ >>>>> 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 jortel at redhat.com Fri Nov 20 16:55:29 2009 From: jortel at redhat.com (Jeff Ortel) Date: Fri, 20 Nov 2009 10:55:29 -0600 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <4B06BBF3.20008@genesilico.pl> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> <4B06BBF3.20008@genesilico.pl> Message-ID: <4B06CA01.1080901@redhat.com> On 11/20/2009 09:55 AM, Jerzy Orlowski wrote: > And I see why it doesn't work: > > You change the default timeout in /transport/http.py __open function > This overrides the change you suggest > > You should not that this is a very nasty way of setting the timeouts. > For example this might affect another modules that are inside the program I completely agree but setting the timeout in urllib2 was not added until recently. So, the socket.setdefaulttimeout() is used for backward compatibility for older versions of python. Thoughts? > > Jerzy > > Matt C wrote: >> I'm not sure if this will work for you, it may be worth a shot - see >> the 'missing manual' for urllib2, which shows you a way to set global >> socket options: >> ######################### >> import socket >> import urllib2 >> >> # timeout in seconds >> timeout = 10 >> socket.setdefaulttimeout(timeout) >> >> # this call to urllib2.urlopen now uses the default timeout >> # we have set in the socket module >> req = urllib2.Request('http://www.voidspace.org.uk') >> response = urllib2.urlopen(req) >> ######################## >> >> Something like this in your Suds script may help, and is worth a shot. >> >> Please post back if this works, and good luck! >> -Matt >> >> On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski >> wrote: >>> Hi >>> >>> My service takes ~5 minutes time. When I call it, I get: >>> >>> Traceback (most recent call last): >>> File "test_soap_global2.py", line 2151, in >>> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >>> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in >>> __call__ >>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke >>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in >>> send >>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in >>> __open >>> File "/usr/lib/python2.6/urllib2.py", line 389, in open >>> response = self._open(req, data) >>> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >>> '_open', req) >>> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >>> result = func(*args) >>> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >>> return self.do_open(httplib.HTTPConnection, req) >>> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >>> raise URLError(err) >>> urllib2.URLError: >>> >>> >>> Jerzy Orlowski >>> >>> _______________________________________________ >>> 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From jortel at redhat.com Fri Nov 20 16:59:29 2009 From: jortel at redhat.com (Jeff Ortel) Date: Fri, 20 Nov 2009 10:59:29 -0600 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <4B06C1A7.4080804@genesilico.pl> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> <4B06B968.7020501@genesilico.pl> <4B06BE58.3060105@redhat.com> <4B06C0D9.6090207@genesilico.pl> <4B06C1A7.4080804@genesilico.pl> Message-ID: <4B06CAF1.8010103@redhat.com> On 11/20/2009 10:19 AM, Jerzy Orlowski wrote: > Sorry, this one doesn't work. > And it seems that socket.setdefaulttimeout(self.options.timeout in > http.py is not changing anything How so? Worked when I tested it. > > Jerzy Orlowski > > Jerzy Orlowski wrote: >> OK,it works, but if you do it by >> socket.setdefaulttimeout(self.options.timeout) than it is very nasty >> and error prone >> >> The proper code should look stk like: >> def __open(self, u2request): >> #socket.setdefaulttimeout(self.options.timeout) >> if self.urlopener is None: >> return u2.urlopen(u2request,self.options.timeout) >> else: >> return self.urlopener.open(u2request,self.options.timeout) >> >> >> >> >> >> Jeff Ortel wrote: >>> The socket timeout was added as a suds option in 0.3.7 >>> (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try: >>> >>> client = Client(url, timeout=500) >>> >>> >>> On 11/20/2009 09:44 AM, Jerzy Orlowski wrote: >>>> changing the http.py file made it: >>>> >>>> def __open(self, u2request): >>>> socket.setdefaulttimeout(self.options.timeout) >>>> if self.urlopener is None: >>>> return u2.urlopen(u2request) >>>> else: >>>> return self.urlopener.open(u2request,timeout=500) >>>> >>>> >>>> >>>> Could you, please, add >>>> Client.settimout() >>>> >>>> For the the next release? >>>> >>>> >>>> >>>> Matt C wrote: >>>>> I'm not sure if this will work for you, it may be worth a shot - see >>>>> the 'missing manual' for urllib2, which shows you a way to set global >>>>> socket options: >>>>> ######################### >>>>> import socket >>>>> import urllib2 >>>>> >>>>> # timeout in seconds >>>>> timeout = 10 >>>>> socket.setdefaulttimeout(timeout) >>>>> >>>>> # this call to urllib2.urlopen now uses the default timeout >>>>> # we have set in the socket module >>>>> req = urllib2.Request('http://www.voidspace.org.uk') >>>>> response = urllib2.urlopen(req) >>>>> ######################## >>>>> >>>>> Something like this in your Suds script may help, and is worth a shot. >>>>> >>>>> Please post back if this works, and good luck! >>>>> -Matt >>>>> >>>>> On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski >>>>> wrote: >>>>>> Hi >>>>>> >>>>>> My service takes ~5 minutes time. When I call it, I get: >>>>>> >>>>>> Traceback (most recent call last): >>>>>> File "test_soap_global2.py", line 2151, in >>>>>> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >>>>>> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >>>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in >>>>>> __call__ >>>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in >>>>>> invoke >>>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >>>>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>>>> 85, in >>>>>> send >>>>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>>>> 107, in >>>>>> __open >>>>>> File "/usr/lib/python2.6/urllib2.py", line 389, in open >>>>>> response = self._open(req, data) >>>>>> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >>>>>> '_open', req) >>>>>> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >>>>>> result = func(*args) >>>>>> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >>>>>> return self.do_open(httplib.HTTPConnection, req) >>>>>> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >>>>>> raise URLError(err) >>>>>> urllib2.URLError: >>>>>> >>>>>> >>>>>> Jerzy Orlowski >>>>>> >>>>>> _______________________________________________ >>>>>> 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 >> >> >> > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From jortel at redhat.com Fri Nov 20 17:05:35 2009 From: jortel at redhat.com (Jeff Ortel) Date: Fri, 20 Nov 2009 11:05:35 -0600 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <4B06C0D9.6090207@genesilico.pl> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> <4B06B968.7020501@genesilico.pl> <4B06BE58.3060105@redhat.com> <4B06C0D9.6090207@genesilico.pl> Message-ID: <4B06CC5F.70205@redhat.com> On 11/20/2009 10:16 AM, Jerzy Orlowski wrote: > OK,it works, but if you do it by > socket.setdefaulttimeout(self.options.timeout) than it is very nasty and > error prone Again, /timeout/ arg was not added to urllib2 open() methods until python 2.6. > > The proper code should look stk like: > def __open(self, u2request): > #socket.setdefaulttimeout(self.options.timeout) > if self.urlopener is None: > return u2.urlopen(u2request,self.options.timeout) > else: > return self.urlopener.open(u2request,self.options.timeout) > > > > > > Jeff Ortel wrote: >> The socket timeout was added as a suds option in 0.3.7 >> (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try: >> >> client = Client(url, timeout=500) >> >> >> On 11/20/2009 09:44 AM, Jerzy Orlowski wrote: >>> changing the http.py file made it: >>> >>> def __open(self, u2request): >>> socket.setdefaulttimeout(self.options.timeout) >>> if self.urlopener is None: >>> return u2.urlopen(u2request) >>> else: >>> return self.urlopener.open(u2request,timeout=500) >>> >>> >>> >>> Could you, please, add >>> Client.settimout() >>> >>> For the the next release? >>> >>> >>> >>> Matt C wrote: >>>> I'm not sure if this will work for you, it may be worth a shot - see >>>> the 'missing manual' for urllib2, which shows you a way to set global >>>> socket options: >>>> ######################### >>>> import socket >>>> import urllib2 >>>> >>>> # timeout in seconds >>>> timeout = 10 >>>> socket.setdefaulttimeout(timeout) >>>> >>>> # this call to urllib2.urlopen now uses the default timeout >>>> # we have set in the socket module >>>> req = urllib2.Request('http://www.voidspace.org.uk') >>>> response = urllib2.urlopen(req) >>>> ######################## >>>> >>>> Something like this in your Suds script may help, and is worth a shot. >>>> >>>> Please post back if this works, and good luck! >>>> -Matt >>>> >>>> On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski >>>> wrote: >>>>> Hi >>>>> >>>>> My service takes ~5 minutes time. When I call it, I get: >>>>> >>>>> Traceback (most recent call last): >>>>> File "test_soap_global2.py", line 2151, in >>>>> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >>>>> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in >>>>> __call__ >>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in >>>>> invoke >>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >>>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>>> 85, in >>>>> send >>>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>>> 107, in >>>>> __open >>>>> File "/usr/lib/python2.6/urllib2.py", line 389, in open >>>>> response = self._open(req, data) >>>>> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >>>>> '_open', req) >>>>> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >>>>> result = func(*args) >>>>> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >>>>> return self.do_open(httplib.HTTPConnection, req) >>>>> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >>>>> raise URLError(err) >>>>> urllib2.URLError: >>>>> >>>>> >>>>> Jerzy Orlowski >>>>> >>>>> _______________________________________________ >>>>> 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 >> > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From jortel at redhat.com Fri Nov 20 17:15:42 2009 From: jortel at redhat.com (Jeff Ortel) Date: Fri, 20 Nov 2009 11:15:42 -0600 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <4B06CC5F.70205@redhat.com> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> <4B06B968.7020501@genesilico.pl> <4B06BE58.3060105@redhat.com> <4B06C0D9.6090207@genesilico.pl> <4B06CC5F.70205@redhat.com> Message-ID: <4B06CEBE.7040205@redhat.com> On 11/20/2009 11:05 AM, Jeff Ortel wrote: > > > On 11/20/2009 10:16 AM, Jerzy Orlowski wrote: >> OK,it works, but if you do it by >> socket.setdefaulttimeout(self.options.timeout) than it is very nasty and >> error prone > > Again, /timeout/ arg was not added to urllib2 open() methods until > python 2.6. Probably would be nicer to test the u2.__version__ and use the timeout on the urlopener.open() instead if supported. > >> >> The proper code should look stk like: >> def __open(self, u2request): >> #socket.setdefaulttimeout(self.options.timeout) >> if self.urlopener is None: >> return u2.urlopen(u2request,self.options.timeout) >> else: >> return self.urlopener.open(u2request,self.options.timeout) >> >> >> >> >> >> Jeff Ortel wrote: >>> The socket timeout was added as a suds option in 0.3.7 >>> (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try: >>> >>> client = Client(url, timeout=500) >>> >>> >>> On 11/20/2009 09:44 AM, Jerzy Orlowski wrote: >>>> changing the http.py file made it: >>>> >>>> def __open(self, u2request): >>>> socket.setdefaulttimeout(self.options.timeout) >>>> if self.urlopener is None: >>>> return u2.urlopen(u2request) >>>> else: >>>> return self.urlopener.open(u2request,timeout=500) >>>> >>>> >>>> >>>> Could you, please, add >>>> Client.settimout() >>>> >>>> For the the next release? >>>> >>>> >>>> >>>> Matt C wrote: >>>>> I'm not sure if this will work for you, it may be worth a shot - see >>>>> the 'missing manual' for urllib2, which shows you a way to set global >>>>> socket options: >>>>> ######################### >>>>> import socket >>>>> import urllib2 >>>>> >>>>> # timeout in seconds >>>>> timeout = 10 >>>>> socket.setdefaulttimeout(timeout) >>>>> >>>>> # this call to urllib2.urlopen now uses the default timeout >>>>> # we have set in the socket module >>>>> req = urllib2.Request('http://www.voidspace.org.uk') >>>>> response = urllib2.urlopen(req) >>>>> ######################## >>>>> >>>>> Something like this in your Suds script may help, and is worth a shot. >>>>> >>>>> Please post back if this works, and good luck! >>>>> -Matt >>>>> >>>>> On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski >>>>> wrote: >>>>>> Hi >>>>>> >>>>>> My service takes ~5 minutes time. When I call it, I get: >>>>>> >>>>>> Traceback (most recent call last): >>>>>> File "test_soap_global2.py", line 2151, in >>>>>> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >>>>>> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >>>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in >>>>>> __call__ >>>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in >>>>>> invoke >>>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send >>>>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>>>> 85, in >>>>>> send >>>>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>>>> 107, in >>>>>> __open >>>>>> File "/usr/lib/python2.6/urllib2.py", line 389, in open >>>>>> response = self._open(req, data) >>>>>> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >>>>>> '_open', req) >>>>>> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >>>>>> result = func(*args) >>>>>> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >>>>>> return self.do_open(httplib.HTTPConnection, req) >>>>>> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >>>>>> raise URLError(err) >>>>>> urllib2.URLError: >>>>>> >>>>>> >>>>>> Jerzy Orlowski >>>>>> >>>>>> _______________________________________________ >>>>>> 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From jerzyo at genesilico.pl Fri Nov 20 17:56:23 2009 From: jerzyo at genesilico.pl (Jerzy Orlowski) Date: Fri, 20 Nov 2009 17:56:23 +0000 Subject: [Fedora-suds-list] Connection time out In-Reply-To: <4B06CAF1.8010103@redhat.com> References: <4B06B173.7090605@genesilico.pl> <42ea979e0911200733j14780b4bl4c1cc1c2d25739b3@mail.gmail.com> <4B06B968.7020501@genesilico.pl> <4B06BE58.3060105@redhat.com> <4B06C0D9.6090207@genesilico.pl> <4B06C1A7.4080804@genesilico.pl> <4B06CAF1.8010103@redhat.com> Message-ID: <4B06D847.5060604@genesilico.pl> Works Thanks a lot guys for quick reply! Could you put it on Tips & Trics (just for future generations) Jerzy Jeff Ortel wrote: > > > On 11/20/2009 10:19 AM, Jerzy Orlowski wrote: >> Sorry, this one doesn't work. >> And it seems that socket.setdefaulttimeout(self.options.timeout in >> http.py is not changing anything > > How so? Worked when I tested it. > >> >> Jerzy Orlowski >> >> Jerzy Orlowski wrote: >>> OK,it works, but if you do it by >>> socket.setdefaulttimeout(self.options.timeout) than it is very nasty >>> and error prone >>> >>> The proper code should look stk like: >>> def __open(self, u2request): >>> #socket.setdefaulttimeout(self.options.timeout) >>> if self.urlopener is None: >>> return u2.urlopen(u2request,self.options.timeout) >>> else: >>> return self.urlopener.open(u2request,self.options.timeout) >>> >>> >>> >>> >>> >>> Jeff Ortel wrote: >>>> The socket timeout was added as a suds option in 0.3.7 >>>> (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try: >>>> >>>> client = Client(url, timeout=500) >>>> >>>> >>>> On 11/20/2009 09:44 AM, Jerzy Orlowski wrote: >>>>> changing the http.py file made it: >>>>> >>>>> def __open(self, u2request): >>>>> socket.setdefaulttimeout(self.options.timeout) >>>>> if self.urlopener is None: >>>>> return u2.urlopen(u2request) >>>>> else: >>>>> return self.urlopener.open(u2request,timeout=500) >>>>> >>>>> >>>>> >>>>> Could you, please, add >>>>> Client.settimout() >>>>> >>>>> For the the next release? >>>>> >>>>> >>>>> >>>>> Matt C wrote: >>>>>> I'm not sure if this will work for you, it may be worth a shot - see >>>>>> the 'missing manual' for urllib2, which shows you a way to set >>>>>> global >>>>>> socket options: >>>>>> ######################### >>>>>> import socket >>>>>> import urllib2 >>>>>> >>>>>> # timeout in seconds >>>>>> timeout = 10 >>>>>> socket.setdefaulttimeout(timeout) >>>>>> >>>>>> # this call to urllib2.urlopen now uses the default timeout >>>>>> # we have set in the socket module >>>>>> req = urllib2.Request('http://www.voidspace.org.uk') >>>>>> response = urllib2.urlopen(req) >>>>>> ######################## >>>>>> >>>>>> Something like this in your Suds script may help, and is worth a >>>>>> shot. >>>>>> >>>>>> Please post back if this works, and good luck! >>>>>> -Matt >>>>>> >>>>>> On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski >>>>>> wrote: >>>>>>> Hi >>>>>>> >>>>>>> My service takes ~5 minutes time. When I call it, I get: >>>>>>> >>>>>>> Traceback (most recent call last): >>>>>>> File "test_soap_global2.py", line 2151, in >>>>>>> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, >>>>>>> TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) >>>>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in >>>>>>> __call__ >>>>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in >>>>>>> invoke >>>>>>> File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in >>>>>>> send >>>>>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>>>>> 85, in >>>>>>> send >>>>>>> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line >>>>>>> 107, in >>>>>>> __open >>>>>>> File "/usr/lib/python2.6/urllib2.py", line 389, in open >>>>>>> response = self._open(req, data) >>>>>>> File "/usr/lib/python2.6/urllib2.py", line 407, in _open >>>>>>> '_open', req) >>>>>>> File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain >>>>>>> result = func(*args) >>>>>>> File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open >>>>>>> return self.do_open(httplib.HTTPConnection, req) >>>>>>> File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open >>>>>>> raise URLError(err) >>>>>>> urllib2.URLError: >>>>>>> >>>>>>> >>>>>>> Jerzy Orlowski >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 jortel at redhat.com Fri Nov 20 22:32:36 2009 From: jortel at redhat.com (Jeff Ortel) Date: Fri, 20 Nov 2009 16:32:36 -0600 Subject: [Fedora-suds-list] 0.3.8 release candidate Message-ID: <4B071904.2080705@redhat.com> All, Looks like r605 is a good candidate for the 0.3.8 release. Please install the beta and provide feedback. Release notes can be found here: https://fedorahosted.org/suds/wiki/WikiStart#Development. Thanks, Jeff -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From goschtl at googlemail.com Sat Nov 21 08:56:04 2009 From: goschtl at googlemail.com (Christian Klinger) Date: Sat, 21 Nov 2009 09:56:04 +0100 Subject: [Fedora-suds-list] Soap not Found Error: Message-ID: <4B07AB24.2070005@googlemail.com> Hi Matt, sorry i send this to matt instead of the mailinglist... now i have changed my code to this: def ga(): client = Client('http://ws_mub_prod:8080/BETRWS.wsdl') print client BETRIEB_EING = client.factory.create('ETBSRV2-BETRWS-BETRIEB_EING') BETRIEB_EING.P_KNR_E = "0101010001" result = client.service.BETRWS(BETRIEB_EING=BETRIEB_EING) print result But i got the same error.... No handlers could be found for logger "suds.umx.typed" Traceback (most recent call last): File "sd.py", line 11, in ? print ga() File "sd.py", line 8, in ga result = client.service.BETRWS(BETRIEB_EING=BETRIEB_EING) File "/tmp/sudstest/suds/suds/client.py", line 535, in __call__ return client.invoke(args, kwargs) File "/tmp/sudstest/suds/suds/client.py", line 595, in invoke result = self.send(msg) File "/tmp/sudstest/suds/suds/client.py", line 624, in send result = self.succeeded(binding, reply.message) File "/tmp/sudstest/suds/suds/client.py", line 656, in succeeded r, p = binding.get_reply(self.method, reply) File "/tmp/sudstest/suds/suds/bindings/binding.py", line 149, in get_reply result = self.replycomposite(rtypes, nodes) File "/tmp/sudstest/suds/suds/bindings/binding.py", line 206, in replycomposite sobject = unmarshaller.process(node, resolved) File "/tmp/sudstest/suds/suds/umx/typed.py", line 57, in process return Core.process(self, content) File "/tmp/sudstest/suds/suds/umx/core.py", line 48, in process data, result = self.append(content) File "/tmp/sudstest/suds/suds/umx/core.py", line 64, in append self.append_children(content) File "/tmp/sudstest/suds/suds/umx/core.py", line 141, in append_children cdata, cval = self.append(cont) File "/tmp/sudstest/suds/suds/umx/core.py", line 64, in append self.append_children(content) File "/tmp/sudstest/suds/suds/umx/core.py", line 141, in append_children cdata, cval = self.append(cont) File "/tmp/sudstest/suds/suds/umx/core.py", line 62, in append self.start(content) File "/tmp/sudstest/suds/suds/umx/typed.py", line 71, in start raise TypeNotFound(content.node.qname()) suds.TypeNotFound: Type not found: 'BETRIEB' i don't find a solution so i stepped in the pdb to look whats going on: Maybe someone can look on this pdb-session. It seems that suds can not find the node "Betrieb" on the parent -> def find(self, node, resolved=False, push=True): (Pdb) l 313 @param schema: A schema object. 314 @type schema: L{xsd.schema.Schema} 315 """ 316 TreeResolver.__init__(self, schema) 317 318 -> def find(self, node, resolved=False, push=True): 319 """ 320 @param node: An xml node to be resolved. 321 @type node: L{sax.element.Element} 322 @param resolved: A flag indicating that the fully resolved type should be 323 returned. (Pdb) n > /tmp/sudstest/suds/suds/resolver.py(331)find() -> name = node.name (Pdb) n > /tmp/sudstest/suds/suds/resolver.py(332)find() -> parent = self.top().resolved (Pdb) n > /tmp/sudstest/suds/suds/resolver.py(333)find() -> if parent is None: (Pdb) n > /tmp/sudstest/suds/suds/resolver.py(336)find() -> result, ancestry = self.getchild(name, parent) (Pdb) n > /tmp/sudstest/suds/suds/resolver.py(337)find() -> known = self.known(node) (Pdb) result (Pdb) name u'BETRIEB' (Pdb) print str(parent) Any ideas? Christian From rnm at whidbey.com Mon Nov 23 21:47:52 2009 From: rnm at whidbey.com (Robert Marsanyi) Date: Mon, 23 Nov 2009 13:47:52 -0800 Subject: [Fedora-suds-list] Arrays, again Message-ID: <491E7D023BFF4247936E8C326BCAB264@bluto> I see lots of history about using array complex types in SOAP requests, but I still can't divine how to do it right. Ultimately, I need to generate an array of complex structures, but the array part is baffling me, so I thought I'd start with an array of integers, using a service that's specifically designed for testing. Using the WSDL specified in public.py at http://mssoapinterop.org/asmx/simple.asmx?WSDL, I'm trying to use the echoIntegerArray service. I've tried a number of different ways to build the array in the request call, but none seem to work; every request returns a syntactically correct, but empty, response (that is, result=client.service.echoIntegerArray(array)) always returns None, regardless of the machinations I use to construct the variable "array". Can someone show me the client code for an array of ints that works with this service? --rbt -------------- next part -------------- A non-text attachment was scrubbed... Name: Robert Marsanyi.vcf Type: text/x-vcard Size: 550 bytes Desc: not available URL: From jortel at redhat.com Mon Nov 23 22:55:56 2009 From: jortel at redhat.com (Jeff Ortel) Date: Mon, 23 Nov 2009 16:55:56 -0600 Subject: [Fedora-suds-list] Arrays, again In-Reply-To: <491E7D023BFF4247936E8C326BCAB264@bluto> References: <491E7D023BFF4247936E8C326BCAB264@bluto> Message-ID: <4B0B12FC.7030106@redhat.com> Hey Robert, In 0.3.8 the arrays for rpc/encoded services got much easier (and got fixed for servers that required the 'soap-enc:arrayType' attribute like this one). In 0.3.8 the encoded arrays now work like document/literal and rpc/literal arrays have for a long time. That is, you can simply pass them as you would expect in python - as a list or tuple. In any case, you can pass the array of integers in 0.3.8 to the http://mssoapinterop.org/asmx/simple.asmx?WSDL service as follows (or anything like this): client.service.echoIntegerArray([1,2,3]) Suds 0.3.8 is soon to be released. Regards, Jeff On 11/23/2009 03:47 PM, Robert Marsanyi wrote: > I see lots of history about using array complex types in SOAP requests, > but I still can't divine how to do it right. Ultimately, I need to > generate an array of complex structures, but the array part is baffling > me, so I thought I'd start with an array of integers, using a service > that's specifically designed for testing. > > Using the WSDL specified in public.py at > http://mssoapinterop.org/asmx/simple.asmx?WSDL, I'm trying to use the > echoIntegerArray service. I've tried a number of different ways to build > the array in the request call, but none seem to work; every request > returns a syntactically correct, but empty, response (that is, > result=client.service.echoIntegerArray(array)) always returns None, > regardless of the machinations I use to construct the variable "array". > > Can someone show me the client code for an array of ints that works with > this service? > > --rbt > > > > _______________________________________________ > 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From elyrwendynesh at gmail.com Tue Nov 24 11:22:52 2009 From: elyrwendynesh at gmail.com (Elyrwen Dynesh) Date: Tue, 24 Nov 2009 12:22:52 +0100 Subject: [Fedora-suds-list] Suds and no internet connection Message-ID: <58b36a720911240322v1c61c375t7e0599ab226ff00d@mail.gmail.com> Hello, I need to use suds to parse a wsdl available on my local network, however there is no connection to the internet. Port 80 is blocked in and out. What are my options? So far, I was thinking about the following solutions: 1. Unblock 80 and let suds parse the wsdl and create the schemas in /tmp/suds. Then block 80 and use suds normally. This seems to work, however I don't know how long? Is there any caching -------------- next part -------------- An HTML attachment was scrubbed... URL: From jortel at redhat.com Tue Nov 24 14:05:26 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 24 Nov 2009 08:05:26 -0600 Subject: [Fedora-suds-list] Suds and no internet connection In-Reply-To: <58b36a720911240322v1c61c375t7e0599ab226ff00d@mail.gmail.com> References: <58b36a720911240322v1c61c375t7e0599ab226ff00d@mail.gmail.com> Message-ID: <4B0BE826.60208@redhat.com> Hey Elyrwen, If the wsdl is self contained (it does not import anything) I'd suggest you download the wsdl and then use suds to parse the local file as: > > url = 'file:///home/edynesh/wsdl.xml' > client = Client(url) > Otherwise, you can do as you suggested and let suds resolve the dependencies and rely on the cache to store the files locally. Or, you can read the wsdl and manually download all of the dependencies as well. On 11/24/2009 05:22 AM, Elyrwen Dynesh wrote: > Hello, > > I need to use suds to parse a wsdl available on my local network, > however there is no connection > to the internet. Port 80 is blocked in and out. What are my options? So > far, I was thinking about the following solutions: > > 1. Unblock 80 and let suds parse the wsdl and create the schemas in > /tmp/suds. Then block 80 and use suds normally. This seems to work, > however I don't know how long? Is there any caching Yes, you can do this. By default, suds caches files in /tmp/suds for 1 day. You can change this by doing something like: > > client.options.cache.setduration(days=0) # 0 = forever > > > > > > > _______________________________________________ > 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From danjrod at gmail.com Tue Nov 24 16:43:53 2009 From: danjrod at gmail.com (Daniel Rodriguez) Date: Tue, 24 Nov 2009 17:43:53 +0100 Subject: [Fedora-suds-list] Suds and no internet connection In-Reply-To: <4B0BE826.60208@redhat.com> References: <58b36a720911240322v1c61c375t7e0599ab226ff00d@mail.gmail.com> <4B0BE826.60208@redhat.com> Message-ID: <8ba9089f0911240843g262245cdveaf0d12384734714@mail.gmail.com> Hi Jeff, This discussion has brought back a couple of thoughts I had when I started using Suds. - Would it not be possible to load the WSDL from a string ? - Would it not be possible to load the "cache" also from a string/file (or even remove the cache concept)? Although I am sure that the "cache" concept has uses for some people, I feel that most people use the client against invariant WSDL files and therefore have no need for a "cache" concept, but for a pre-generated version. This may open the door to having an independent tool to pre-generate the "cache" with the WSDL file and then let people have a client that works (with the same API as today) by loading that "cache" (call it: "pre-generated set of objects") instead of referencing the WSDL. Best regards On Tue, Nov 24, 2009 at 15:05, Jeff Ortel wrote: > Hey Elyrwen, > > If the wsdl is self contained (it does not import anything) I'd suggest you > download the wsdl and then use suds to parse the local file as: > > > > > url = 'file:///home/edynesh/wsdl.xml' > > client = Client(url) > > > > Otherwise, you can do as you suggested and let suds resolve the > dependencies and rely on the cache to store the files locally. Or, you can > read the wsdl and manually download all of the dependencies as well. > > On 11/24/2009 05:22 AM, Elyrwen Dynesh wrote: > >> Hello, >> >> I need to use suds to parse a wsdl available on my local network, >> however there is no connection >> to the internet. Port 80 is blocked in and out. What are my options? So >> far, I was thinking about the following solutions: >> >> 1. Unblock 80 and let suds parse the wsdl and create the schemas in >> /tmp/suds. Then block 80 and use suds normally. This seems to work, >> however I don't know how long? Is there any caching >> > > Yes, you can do this. By default, suds caches files in /tmp/suds for 1 > day. You can change this by doing something like: > > > > > client.options.cache.setduration(days=0) # 0 = forever > > > > >> >> >> >> >> _______________________________________________ >> 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jortel at redhat.com Tue Nov 24 18:02:55 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 24 Nov 2009 12:02:55 -0600 Subject: [Fedora-suds-list] soap encoded arrays in 0.3.8 Message-ID: <4B0C1FCF.8090409@redhat.com> All, Hopefully, this is good news :) Revision 607 completes unmarshaller side of the 'enhanced soap (section 5) encoded arrays' feature in 0.3.8. What this does is flatten the soap encoded arrays in rpc/encoded services into python lists. Remember, soap encoded arrays are Array objects which contain a collection of . So, for an array of (int), the XML would look like this: 1 2 In suds <= 0.3.7, this would be unmarshalled literally as: foo { numbers { number = ["1","2"] } } Or if the had the xsi:type attribute, foo { numbers { number = [1,2] } } because suds was interpreting the schema literally, that is what you got. In 0.3.8, the Encoded unmarshaller interprets and flattens the encoded array and gives you what you would expect: foo { numbers = [1,2] } A nice python list of integers :) which is symmetrical to what you would pass as an argument or nested attribute value. And, this is how rpc/literal and document/literal services have returned arrays for a long time. Also, in <= 0.3.7, empty soap encoded arrays were *not* represented as: foo { numbers { number = [] } } But rather: foo { numbers { number = '' } } which is broken. In 0.3.8, this was also fixed. Empty arrays are represented consistently as []. BIG WARNING HERE: Please notice that this feature changes the form of returned soap encoded arrays and WILL break some of your code. For this, I am really sorry and hope that you will agree that the benefits outweigh the hassle of porting you code after upgrade. Regards, Jeff -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From mcauthorn at gmail.com Tue Nov 24 18:16:12 2009 From: mcauthorn at gmail.com (Matt C) Date: Tue, 24 Nov 2009 13:16:12 -0500 Subject: [Fedora-suds-list] soap encoded arrays in 0.3.8 In-Reply-To: <4B0C1FCF.8090409@redhat.com> References: <4B0C1FCF.8090409@redhat.com> Message-ID: <42ea979e0911241016v558551c7x77bd62f91a0b333a@mail.gmail.com> Nice! Thanks a bunch Jeff, I was just having a conversation with a colleague about dealing with the returned structures. I'll pull this down and start testing asap; this should be a HUGE help though. -Matt On Tue, Nov 24, 2009 at 1:02 PM, Jeff Ortel wrote: > All, > > Hopefully, this is good news :) > > Revision 607 completes unmarshaller side of the 'enhanced soap (section 5) > encoded arrays' feature in 0.3.8. ?What this does is flatten the soap > encoded arrays in rpc/encoded services into python lists. ?Remember, soap > encoded arrays are Array objects which contain a collection of . > ?So, for an array of (int), the XML would look like this: > > > ? > ? ?1 > ? ?2 > ? > > > In suds <= 0.3.7, this would be unmarshalled literally as: > > foo { > ?numbers { > ? ?number = ["1","2"] > ?} > } > > Or if the had the xsi:type attribute, > > foo { > ?numbers { > ? ?number = [1,2] > ?} > } > > because suds was interpreting the schema literally, that is what you got. > In 0.3.8, the Encoded unmarshaller interprets and flattens the encoded array > and gives you what you would expect: > > foo { > ?numbers = [1,2] > } > > A nice python list of integers :) which is symmetrical to what you would > pass as an > argument or nested attribute value. ?And, this is how rpc/literal and > document/literal > services have returned arrays for a long time. > > Also, in <= 0.3.7, empty soap encoded arrays were *not* represented as: > > foo { > ?numbers { > ? ?number = [] > ?} > } > > But rather: > > foo { > ?numbers { > ? ?number = '' > ?} > } > > which is broken. > > In 0.3.8, this was also fixed. ?Empty arrays are represented consistently as > []. > > BIG WARNING HERE: > > Please notice that this feature changes the form of returned soap encoded > arrays and WILL break some of your code. ?For this, I am really sorry and > hope that you will agree that the benefits outweigh the hassle of porting > you code after upgrade. > > Regards, > > Jeff > > > _______________________________________________ > 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 Nov 24 21:31:18 2009 From: jortel at redhat.com (Jeff Ortel) Date: Tue, 24 Nov 2009 15:31:18 -0600 Subject: [Fedora-suds-list] soap encoded arrays in 0.3.8 In-Reply-To: <42ea979e0911241016v558551c7x77bd62f91a0b333a@mail.gmail.com> References: <4B0C1FCF.8090409@redhat.com> <42ea979e0911241016v558551c7x77bd62f91a0b333a@mail.gmail.com> Message-ID: <4B0C50A6.10608@redhat.com> On 11/24/2009 12:16 PM, Matt C wrote: > Nice! Thanks a bunch Jeff, I was just having a conversation with a > colleague about dealing with the returned structures. I'll pull this > down and start testing asap; this should be a HUGE help though. I'm glad you think so. I wish I'd done it sooner. Please let me know how your testing goes. It really helps! > > -Matt > > On Tue, Nov 24, 2009 at 1:02 PM, Jeff Ortel wrote: >> All, >> >> Hopefully, this is good news :) >> >> Revision 607 completes unmarshaller side of the 'enhanced soap (section 5) >> encoded arrays' feature in 0.3.8. What this does is flatten the soap >> encoded arrays in rpc/encoded services into python lists. Remember, soap >> encoded arrays are Array objects which contain a collection of. >> So, for an array of (int), the XML would look like this: >> >> >> >> 1 >> 2 >> >> >> >> In suds<= 0.3.7, this would be unmarshalled literally as: >> >> foo { >> numbers { >> number = ["1","2"] >> } >> } >> >> Or if the had the xsi:type attribute, >> >> foo { >> numbers { >> number = [1,2] >> } >> } >> >> because suds was interpreting the schema literally, that is what you got. >> In 0.3.8, the Encoded unmarshaller interprets and flattens the encoded array >> and gives you what you would expect: >> >> foo { >> numbers = [1,2] >> } >> >> A nice python list of integers :) which is symmetrical to what you would >> pass as an >> argument or nested attribute value. And, this is how rpc/literal and >> document/literal >> services have returned arrays for a long time. >> >> Also, in<= 0.3.7, empty soap encoded arrays were *not* represented as: >> >> foo { >> numbers { >> number = [] >> } >> } >> >> But rather: >> >> foo { >> numbers { >> number = '' >> } >> } >> >> which is broken. >> >> In 0.3.8, this was also fixed. Empty arrays are represented consistently as >> []. >> >> BIG WARNING HERE: >> >> Please notice that this feature changes the form of returned soap encoded >> arrays and WILL break some of your code. For this, I am really sorry and >> hope that you will agree that the benefits outweigh the hassle of porting >> you code after upgrade. >> >> Regards, >> >> Jeff >> >> >> _______________________________________________ >> 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: 5126 bytes Desc: S/MIME Cryptographic Signature URL: From suds at monte-stello.com Tue Nov 24 22:32:42 2009 From: suds at monte-stello.com (Antoine Sirinelli) Date: Tue, 24 Nov 2009 22:32:42 +0000 Subject: [Fedora-suds-list] Cannot import a web service Message-ID: <20091124223241.GB12109@pokemon> Hello, I am trying to use Suds with the English Live Departure Board Web Service. This service is documented there: http://www.livedepartureboards.co.uk/ldbws/ If I try to connect a suds client to this service: c=suds.client.Client('http://realtime.nationalrail.co.uk/ldbws/wsdl.aspx') I get an AttributeError: "'list' object has no attribute 'root'" at the line "types.root.append(d.root)" in wsdl.py (line 365) I have the same error for the version 0.3.7, 0.3.8 and the SVN. If someone has an idea how I could use this webserservice, I would appreciate any help. Many thanks, Antoine From lanstein at yahoo.com Wed Nov 25 22:10:31 2009 From: lanstein at yahoo.com (David Lanstein) Date: Wed, 25 Nov 2009 14:10:31 -0800 (PST) Subject: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8? Message-ID: <883208.86007.qm@web58904.mail.re1.yahoo.com> Hi Jeff, My unit tests are now failing in the 0.3.8 beta, all with the same error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 2: ordinal not in range(128). I'll pull together a test case, but in the meantime, an example raw SOAP request is (note the umlauts and Chinese chars): xxx xxx xxx true true false {majorNumber = 3, namespace = SFGA, minorNumber = 0, } Lead Jo? M?ke ???? joe at example.com Lead B?b M?ke ???? bob at example.com From lanstein at yahoo.com Wed Nov 25 22:17:24 2009 From: lanstein at yahoo.com (David Lanstein) Date: Wed, 25 Nov 2009 14:17:24 -0800 (PST) Subject: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8? In-Reply-To: <883208.86007.qm@web58904.mail.re1.yahoo.com> References: <883208.86007.qm@web58904.mail.re1.yahoo.com> Message-ID: <269082.61133.qm@web58901.mail.re1.yahoo.com> r595 is the first revision to throw the exception. ----- Original Message ---- From: David Lanstein To: fedora-suds-list at redhat.com Sent: Wed, November 25, 2009 2:10:31 PM Subject: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8? Hi Jeff, My unit tests are now failing in the 0.3.8 beta, all with the same error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 2: ordinal not in range(128). I'll pull together a test case, but in the meantime, an example raw SOAP request is (note the umlauts and Chinese chars): xxx xxx xxx true true false {majorNumber = 3, namespace = SFGA, minorNumber = 0, } Lead Jo? M?ke ???? joe at example.com Lead B?b M?ke ???? bob at example.com _______________________________________________ fedora-suds-list mailing list fedora-suds-list at redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list From lanstein at yahoo.com Wed Nov 25 22:24:17 2009 From: lanstein at yahoo.com (David Lanstein) Date: Wed, 25 Nov 2009 14:24:17 -0800 (PST) Subject: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8 - fix In-Reply-To: <269082.61133.qm@web58901.mail.re1.yahoo.com> References: <883208.86007.qm@web58904.mail.re1.yahoo.com> <269082.61133.qm@web58901.mail.re1.yahoo.com> Message-ID: <241735.55236.qm@web58903.mail.re1.yahoo.com> trunk/suds/sax/text.py - d[cls.base] = str(t) + d[cls.base] = unicode(t) ----- Original Message ---- From: David Lanstein To: David Lanstein ; fedora-suds-list at redhat.com Sent: Wed, November 25, 2009 2:17:24 PM Subject: Re: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8? r595 is the first revision to throw the exception. ----- Original Message ---- From: David Lanstein To: fedora-suds-list at redhat.com Sent: Wed, November 25, 2009 2:10:31 PM Subject: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8? Hi Jeff, My unit tests are now failing in the 0.3.8 beta, all with the same error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 2: ordinal not in range(128). I'll pull together a test case, but in the meantime, an example raw SOAP request is (note the umlauts and Chinese chars): xxx xxx xxx true true false {majorNumber = 3, namespace = SFGA, minorNumber = 0, } Lead Jo? M?ke ???? joe at example.com Lead B?b M?ke ???? bob at example.com _______________________________________________ fedora-suds-list mailing list fedora-suds-list at redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list From lanstein at yahoo.com Wed Nov 25 22:31:25 2009 From: lanstein at yahoo.com (David Lanstein) Date: Wed, 25 Nov 2009 14:31:25 -0800 (PST) Subject: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8 - fix In-Reply-To: <241735.55236.qm@web58903.mail.re1.yahoo.com> References: <883208.86007.qm@web58904.mail.re1.yahoo.com> <269082.61133.qm@web58901.mail.re1.yahoo.com> <241735.55236.qm@web58903.mail.re1.yahoo.com> Message-ID: <50006.97289.qm@web58904.mail.re1.yahoo.com> Should have noted, line 121 in head @608. David Lanstein Author, Salesforce Python Toolkit (http://code.google.com/p/salesforce-python-toolkit/) - built on Suds! ----- Original Message ---- From: David Lanstein To: David Lanstein ; fedora-suds-list at redhat.com Sent: Wed, November 25, 2009 2:24:17 PM Subject: Re: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8 - fix trunk/suds/sax/text.py - d[cls.base] = str(t) + d[cls.base] = unicode(t) ----- Original Message ---- From: David Lanstein To: David Lanstein ; fedora-suds-list at redhat.com Sent: Wed, November 25, 2009 2:17:24 PM Subject: Re: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8? r595 is the first revision to throw the exception. ----- Original Message ---- From: David Lanstein To: fedora-suds-list at redhat.com Sent: Wed, November 25, 2009 2:10:31 PM Subject: [Fedora-suds-list] UTF-8 encoding issue in 0.3.8? Hi Jeff, My unit tests are now failing in the 0.3.8 beta, all with the same error: UnicodeEncodeError: 'ascii' codec can't encode character u'\xeb' in position 2: ordinal not in range(128). I'll pull together a test case, but in the meantime, an example raw SOAP request is (note the umlauts and Chinese chars): xxx xxx xxx true true false {majorNumber = 3, namespace = SFGA, minorNumber = 0, } Lead Jo? M?ke ???? joe at example.com Lead B?b M?ke ???? bob at example.com _______________________________________________ fedora-suds-list mailing list fedora-suds-list at redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list From rnm at whidbey.com Sat Nov 28 20:08:29 2009 From: rnm at whidbey.com (Robert Marsanyi) Date: Sat, 28 Nov 2009 12:08:29 -0800 Subject: [Fedora-suds-list] 0.3.8 and arrays Message-ID: Hi, Jeff. Thanks for the array handling upgrade, and incorporating the example of an ArrayOfInteger into the mssoapinterop example in public.py. Works great. So I'm trying to extend it to handle my particular case, and not having any success. In this case, I have an ArrayOfOrderData embedded in a structure, where OrderData is a 3-element structure of string, string, base64binary (I'm not using this last one). For details, the WSDL is at http://www.customcd.us:8009/test/TestOrderReceiver.wsdl I'm not able to set up an ArrayOfOrderData in the OrderInfo parent structure, and put two OrderData elements in it. I've tried creating an ArrayOfOrderData with an items[] attribute; creating an Array and setting the _arrayType to OrderData[], and using an items[] attribute. Sorry to be so dense, but what am I missing? --rbt -------------- next part -------------- A non-text attachment was scrubbed... Name: Robert Marsanyi.vcf Type: text/x-vcard Size: 550 bytes Desc: not available URL: