From zander at parkinginmotion.com Mon Aug 1 23:27:24 2011 From: zander at parkinginmotion.com (Zander Lichstein) Date: Mon, 1 Aug 2011 14:27:24 -0700 Subject: [Soap-Python] Painful experience getting soaplib services working Message-ID: We're trying to expose a set of soap services to a 3rd party who is using the MS toolset. The net effect of the problem is that his tools throw a bunch of errors when trying to read my wsdl, and I can also confirm that the WS-I validator in soapUI fails as well with a bunch of cryptic errors - though the services seem to work if I don't worry about validation. I don't expect the group to solve all my problems for me, but I have a few questions which might help: 1. The namespace defined by http://www.w3.org/2001/XMLSchema is referenced in the namespace.py constants, but that particular URL is not an xsd at all, so validation fails. Why is that URL included and not the .xsd version? Is that supposed to work? 2. That same namespace ends up nested as imports within most "types" nodes with Primitives. For example: ... <-- Why is this namespaces being imported again... under itself?!? 3. Is soaplib and the wsdl generation supposed to interoperate with the Microsoft Web Services tools? Any tips? 4. Is soaplib supposed to generate wsdl which validates using the WS-I tools? -- Zander -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Tue Aug 2 12:51:12 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 02 Aug 2011 13:51:12 +0300 Subject: [Soap-Python] Painful experience getting soaplib services working In-Reply-To: References: Message-ID: <4E37D6A0.40004@arskom.com.tr> On 08/02/11 00:27, Zander Lichstein wrote: > We're trying to expose a set of soap services to a 3rd party who is > using the MS toolset. The net effect of the problem is that his tools > throw a bunch of errors when trying to read my wsdl, and I can also > confirm that the WS-I validator in soapUI fails as well with a bunch > of cryptic errors - though the services seem to work if I don't worry > about validation. I don't expect the group to solve all my problems > for me, but I have a few questions which might help: > > 1. The namespace defined by http://www.w3.org/2001/XMLSchema is > referenced in the namespace.py constants, but that particular URL is > not an xsd at all, so validation fails. Why is that URL included and > not the .xsd version? Is that supposed to work? Hi Zander, When we include the url, the popular schema parsers start recursively retrieving relavant xml schema files online. This behaviour will get you banned from those services eventually. no consensus was reached about whether/how to include these files, so i guess everybody patches the relevant part of the code to suit their needs. > 2. That same namespace ends up nested as imports within most "types" > nodes with Primitives. For example: > > This causes problems > ... > > ... > > <-- > Why is this namespaces being imported again... under itself?!? > my comments above apply to this point as well. > 3. Is soaplib and the wsdl generation supposed to interoperate with > the Microsoft Web Services tools? Any tips? I don't have access to any Microsoft boxes, so I personally can't help you with the latest rpclib/soaplib. Nobody contributed tests, so I can't test my changes against MS toolbox either. However, I was told that soaplib 1.0 interoperates fine with ms toolbox. It is actually passing all WS-I tests. You can just use it. The WS-I test infrastructure is still there, and it's going to be your starting point if you're willing to contribute to the latest versions. see: https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/test/interop/test_wsi.py https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/test/README > 4. Is soaplib supposed to generate wsdl which validates using the WS-I > tools? > no but that'd be nice :) i hope that helps, burak -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Tue Aug 2 13:19:08 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Tue, 02 Aug 2011 14:19:08 +0300 Subject: [Soap-Python] Painful experience getting soaplib services working In-Reply-To: <4E37D6A0.40004@arskom.com.tr> References: <4E37D6A0.40004@arskom.com.tr> Message-ID: <4E37DD2C.5090402@arskom.com.tr> On 08/02/11 13:51, Burak Arslan wrote: > >> 4. Is soaplib supposed to generate wsdl which validates using the >> WS-I tools? >> > > no but that'd be nice :) > i've actually taken a look at the wsdl files generated by both versions of soaplib. https://github.com/soaplib/soaplib/blob/soaplib-1.0.0/src/soaplib/test/wsdl.xml https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/test/wsdl.xml i guess the important difference is that in 1.0 we have just one service tag like so: whereas in trunk we have multiple service tags for each service class, like so: according to the commit history, that's where this was introduced: https://github.com/rbarrois/soaplib/commit/8530a70b4a43773cf2d3d6997991ec8187e0a3ba So maybe the original author can chime in? Passing the wsi tests should be an important goal of soaplib. any help on this subject would be appreciated. best, burak -------------- next part -------------- An HTML attachment was scrubbed... URL: From burak.arslan at arskom.com.tr Thu Aug 4 10:47:45 2011 From: burak.arslan at arskom.com.tr (Burak Arslan) Date: Thu, 04 Aug 2011 11:47:45 +0300 Subject: [Soap-Python] Painful experience getting soaplib services working In-Reply-To: <229954A6-01B7-4E80-8756-575E08AC72D9@polyconseil.fr> References: <4E37D6A0.40004@arskom.com.tr> <4E37DD2C.5090402@arskom.com.tr> <229954A6-01B7-4E80-8756-575E08AC72D9@polyconseil.fr> Message-ID: <4E3A5CB1.20408@arskom.com.tr> On 08/04/11 10:49, Rapha??l Barrois wrote: > Let me know if this specific patch introduces non-validating changes, > I'd be happy to contribute fixes. Hello Raphael The tool is at: http://www.ws-i.org/Testing/Tools/2005/06/WSI_Test_Java_Final_1.1.zip Have a look here: https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/test/README Here's the error I get by running test_wsi.py: Analyzer Stopped By Exception: Analyzer Stopped By Exception: WSDL Port 'ValidatingApplication' for Service '{soaplib.core.test.interop.server._service}ValidatingApplication' not found in service description So my guess is that it has to do with multiple services or multiple porttypes patch. Best Regards, Burak From raphael.barrois at polyconseil.fr Thu Aug 4 09:49:17 2011 From: raphael.barrois at polyconseil.fr (=?iso-8859-1?Q?Rapha=EBl_Barrois?=) Date: Thu, 4 Aug 2011 09:49:17 +0200 Subject: [Soap-Python] Painful experience getting soaplib services working In-Reply-To: <4E37DD2C.5090402@arskom.com.tr> References: <4E37D6A0.40004@arskom.com.tr> <4E37DD2C.5090402@arskom.com.tr> Message-ID: <229954A6-01B7-4E80-8756-575E08AC72D9@polyconseil.fr> Hi Burak, On 2 ao?t 2011, at 13:19, Burak Arslan wrote: > On 08/02/11 13:51, Burak Arslan wrote: >> >>> 4. Is soaplib supposed to generate wsdl which validates using the WS-I tools? >>> >> >> no but that'd be nice :) >> > > i've actually taken a look at the wsdl files generated by both versions of soaplib. > > https://github.com/soaplib/soaplib/blob/soaplib-1.0.0/src/soaplib/test/wsdl.xml > https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/test/wsdl.xml > > i guess the important difference is that in 1.0 we have just one service tag like so: > > [...] > > whereas in trunk we have multiple service tags for each service class, like so: > > [...] > > according to the commit history, that's where this was introduced: > > https://github.com/rbarrois/soaplib/commit/8530a70b4a43773cf2d3d6997991ec8187e0a3ba > > So maybe the original author can chime in? Passing the wsi tests should be an important goal of soaplib. any help on this subject would be appreciated. I'm responsible for this change. When defining an "application" with several services (i.e DefinitionBase subclasses), the previous behaviour did put all methods of all services into a single WSDL "service". This commit splits them in various WSDL services, which is imho the expected behaviour. Another difference between those versions, maybe related to the current error, is that the new WSDL add this import at the toplevel schema: I couldn't find the WS-I validation tool, but WSDLs generated with the current version of soaplib can be used correctly with at least : suds, soapUI and some Microsoft Web Service Client (I don't know which exact version is being used by the people I'm working with). Let me know if this specific patch introduces non-validating changes, I'd be happy to contribute fixes. -- Rapha?l Barrois From burakarslan at sabanciuniv.edu Thu Aug 4 10:41:19 2011 From: burakarslan at sabanciuniv.edu (Burak Arslan) Date: Thu, 04 Aug 2011 11:41:19 +0300 Subject: [Soap-Python] Painful experience getting soaplib services working In-Reply-To: <229954A6-01B7-4E80-8756-575E08AC72D9@polyconseil.fr> References: <4E37D6A0.40004@arskom.com.tr> <4E37DD2C.5090402@arskom.com.tr> <229954A6-01B7-4E80-8756-575E08AC72D9@polyconseil.fr> Message-ID: <4E3A5B2F.2040404@sabanciuniv.edu> On 08/04/11 10:49, Rapha?l Barrois wrote: > Let me know if this specific patch introduces non-validating changes, > I'd be happy to contribute fixes. Hello Raphael The tool is at: http://www.ws-i.org/Testing/Tools/2005/06/WSI_Test_Java_Final_1.1.zip Have a look here: https://github.com/soaplib/soaplib/blob/master/src/soaplib/core/test/README Here's the error I get by running test_wsi.py: Analyzer Stopped By Exception: Analyzer Stopped By Exception: WSDL Port 'ValidatingApplication' for Service '{soaplib.core.test.interop.server._service}ValidatingApplication' not found in service description So my guess is that it has to do with multiple services or multiple porttypes patch. Best Regards, Burak From shahjapan at gmail.com Tue Aug 9 11:13:38 2011 From: shahjapan at gmail.com (Japan Shah) Date: Tue, 9 Aug 2011 14:43:38 +0530 Subject: [Soap-Python] how to fetch client's IP Address in soap method? Message-ID: Hello, can anyone has idea how to retrieve the client's IP Address in exposed soap method ? any help or link for such example would be appreciated ! -- #Japan Shah -------------- next part -------------- An HTML attachment was scrubbed... URL: From shahjapan at gmail.com Tue Aug 9 12:28:20 2011 From: shahjapan at gmail.com (Japan Shah) Date: Tue, 9 Aug 2011 15:58:20 +0530 Subject: [Soap-Python] how to fetch client's IP Address in soap method? In-Reply-To: <20033.2715.532234.587367@localhost.localdomain> References: <20033.2715.532234.587367@localhost.localdomain> Message-ID: I'm using SoapLib for my server side web service implementation, and suds as a soapClient, for client side communication On 9 August 2011 15:53, Dieter Maurer wrote: > Japan Shah wrote at 2011-8-9 14:43 +0530: > > can anyone has idea how to retrieve the client's IP Address in exposed > >soap method ? > >any help or link for such example would be appreciated ! > > SOAP itself is transport independent and therefore does not know > anything about IP adresses. > > Therefore, it depends on your (lower level) web framework and its > transport layer how you can access the IP address. > > > To get more precise information, you must tell us > which web framework and which SOAP framework you are using. > > -- > Dieter > -- #Japan Shah -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieter at handshake.de Tue Aug 9 12:23:23 2011 From: dieter at handshake.de (Dieter Maurer) Date: Tue, 9 Aug 2011 12:23:23 +0200 Subject: [Soap-Python] how to fetch client's IP Address in soap method? In-Reply-To: References: Message-ID: <20033.2715.532234.587367@localhost.localdomain> Japan Shah wrote at 2011-8-9 14:43 +0530: > can anyone has idea how to retrieve the client's IP Address in exposed >soap method ? >any help or link for such example would be appreciated ! SOAP itself is transport independent and therefore does not know anything about IP adresses. Therefore, it depends on your (lower level) web framework and its transport layer how you can access the IP address. To get more precise information, you must tell us which web framework and which SOAP framework you are using. -- Dieter From esiotrot at gmail.com Tue Aug 9 13:51:25 2011 From: esiotrot at gmail.com (Michael Wood) Date: Tue, 9 Aug 2011 13:51:25 +0200 Subject: [Soap-Python] how to fetch client's IP Address in soap method? In-Reply-To: <20033.2715.532234.587367@localhost.localdomain> References: <20033.2715.532234.587367@localhost.localdomain> Message-ID: Hi On 9 August 2011 12:23, Dieter Maurer wrote: > Japan Shah wrote at 2011-8-9 14:43 +0530: >> ? can anyone has idea how to retrieve the client's IP Address in exposed >>soap method ? >>any help or link for such example would be appreciated ! > > SOAP itself is transport independent and therefore does not know > anything about IP adresses. > > Therefore, it depends on your (lower level) web framework and its > transport layer how you can access the IP address. > > > To get more precise information, you must tell us > which web framework and which SOAP framework you are using. I'm also interested in this. I'm using Apache with mod_wsgi and soaplib-1.0. -- Michael Wood From esiotrot at gmail.com Tue Aug 9 13:53:01 2011 From: esiotrot at gmail.com (Michael Wood) Date: Tue, 9 Aug 2011 13:53:01 +0200 Subject: [Soap-Python] how to fetch client's IP Address in soap method? In-Reply-To: References: <20033.2715.532234.587367@localhost.localdomain> Message-ID: Hi On 9 August 2011 12:28, Japan Shah wrote: > I'm using SoapLib for my server side web service implementation, > and suds as a soapClient, for client side communication OK, but how is your soaplib code being run? Apache with mod_wsgi? Or something else? > On 9 August 2011 15:53, Dieter Maurer wrote: >> >> Japan Shah wrote at 2011-8-9 14:43 +0530: >> > ? can anyone has idea how to retrieve the client's IP Address in exposed >> >soap method ? >> >any help or link for such example would be appreciated ! >> >> SOAP itself is transport independent and therefore does not know >> anything about IP adresses. >> >> Therefore, it depends on your (lower level) web framework and its >> transport layer how you can access the IP address. >> >> >> To get more precise information, you must tell us >> which web framework and which SOAP framework you are using. -- Michael Wood From shahjapan at gmail.com Tue Aug 9 14:28:36 2011 From: shahjapan at gmail.com (Japan Shah) Date: Tue, 9 Aug 2011 17:58:36 +0530 Subject: [Soap-Python] how to fetch client's IP Address in soap method? In-Reply-To: References: <20033.2715.532234.587367@localhost.localdomain> Message-ID: Yess its running under apache - mod_wsgi. On 9 August 2011 17:23, Michael Wood wrote: > mod_wsgi -- #Japan Shah -------------- next part -------------- An HTML attachment was scrubbed... URL: From esiotrot at gmail.com Tue Aug 9 20:28:11 2011 From: esiotrot at gmail.com (Michael Wood) Date: Tue, 9 Aug 2011 20:28:11 +0200 Subject: [Soap-Python] how to fetch client's IP Address in soap method? In-Reply-To: <20033.2715.532234.587367@localhost.localdomain> References: <20033.2715.532234.587367@localhost.localdomain> Message-ID: Hi On 9 August 2011 12:23, Dieter Maurer wrote: > Japan Shah wrote at 2011-8-9 14:43 +0530: >> ? can anyone has idea how to retrieve the client's IP Address in exposed >>soap method ? >>any help or link for such example would be appreciated ! > > SOAP itself is transport independent and therefore does not know > anything about IP adresses. > > Therefore, it depends on your (lower level) web framework and its > transport layer how you can access the IP address. > > > To get more precise information, you must tell us > which web framework and which SOAP framework you are using. Thanks, Dieter. With the above hints I was able to figure it out. I added an __init__() method to my service as follows: class MyService(DefinitionBase): def __init__(self, environ=None): self.environ = environ or {} DefinitionBase.__init__(self, environ) and then I can access the client's IP as follows: @rpc(_returns=String) def Info(self): client = self.environ.get("REMOTE_ADDR", "(unknown)") logging.info("[%s] Called Info()", client) info = "SOAP Service" return info -- Michael Wood From shahjapan at gmail.com Wed Aug 10 08:24:13 2011 From: shahjapan at gmail.com (Japan Shah) Date: Wed, 10 Aug 2011 11:54:13 +0530 Subject: [Soap-Python] how to fetch client's IP Address in soap method? In-Reply-To: References: <20033.2715.532234.587367@localhost.localdomain> Message-ID: Not Worked for me, I'm using SoapLib 2.0 beta On 9 August 2011 23:58, Michael Wood wrote: > Hi > > On 9 August 2011 12:23, Dieter Maurer wrote: > > Japan Shah wrote at 2011-8-9 14:43 +0530: > >> can anyone has idea how to retrieve the client's IP Address in exposed > >>soap method ? > >>any help or link for such example would be appreciated ! > > > > SOAP itself is transport independent and therefore does not know > > anything about IP adresses. > > > > Therefore, it depends on your (lower level) web framework and its > > transport layer how you can access the IP address. > > > > > > To get more precise information, you must tell us > > which web framework and which SOAP framework you are using. > > Thanks, Dieter. With the above hints I was able to figure it out. > > I added an __init__() method to my service as follows: > > class MyService(DefinitionBase): > > def __init__(self, environ=None): > self.environ = environ or {} > DefinitionBase.__init__(self, environ) > > and then I can access the client's IP as follows: > > @rpc(_returns=String) > def Info(self): > client = self.environ.get("REMOTE_ADDR", "(unknown)") > logging.info("[%s] Called Info()", client) > info = "SOAP Service" > return info > > -- > Michael Wood > -- #Japan Shah -------------- next part -------------- An HTML attachment was scrubbed... URL: From dieter at handshake.de Wed Aug 10 08:45:34 2011 From: dieter at handshake.de (Dieter Maurer) Date: Wed, 10 Aug 2011 08:45:34 +0200 Subject: [Soap-Python] how to fetch client's IP Address in soap method? In-Reply-To: References: Message-ID: <20034.10510.651837.657812@localhost.localdomain> Japan Shah wrote at 2011-8-10 11:54 +0530: >Not Worked for me, In general, "not worked" is too weak. Usually, we must know what happened instead of the expected behavior (e.g. did the web server reported a problem (which one); what has been logged (by the web server, by the framework). >I'm using SoapLib 2.0 beta I see 2 options for you: * wait until someone with the necessary insight steps in and tells you how you achieve your goals * look yourself at the code. The component integrating with the web framework (i.e. what is activated by "mod_wsgi") somehow gets the request information (including the IP address). You must find a way how to pass this information on to your method implementation. I would be surprised if your version would be very different from the one Michael successfully used his code for. -- Dieter From shahjapan at gmail.com Wed Aug 10 18:34:10 2011 From: shahjapan at gmail.com (Japan Shah) Date: Wed, 10 Aug 2011 22:04:10 +0530 Subject: [Soap-Python] how to fetch client's IP Address in soap method? In-Reply-To: <20034.10510.651837.657812@localhost.localdomain> References: <20034.10510.651837.657812@localhost.localdomain> Message-ID: I tried with old version of SoapLib too, but couldn't get succeedm because environ remains None even if we pass dict, its not updating it, because wsgiApp actually doesn't transfer the http_req_env to DefinitionBase, so link is breaking in decomosing incoming message, I worked out, but wrote my own class inheriting wsgi.Base... On 10 August 2011 12:15, Dieter Maurer wrote: > Japan Shah wrote at 2011-8-10 11:54 +0530: > >Not Worked for me, > > In general, "not worked" is too weak. Usually, we must know > what happened instead of the expected behavior (e.g. did the web server > reported a problem (which one); what has been logged (by the web server, > by the framework). > > >I'm using SoapLib 2.0 beta > > I see 2 options for you: > > * wait until someone with the necessary insight steps in > and tells you how you achieve your goals > > * look yourself at the code. > > The component integrating with the web framework (i.e. what > is activated by "mod_wsgi") somehow gets the request information > (including the IP address). > > You must find a way how to pass this information on > to your method implementation. > > I would be surprised if your version would be very different > from the one Michael successfully used his code for. > > > > -- > Dieter > -- #Japan Shah -------------- next part -------------- An HTML attachment was scrubbed... URL: