Re: [xml] Using HTTP POST from XSLT to access webservices



OK, I 've found that exslt:document element uses HTTP PUT for HTTP URLs

Example

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
   xmlns:exsl="http://exslt.org/common";
   extension-element-prefixes="exsl">
<xsl:template match="/">
<exsl:document xmlns:exsl="http://exslt.org/common";
  href="http://localhost:8081/foo/out.xml";
  method="xml"
  encoding="utf-8">
  <greeting xml:lang="en">hello world</greeting>
</exsl:document>
</xsl:template>
</xsl:stylesheet>

Sends

PUT /foo/out.xml HTTP/1.0
Host: localhost
Content-Type: text/xml
Content-Length: 172

<?xml version="1.0" encoding="utf-8"?>
<greeting xml:lang="en">hello world</greeting>
<?xml version="1.0" encoding="utf-8"?>
<greeting xml:lang="en">hello world</greeting>

BTW: this is a BUG (It repeats message twice!).

I wonder could exslt:document be enhanced to perform HTTP POST, and return
results?
What are your opinions on ways to deal with a response? Put it into XSLT
variable or parse
it with XSLT under some element which would be a child of exsl:document?

<exsl:document xmlns:exsl="http://exslt.org/common";
  href="http://localhost:8081/foo/out.xml";
  use-http-post="yes"                               SAYS to use POST instead
of PUT
  save-response="variable-name"             SAYS to save response in XSLT
variable 'variable-name'
  method="xml"
  encoding="utf-8">
  <greeting xml:lang="en">hello world</greeting>
</exsl:document>

Please, share your ideas about this.

Thanks a lot,
--MG


----- Original Message ----- 
From: "Mikhail S Grushinskiy" <mgrushinskiy comcast net>
To: "Fabrice Desré FTR&D/DTL/TAL" <fabrice desre francetelecom com>;
<xml gnome org>
Sent: Thursday, February 12, 2004 1:15 PM
Subject: Re: [xml] Using HTTP POST from XSLT to access webservices


It seems this idea is not new, but still nobody implemented it.

http://www.biglist.com/lists/xsl-list/archives/200212/msg00068.html

There is also <exslt:document> extension wich apparently doesn't let you
to
get access to response message.

Does <exslt:document> do PUT or POST in case href is HTTP URL?

Thanks,
--MG

----- Original Message ----- 
From: "Fabrice Desré FTR&D/DTL/TAL" <fabrice desre francetelecom com>
To: <xml gnome org>
Sent: Thursday, February 12, 2004 2:00 AM
Subject: Re: [xml] Using HTTP POST from XSLT to access webservices


Mikhail S Grushinskiy wrote:
 > Hello all,
 >
 > I'm thinking about developing xslt extension element to allow HTTP
 > posting from XSLT, which
 > can be especially useful for web services. Does nanohttp in libxslt
 > support HTTP POST?

  Yes it does.

 > Has anyone worked on something like that? Are there any proposals for
 > dealing with HTTP POSTs from
 > XSLT (may be in exslt)?
 >
 > It would be nice if input for 'post' could be prepared by regular
XSLT
 > and output XML could be parsed by XSLT,
 > something like:

 > [snip]

 > (All this is hypothetical example).
 >
 > Does this idea make sense? Or does something like this already exist?
 >
 > Thank you for your suggestions :).

  Well, it makes sense and I think I saw such an extension for another
xslt processor (can't remember which one, sorry). Note that you have to
POST data, and also transmit some additionnal HTTP headers (like the
SOAPAction: header)...

Fabrice
-- 
Fabrice Desré
France Télécom R&D/DTL/TAL
Tél: +(33) (0)2 96 05 31 43
Fax: +(33) (0)2 96 05 39 45
http://www.francetelecom.com/rd
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.587 / Virus Database: 371 - Release Date: 2/12/2004

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.587 / Virus Database: 371 - Release Date: 2/12/2004




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]