Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-6720

SOAP Interface not working well from Python

    XMLWordPrintable

Details

    Description

      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!

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              5600dc469173 Boris Burger
              Votes:
              10 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: