I was trying to use both XML-RPC and SOAP with Confluence 2.2.5 from Python. XML-RPC works fine, except for not handling UTF-8 communication well. The content you get from the Confluence server is OK, but if you put the same thing back the Unicode characters will be damaged.

      I am aware that XML-RPC has limitations with respect to such encodings, so I wanted to try my luck with the SOAP interface. It works for some function calls but for others it fails with the following 'duplicate' attribute error:
      (There was a similar issue for Jira a year ago, related to the Apache Axis version used).

      Traceback (most recent call last):
      File "iso.py", line 27, in ?
      pages = soap.getPages(auth, "QMS")
      File "/var/lib/python-support/python2.4/SOAPpy/Client.py", line 421, in _call_
      return self.__r_call(*args, **kw)
      File "/var/lib/python-support/python2.4/SOAPpy/Client.py", line 443, in __r_call
      self._hd, self._ma)
      File "/var/lib/python-support/python2.4/SOAPpy/Client.py", line 347, in __call
      p, attrs = parseSOAPRPC(r, attrs = 1)
      File "/var/lib/python-support/python2.4/SOAPpy/Parser.py", line 1006, in parseSOAPRPC
      t = _parseSOAP(xml_str, rules = rules)
      File "/var/lib/python-support/python2.4/SOAPpy/Parser.py", line 988, in _parseSOAP
      raise e
      xml.sax._exceptions.SAXParseException: <unknown>:1:474: duplicate attribute

      The example code:

      import SOAPpy, getpass, datetime

      soap = SOAPpy.WSDL.Proxy('https://wiki.iblsoft.com/rpc/soap-axis/confluenceservice-v1?wsdl')

      username = 'bot'
      password = '*******'
      auth = soap.login(username, password)

      pages = soap.getPages(auth, "QMS") # error
      spaces = soap.getSpaces(auth) # error
      page = soap.getPage(auth, 'SBX', 'Education') # works!

            [CONFSERVER-6720] SOAP Interface not working well from Python

            Just hit this bug on 5.7.5 ( is it still supported? ). Please, add this version to the list of affected versions and reopen it if v5.7.5 is still supported.

            buysellbewellpmullercfm, thank you for workaround, it worked for me!

             

            Denis Yaparov added a comment - Just hit this bug on 5.7.5 ( is it still supported? ). Please, add this version to the list of affected versions and reopen it if v5.7.5 is still supported. buysellbewell ,  pmullercfm , thank you for workaround, it worked for me!  

            Minh Tran added a comment -
            Atlassian update

            Thank you for taking the time to raise, comment or vote on this Bug. Currently this bug indicates that it only impacts a version of Confluence which is no longer in support, therefore we are closing this issue as Timed Out.
            If this issue is still impacting you on a recent version please feel free to comment with the affected version. Any further details you may be able to provide regarding reproduction or impact of this issue may help us better address this issue.
            Thanks again.
            Regards,
            Confluence Development

            Minh Tran added a comment - Atlassian update Thank you for taking the time to raise, comment or vote on this Bug. Currently this bug indicates that it only impacts a version of Confluence which is no longer in support, therefore we are closing this issue as Timed Out. If this issue is still impacting you on a recent version please feel free to comment with the affected version. Any further details you may be able to provide regarding reproduction or impact of this issue may help us better address this issue. Thanks again. Regards, Confluence Development

            I am currently using Atlassian Confluence 5.6.1. It looks like the fix above needs to be modified as follows (you need to pass ignore_ext=None):

            Quick and dirty fix for Python users (modified)
            def confluence_soap_parser(xml_str, rules=None, ignore_ext=None, parser=SOAPpy.Parser._parseSOAP):
                attribute = 'xsi:type="soapenc:Array"'
                xml_str = xml_str.replace('%s %s' % (attribute, attribute), attribute)
                return parser(xml_str, rules=rules)
            
            SOAPpy.Parser._parseSOAP = confluence_soap_parser
            

            Deleted Account (Inactive) added a comment - I am currently using Atlassian Confluence 5.6.1. It looks like the fix above needs to be modified as follows (you need to pass ignore_ext=None): Quick and dirty fix for Python users (modified) def confluence_soap_parser(xml_str, rules=None, ignore_ext=None, parser=SOAPpy.Parser._parseSOAP): attribute = 'xsi:type= "soapenc:Array" ' xml_str = xml_str.replace( '%s %s' % (attribute, attribute), attribute) return parser(xml_str, rules=rules) SOAPpy.Parser._parseSOAP = confluence_soap_parser

            After some investigation with one of my colleague, we determined that the "duplicate attribute" error comes from expat itself. For example, if you invoke the getSpaces method, Confluence sends a bogus XML response containing the xsi:type attribute twice in the getSpacesReturn element :

            <getSpacesReturn soapenc:arrayType="ns2:RemoteSpaceSummary[8]" xsi:type="soapenc:Array" xsi:type="soapenc:Array" xmlns:ns2="http://beans.soap.rpc.confluence.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            

            The issue really looks like the one which affected JIRA almost 5 years ago : JRA-7321.
            This one was fixed in a few weeks. What's so different there? Why doesn't Atlassian already fixed it?

            Waiting for an official answer, here is a quick and dirty fix for Python users :

            def confluence_soap_parser(xml_str, rules=None, parser=SOAPpy.Parser._parseSOAP):
                attribute = 'xsi:type="soapenc:Array"'
                xml_str = xml_str.replace('%s %s' % (attribute, attribute), attribute)
                return parser(xml_str, rules=rules)
            
            SOAPpy.Parser._parseSOAP = confluence_soap_parser
            

            Philippe Muller added a comment - After some investigation with one of my colleague, we determined that the "duplicate attribute" error comes from expat itself. For example, if you invoke the getSpaces method, Confluence sends a bogus XML response containing the xsi:type attribute twice in the getSpacesReturn element : <getSpacesReturn soapenc:arrayType="ns2:RemoteSpaceSummary[8]" xsi:type="soapenc:Array" xsi:type="soapenc:Array" xmlns:ns2="http://beans.soap.rpc.confluence.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> The issue really looks like the one which affected JIRA almost 5 years ago : JRA-7321 . This one was fixed in a few weeks. What's so different there? Why doesn't Atlassian already fixed it? Waiting for an official answer, here is a quick and dirty fix for Python users : def confluence_soap_parser(xml_str, rules=None, parser=SOAPpy.Parser._parseSOAP): attribute = 'xsi:type= "soapenc:Array" ' xml_str = xml_str.replace( '%s %s' % (attribute, attribute), attribute) return parser(xml_str, rules=rules) SOAPpy.Parser._parseSOAP = confluence_soap_parser

            Anatoli added a comment -

            Hi Greg,

            Unfortunately it is unlikely that this bug will be fixed soon. We try to prioritise issues according to their severity, impact, number of customers affected, availability of a work around and number of votes. There is always a huge bucket of issues and we try to fix those that have higher priority. This issue has not yet made it to the top of 'fix for' list. Also, at this point we try to prioritise work on REST API (the first glimpse of it will be available in 3.1) above any work on SOAP or XML-RPC.

            Please comment/vote if you disagree and think that it should be fixed soon.

            Anatoli.

            Anatoli added a comment - Hi Greg, Unfortunately it is unlikely that this bug will be fixed soon. We try to prioritise issues according to their severity, impact, number of customers affected, availability of a work around and number of votes. There is always a huge bucket of issues and we try to fix those that have higher priority. This issue has not yet made it to the top of 'fix for' list. Also, at this point we try to prioritise work on REST API (the first glimpse of it will be available in 3.1) above any work on SOAP or XML-RPC. Please comment/vote if you disagree and think that it should be fixed soon. Anatoli.

            No support for Unicode in the remote API is a serious issue. I hope this will be addressed soon. XML-RPC works fine however the fact that it doesn't support Unicode characters is a serious drawback. The SOAP API would be the solution.

            -Greg

            Greg Miller added a comment - No support for Unicode in the remote API is a serious issue. I hope this will be addressed soon. XML-RPC works fine however the fact that it doesn't support Unicode characters is a serious drawback. The SOAP API would be the solution. -Greg

            Unfortunately this issue is still not scheduled for a fix. This is a reasonably complex issue and is not currently considered to be one of the highest priority bugs to fix at this point in time.
            If we receive more votes on this issue, we will consider scheduling at some point in the near future.

            Cheers,
            Andrew Lynch

            Andrew Lynch (Inactive) added a comment - Unfortunately this issue is still not scheduled for a fix. This is a reasonably complex issue and is not currently considered to be one of the highest priority bugs to fix at this point in time. If we receive more votes on this issue, we will consider scheduling at some point in the near future. Cheers, Andrew Lynch

            still not fixed? I get the same problem On Confluence 2.7.1 using Perl's SOAP::Lite (which in turn uses XML::Parser) - same error. Specifically, the getSpaces call returns this chunk:

            <getSpacesReturn
              soapenc:arrayType="ns2:RemoteSpaceSummary[138]"
              xsi:type="soapenc:Array" 
              xsi:type="soapenc:Array" 
              xmlns:ns2="http://beans.soap.rpc.confluence.atlassian.com" 
              xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            

            I wonder if this will get fixed in 4.5 weeks, or if we need to buy birthday presents for CONF-6720 :o

            National Library of Australia - BSS branch added a comment - still not fixed? I get the same problem On Confluence 2.7.1 using Perl's SOAP::Lite (which in turn uses XML::Parser) - same error. Specifically, the getSpaces call returns this chunk: <getSpacesReturn soapenc:arrayType= "ns2:RemoteSpaceSummary[138]" xsi:type= "soapenc:Array" xsi:type= "soapenc:Array" xmlns:ns2= "http: //beans.soap.rpc.confluence.atlassian.com" xmlns:soapenc= "http: //schemas.xmlsoap.org/soap/encoding/" xmlns:xsi= "http: //www.w3.org/2001/XMLSchema-instance" > I wonder if this will get fixed in 4.5 weeks, or if we need to buy birthday presents for CONF-6720 :o

            Thanks for the update on this issue. We'll try and address as soon as we can.

            In the mean-time, it may be worth looking to the forums for advice - http://forums.atlassian.com/index.jspa

            Paul Curren added a comment - Thanks for the update on this issue. We'll try and address as soon as we can. In the mean-time, it may be worth looking to the forums for advice - http://forums.atlassian.com/index.jspa

            I had nearly identical code before encountering the error and finding Boris' bug report. I observe the same errors with a similar stack trace (due to the version difference).

            Using Confluence 2.6, python 2.5.1, soappy 0.11.3 (ubuntu). Is there any resolution, or might there be an error in how we try to access the information?

            I would really like to export all spaces for backup purposes and I'd prefer SOAP over XML-RPC.

            Kariem Hussein added a comment - I had nearly identical code before encountering the error and finding Boris' bug report. I observe the same errors with a similar stack trace (due to the version difference). Using Confluence 2.6, python 2.5.1, soappy 0.11.3 (ubuntu). Is there any resolution, or might there be an error in how we try to access the information? I would really like to export all spaces for backup purposes and I'd prefer SOAP over XML-RPC.

              Unassigned Unassigned
              5600dc469173 Boris Burger
              Affected customers:
              10 This affects my team
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: