<%@ page language="java" errorPage="error.jsp" %>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="beans.JSPUtil,oracle.xml.parser.v2.XMLNode;"%>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/wstaglib.tld" prefix="ws" %>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/jwcache.tld" prefix="woc" %>

<jsp:useBean id="bookservice" scope="page" class="beans.BookServiceBean">
  <jsp:setProperty name="bookservice" property="*" />
  <jsp:setProperty name="bookservice" property="debugMe" value="true" />
</jsp:useBean>  

<jsp:include page="header2.html" flush="true" /> 

<ws:webservice id="bookService" 
               wsdlUrl="http://hosting.msugs.ch/cheeso9/books/books.asmx?WSDL"
               binding="LookyBookServiceSoap"
               soapLocation="http://hosting.msugs.ch/cheeso9/books/books.asmx"
               scope="page">
</ws:webservice>

<woc:cacheXMLObj TTL="60" toWriter="false" 
				 printCacheBlockInfo = "true"
				 toXMLObjName="cachedBookResult" 
 				 fromXMLObjName="bookResultToCache">
	<ws:invoke id="bookResult"
			   operation="GetInfo"
			   webservice="bookService" 
			   toXMLObjName="bookResultToCache" 
			   xmlToWriter="false">
		<ws:part name="parameters">
			<GetInfo xmlns="http://dinoch.dyndns.org/webservices/">
				<ISBN><%= bookservice.getIsbn() %></ISBN>
			</GetInfo>
		</ws:part>
	</ws:invoke>
</woc:cacheXMLObj>
<h3>Web Service Input :</h3>
<PRE CLASS=QUERY>
<%= JSPUtil.encodeHTMLAttr("<GetInfo xmlns=\"http://dinoch.dyndns.org/webservices/\"> \n" +
      "\t<ISBN>"+ bookservice.getIsbn() + "</ISBN>\n" +
"</GetInfo>")%></PRE>
<h2>&nbsp;</h2>

<h3>Web Service Output Response:</h3>
<PRE CLASS=RESULT>
<%= JSPUtil.encodeHTMLAttr(JSPUtil.xmlNodeToString((XMLNode) cachedBookResult)) %>
</PRE>

<jsp:include page="copyright.html" flush="true" /> 
</BODY>
</HTML>

