[xsl] Problem while calling Web service through XSL code

Subject: [xsl] Problem while calling Web service through XSL code
From: Kavita Surana <kavitass2@xxxxxxxxxxx>
Date: Mon, 7 Jan 2008 12:13:54 +0530 (IST)
Hello All,

   I was trying to call a Web service through XSL code, which returns an
XML document, which I need to process further. The problem I am facing
is that it is not returning me the XML document for the data I am
passing as request parameters. However, when I tried to execute the
same service in browser I got the expected results.

Below is the snippet of XSL code for calling a Web service :-

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

<xsl:variable name="copyTransactionSrc"
select="'http://servername:serverport/invoke/pathToService'" />

<xsl:variable name="docName"
select="concat($copyTransactionSrc,'?',$params)" />

<xsl:variable name="returnXML" select="document($docName)" />

I am checking the return value by calling string-length function on it. So
if it returns XML doc as expected then string-length($returnXML) should be
> 0 but here I am getting string-length($returnXML) = 0.

I am also taking care of encoding parameter values before passing it to
the service and removing special characters like '#' if present in any
parameter value.

One more problem with this I am facing is when total length of url string
exceeds certain value, I am getting 'Error while retrieving resource :-
http://...' in XMLSpy 2008 at the time of transformation.

XSLT Processor : - FOP 0.93 version

  Please correct me if I have done anything wrong in the code as I am doing
this for the first time.


      Save all your chat conversations. Find them online at

Current Thread