HTTP - Client

Here should go questions about transforming XML with XSLT and FOP.
ArbitraryName
Posts: 16

HTTP - Client

Mon Mar 23, 2015 8:50 pm

Has anyone integrated the usage of the expath extension HTTP-Client?

I have a requirement to query to a protected service that sits behind an HTTP Basic Authentication wall. As far as I can tell, this EXPATH extension is the only thing in the XSLT space that does this.

Most unfortunately, I have no idea how to integrate this into oxygen. Is there a walk through anywhere on how to do this? I think programmatically I could achieve it, but I do not want to have to debug via rebuilding our entire application to test tweaks.

Thanks for the help. I am sure this is an extremely trivial task, and I am just not finding the right information.


http://expath.org/modules/http-client/
Radu
Posts: 5386

Re: HTTP - Client

Tue Apr 28, 2015 10:23 am

Hi,

We do not have much experience with this.
You could try to download from the EXPath download area:

http://expath.org/files

the HTTP Client for Saxon ZIP file.
The ZIP will contain a tar which when expanded will contain in a content/jar folder two JAR libraries:

expath-http-client-java.jar and expath-http-client-saxon.jar.

You can either copy these JAR libraries to the OXYGEN_INSTALL_DIR\lib folder and start Oxygen or for your XSLT stylesheet create a transformation scenario which uses Saxon 9 PE and use the Extensions button to add these extension JARs for the transformation:

http://www.oxygenxml.com/doc/ug-oxygen/#topics/xslt-tab.html

After this you can use the Java functions from the two JARs in your XSLT code.
As an example, the HTTP Client ZIP package you download also has an XSLT stylesheet called expath-http-client-saxon.xsl which calls Java code from the JARs.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
HomeGoods
Posts: 86

Re: HTTP - Client

Fri Jun 19, 2015 11:38 pm

I tried the suggested way and it worked with the HTTP Client 0.10.0.

Unfortunately 0.11.0 didn't work straightaway.
On 0.11.0, <xsl:sequence select="java:send-request($request)"/> generates a string "org.expath.httpclient.saxon.SaxonResult@[32bit hex]".
Radu
Posts: 5386

Re: HTTP - Client

Mon Jun 22, 2015 9:01 am

Hi,

Sorry, but I don't know much about how the Java implementation of the send-request method works. You will probably have to talk to the project developers for that.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “XSLT and FOP”

Who is online

Users browsing this forum: No registered users and 2 guests