HTTP - Client

Here should go questions about transforming XML with XSLT and FOP.
ArbitraryName
Posts: 16
Joined: Tue Aug 05, 2014 8:36 pm

HTTP - Client

Post by ArbitraryName »

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: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: HTTP - Client

Post by Radu »

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/ ... t-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: 96
Joined: Wed Feb 09, 2005 8:57 am

Re: HTTP - Client

Post by HomeGoods »

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: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: HTTP - Client

Post by Radu »

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
Post Reply