Hi,
I am using Cocoon 2.0.3 with Tomcat 4.1 on Windows 2000.
I would like to take information from a SOAP call and use it to set a cookie on the browser. The SOAP call is working fine and I am comfortable passing the result to a transformer. But I would like to take the SOAP result and use the data in the same XSP page that is calling SOAP. Is this possible or is there a better way?
I have tried combining the cookie sample with one of the Stock Quote SOAP samples and used xscript to try and transform the SOAP Message into XSP. Apart from not working ( I get an exception) it does not seem like an elegant solution.
See Error and XSP code below.
Thanks, Robin
START OF ERROR CODE
org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling logon_xsp: Line 553, column 75: illegal start of expression Line 553, column 40: method addCookie(java.util.Map, java.lang.String, ) not found in class org.apache.cocoon.components.language.markup.xsp.XSPCookieHelper Line 0, column 0: 2 errors
END OF ERROR CODE
START OF XSP CODE
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-cookie="http://apache.org/xsp/cookie/2.0"
xmlns:xsp-request="http://apache.org/xsp/request/2.0"
xmlns:soap="http://apache.org/xsp/soap/3.0"
xmlns:xscript="http://apache.org/xsp/xscript/1.0"
>
<bla>
<xscript:variable name="soap-result">
<soap:call url=""http://localhost:80/webservice1/services.asmx" method="http://tempuri.org/logonCE" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<m:logonCE xmlns:m="http://tempuri.org/">
<m:sAPS><xsp-request:get-parameter name="aps"/></m:sAPS>
<m:sUserName><xsp-request:get-parameter name="user"/></m:sUserName>
<m:sPwd><xsp-request:get-parameter name="pwd"/></m:sPwd>
</m:logonCE>
</soap:call>
</xscript:variable>
<xscript:variable name="stylesheet">
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp="http://apache.org/xsp"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsp-cookie="http://apache.org/xsp/cookie/2.0"
xmlns:m="http://tempuri.org/"
exclude-result-prefixes="soap xsp n">
<xsl:template match="/">
<Blabla>
<xsp:structure>
<xsp:include>org.apache.cocoon.environment.Cookie</xsp:include>
</xsp:structure>
<xsp-cookie:cookie>
<xsp-cookie:name>testname1</xsp-cookie:name>
<xsp-cookie:value><xsl:value-of select="/soap:Envelope/soap:Body/*/*"/></xsp-cookie:value>
<xsp-cookie:setMaxAge>3600</xsp-cookie:setMaxAge>
</xsp-cookie:cookie>
</Blabla>
</xsl:template>
</xsl:stylesheet>
</xscript:variable>
<xscript:transform name="soap-result" stylesheet="stylesheet"/>
</bla>
</xsp:page>
END OF XSP CODE
Robin Cottiss
Applied Decision Support
[EMAIL PROTECTED]
Phone: 908-876-3622
Cell: 908-313-8969