Page 1 of 1

HTTP - Client

Posted: Mon Mar 23, 2015 8:50 pm
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/

Re: HTTP - Client

Posted: Tue Apr 28, 2015 10:23 am
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

Re: HTTP - Client

Posted: Fri Jun 19, 2015 11:38 pm
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]".

Re: HTTP - Client

Posted: Mon Jun 22, 2015 9:01 am
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