Jump to content

Jasperserver Web Service with Python


stopbugginme

Recommended Posts

 Hi everybody,

I'm a newbie Jasperserver user. I'm trying run a report using the web service API.

I'm using Python (with SOAPpy), but results are not successful.

Here is my code:

from SOAPpy import SOAPProxy, WSDL, URLopener
url = "http://user:pass@localhost:8080/jasperserver/services/repository"
server = SOAPProxy(url)
xml = """
<request operationName="runReport" locale="en">
    <argument name="RUN_OUTPUT_FORMAT">XML</argument>
    <argument name="USE_DIME_ATTACHMENTS"><![CDATA[1]]></argument>
    <resourceDescriptor name="" wsType="reportUnit" uriString="/reports/samples/AllAccounts">
        <label><![CDATA[Accounts Report]]></label>
    </resourceDescriptor>
</request>
"""
print server.runReport(xml)

 and here's is the result:

Traceback (most recent call last):
 File "test.py", line 20, in <module>
  print server.runReport(xml)
 File "/usr/local/lib/python2.6/dist-packages/SOAPpy/Client.py", line 499, in __call__
  return self.__r_call(*args, **kw)
 File "/usr/local/lib/python2.6/dist-packages/SOAPpy/Client.py", line 521, in __r_call
  self.__hd, self.__ma)
 File "/usr/local/lib/python2.6/dist-packages/SOAPpy/Client.py", line 424, in __call
  p, attrs = parseSOAPRPC(r, attrs = 1)
 File "/usr/local/lib/python2.6/dist-packages/SOAPpy/Parser.py", line 1077, in parseSOAPRPC
  t = _parseSOAP(xml_str, rules = rules)
 File "/usr/local/lib/python2.6/dist-packages/SOAPpy/Parser.py", line 1060, in _parseSOAP
  raise e
xml.sax._exceptions.SAXParseException: <unknown>:1:0: not well-formed (invalid token)

 I've tested the web service with the php sample, but it's really complex. I just want begin with the very easiest sample in python.

Thanks a lot

 

 

 

 


Post Edited by stopbugginme at 02/08/2010 12:16
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Have you seen this post: http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=56887#56887

 

I suspect you are running into the same problem I had though I was using ZSI rather than SOAPpy.

I have patched ZSI's client.py to make it work with JasperServer's runreport. Attached is my customized client.py. It is based on ZSI svn source revision 1495.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...