View Full Version : actionsequence as webservice client
begunrom
05-29-2006, 06:10 AM
I have data, that can be extracted from the application only by using webservices. Can i create a actionsequence that acts as a webservices client and retrieve the information for the report?
If yes, how should this be done? Any documentation available?
mbatchelor
05-29-2006, 02:08 PM
Have you looked at any of the XQuery example action sequences? Instead of a local file, the resource can be specified as a URL.
begunrom
05-30-2006, 08:05 AM
I modified the XQ_Datasource.xaction example. I changed the source type to url and have set the location to "http://m030:8080/pentaho/ServiceAction?solution=samples&path=rules&action=CurrentPositionTitles.xaction"
The CurrentPositionTitles.xaction is the one used in the webservices example and returns an XML message.
As soon as i run it i get the following message : "Error: File not found: http://m030:8080/pentaho/ServiceAction?solution=samples&path=rules&action=CurrentPositionTitles.xaction (org.pentaho.plugin.xquery.XQueryLookupRule)" It looks to me that the program is still expecting a file.
Even if the above would be returning the result expected, i still have a problem specifying the correct URL. The webservices i need to access are not accessible by a url like the one used here(as far as i know). These webservices are built using the axis framework and, as far as i know, need some clientsoftware based on the wsdl file. http://forums.pentaho.org/archived_att/files/XQ_webserviceDatasource.xaction
mbatchelor
05-30-2006, 09:38 AM
Try something like this in the resource definition:
<document>
<url>
<location>http://someserver.something.com/someWebService.jsp</location>
<mime-type>text/xml</mime-type>
</url>
</document>
begunrom
05-31-2006, 12:14 AM
I tried with this :
location= http://www.belgium.be/eportal/index.jsp
but the error is still the same.
Error: File not found: http://www.belgium.be/eportal/index.jsp (org.pentaho.plugin.xquery.XQueryLookupRule)
When creating tri message i wanted to include some xml. I did put it in a code block, but all my tags disappeared. What is the trick to make it work line in your previous mail?
Post edited by: begunrom, at: 05/31/2006 04:18
spmva
05-31-2006, 03:19 AM
I had the same problem. Had to use html entities instead of less than and greater than signs.
< = less than
> = greater than
I just cut and paste the xml to notepad and did a find replace.
steve
mbatchelor
05-31-2006, 06:39 PM
A couple of things:
1- Your above example returned an HTML document, not an HTML page. That won't fly.
2- I looked at your action sequence example, and you have the following URL:
http://m030:8080/pentaho/ServiceAction?solution=samples&path=rules&action=CurrentPositionTitles.xaction
You will need to double-escape the ampersand because it's being specified in XML and will be stripped out otherwise:
It will look something like this:
http://m030:8080/pentaho/ServiceAction?solution=samples&path=rules&action=CurrentPositionTitles.xaction
If this doesn't work, please re-attach the action sequence you're working on as well as the server error log. To do this, build a .zip file and attach it.
I hope this helps,
Marc
begunrom
06-01-2006, 06:37 AM
It is still not working. As requested, i have included the boot.log, server.log and the xaction in a zip file. http://forums.pentaho.org/archived_att/files/webservice.zip
mbatchelor
06-01-2006, 07:11 AM
It seems the forum post stripped off the sample I was trying to provide. I'll see if I can get it right here. There may be multiple edits until I get it looking right on review. ;-)
<location>http://m030:8080/pentaho/ServiceAction?solution=samples&path=rules&action=CurrentPositionTitles.xaction</location>
OK - This one looks correct. What you should notice is that the result of the XML parser will find the first & and replace it with an ampersand (&). That will leave the other amp; behind it which ends up looking like &
I hope this helps,
Marc
Post edited by: mbatchelor, at: 06/01/2006 10:14
begunrom
06-01-2006, 08:51 AM
The & problem has gone, but the file not found error is still there. In the server.log, i do not see any difference in URL anymore.
For your reference i included again the server.log and the action in server1.zip http://forums.pentaho.org/archived_att/files/server1.zip
Post edited by: begunrom, at: 06/01/2006 11:52
begunrom
07-07-2006, 05:55 AM
I tried it again on Pentaho version 1.1.7.301 but the problem is there again.
The original XQ_Datasource.xaction specified a Source Type=solution file and location=books.xml. I took this file and placed it into the "c:\\website" directory. The i changed the Source Type = file and location=c:\\website\\books.xml It still works.
Then i installed a webserver and configured it to use the "c:\\website" directory for it's files. When i go to http://localhost/test/books.xml, the xml is displayed. Then i modify the XQ_Datasource.xaction and change the Source Type = url and location=http://localhost/test/books.xml
I get a file not found error.
Is there any chance that this bug will be fixed in a next version?
mbatchelor
07-13-2006, 08:14 AM
Could you post your action sequence?
mbatchelor
07-13-2006, 09:26 AM
Yep. PLATFORM-371 was fixed this afternoon and is checked into the SVN trunk.
Thanks for pointing this out.