> From: Luc Saffre > To: generateds-users@lists.sourceforge.net > Sent: Monday, October 3, 2011 8:00 AM >
> Hello, > > I am trying to use generateDS (version 2.6a) to write a SOAP request and > got stuck, and now I hope to get help from you. > > I suggest to read the formatted version of the remaining text of this > mail at http://lino.saffre-rumma.net/autodoc/lino.utils.bcss.test.html > > Otherwise, see below for the unformatted version of my question. > > Thanks in advance for any hint or commant! > > Luc > > I am trying to use generateDS (version 2.6a) to write a SOAP request to > the Belgian `BCSS server <http://www.ksz-bcss.fgov.be>`_ > (Banque Carrefour de la Sécurité Sociale, > "Crossroads Bank for Social Security"). > > I got a set of XSD files that describe the services provided by the > BCSS. I could sucessfully convert them to Python modules using > commands like:: > > python -m generateDS -o SSDNRequest.py XSD\SSDN\SERVICE \SSDNREQUEST.XSD > > (See :srcref:`xsd2py.bat </lino/utils/bcss/xsd2py.bat>` > for the actual commands used on a windows machine.) > > Currently only the `SSDNRequest.py` module is being used, > you can browse the input XSD > :srcref:`here </lino/utils/bcss/XSD/SSDN/SERVICE/SSDNREQUEST.XSD>` > and the generated source code > :srcref:`here </lino/utils/bcss/SSDNRequest.py>`. > > Running the :mod:`lino.utils.bcss.test` module > (source code :srcref:`here </lino/utils/bcss/test.py>`) > should simply output an XML string to stdout. > My problem is that it causes a traceback:: > > Traceback (most recent call last): > File "test.py", line 45, in <module> > req.export(f,0) > File "SSDNRequest.py", line 613, in export > self.exportChildren(outfile, level + 1, namespace_, name_) > File "SSDNRequest.py", line 622, in exportChildren > self.RequestContext.export(outfile, level, namespace_, > name_='RequestContext', ) > File "SSDNRequest.py", line 525, in export > self.exportChildren(outfile, level + 1, namespace_, name_) > File "SSDNRequest.py", line 534, in exportChildren > self.AuthorizedUser.export(outfile, level, namespace_, > name_='AuthorizedUser', ) > File "SSDNRequest.py", line 800, in export > self.exportChildren(outfile, level + 1, namespace_, name_) > File "SSDNRequest.py", line 810, in exportChildren > outfile.write('<%sUserID>%s</%sUserID>\\n' % (namespace_, > self.gds_format_string(quote_xml(self.UserID).encode(ExternalEncoding), > input_name='UserID'), namespace_)) > AttributeError: 'AuthorizedUserType' object has no attribute > 'gds_format_string' > > What is going wrong? > Luc - I found your test.py, schemas, etc in your Mecurial repository. But, I'm seeing a *different* error. When I ran test.py, it produced the following error: Traceback (most recent call last): File "test.py", line 63, in <module> req.export(f,0) File "/home/dkuhlman/a1/Bzr/Repo2/Generateds/Work/Users/Saffre/Tmp/lino/lino/utils/bcss/SSDNRequest.py", line 613, in export self.exportChildren(outfile, level + 1, namespace_, name_) File "/home/dkuhlman/a1/Bzr/Repo2/Generateds/Work/Users/Saffre/Tmp/lino/lino/utils/bcss/SSDNRequest.py", line 623, in exportChildren for ServiceRequest_ in self.ServiceRequest: TypeError: 'ServiceRequestType' object is not iterable So, I made this change to test.py: --- /home/dkuhlman/a1/Bzr/Repo2/Generateds/Work/Users/Saffre/Tmp/lino/lino/utils/bcss/test.py 2011-10-03 09:26:20.135940667 -0700 +++ test.py 2011-10-03 14:07:31.695946735 -0700 @@ -50,9 +50,11 @@ OrgUnit='123', MatrixID=12, MatrixSubID=3) -service = SSDNRequest.ServiceRequestType( - ServiceId='Test', - Version='20090409') +service = [ + SSDNRequest.ServiceRequestType( + ServiceId='Test', + Version='20090409'), + ] msg = SSDNRequest.RequestMessageType( Reference='123456789', TimeRequest='20110921T105230') @@ -81,4 +83,4 @@ </soap:Envelope> """ The ServiceRequest in the RequestContextType needs to be a list. Now, when I run test.py, I see the exported soap:Envelope. Is that what we want it to do? In a separate email, I've attached a copy of the files in that directory with the modified copy of test.py. Let me know if this still does not work for you or if there is another problem that I'm not seeing. - Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2dcopy1 _______________________________________________ generateds-users mailing list generateds-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/generateds-users