xsl-list
[Top] [All Lists]

Re: [xsl] Problem while calling Web service through XSL code

2008-01-13 14:05:23
On Sun, 13 Jan 2008 13:08:38 -0700, Kavita Surana <kavitass2(_at_)yahoo(_dot_)co(_dot_)in> wrote:

However, when I tried the code by changing packet size using DrTCP tool, it worked fine.

Strange.  One thing I did notice in looking at your original post,

"<xsl:variable name="params" select="concat('param1=',$value1,'&param2=',value2, '&param3=',value3, '&param4=',value4)" />"

How are you getting the &'s past the XML parser without escaping? Is this just a copy/paste issue where your email client converted the &amp; to &?

So is a limitation of GET call on length of url string applies here?

Yes. Well, it can, anyway. And that limitation can be set in multiple locations. See http://www.oreillynet.com/xml/blog/2007/12/question_does_the_uri_length_r.html and in particular one of the follow-up comments @ http://www.oreillynet.com/xml/blog/2007/12/question_does_the_uri_length_r.html#comment-2129447 which highlights that it's not just the client software that can get in the way of lengthy URI's.

If so, what can be the solution in such cases? Can we specify POST instead of GET by some way?

Not without writing an extension function in another language and then calling that function inside of your XSLT.

Please suggest.

If you have access to an EXSLT or XSLT 2.0 processor, write an extension function in a supported language. Andrew welch has a nice example of making a SOAP request using an extension function written in Java > http://ajwelch.blogspot.com/2007/02/soap-extension-function.html. In gleaning from your original post it would seem you have access to Altova's XSLT 2.0 processor which means you *should* be able to write an extension function in C# or any other .NET language and call it from within an XSLT 2.0 transformation. You can find an example of making an HTTP POST request via a C# extension function @ http://nuxleus.googlecode.com/svn/trunk/nuxleus/Source/Xameleon/Function/HttpWebRequest.cs. But I've never worked with Altova's XSLT 2.0 implementation, so I am unsure of the required syntax for invoking a .NET-based extension function, but hopefully that information is readily available as part of their documentation.

Hope this helps!

--
/M:D

M. David Peterson
Co-Founder & Chief Architect, 3rd&Urban, LLC
Email: m(_dot_)david(_at_)3rdandUrban(_dot_)com | 
m(_dot_)david(_at_)amp(_dot_)fm
Mobile: (206) 418-9027
http://3rdandUrban.com | http://amp.fm | http://www.oreillynet.com/pub/au/2354

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--