<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/wstaglib.tld" prefix="ws" %>
<jsp:include page="header2.html" flush="true" /> 

<% if(request.getParameter("hwyNum") == null){%>	
<jsp:include page="desc.html" />
<% } else { %>
<B>Current Time :</B><%= new java.util.Date()%></B>
<ws:webservice id="caTraffic" 
               wsdlUrl="http://www.xmethods.net/sd/2001/CATrafficService.wsdl"
               binding="CATrafficBinding"
               soapLocation="http://services.xmethods.net:80/soap/servlet/rpcrouter"
               scope="page">
  <ws:property name="http.proxyHost" value="<%= request.getParameter(\"httpProxyHost\")%>"/>
  <ws:property name="http.proxyPort" value="<%= request.getParameter(\"httpProxyPort\")%>"/>
</ws:webservice>
<ws:invoke id="hwyInfo" webservice="caTraffic" operation="getTraffic">
	<ws:part name="hwynums" value="<%= request.getParameter(\"hwyNum\")%>"/>
</ws:invoke>
<h2>&nbsp;</h2>
<h3>Traffic Web Service :</h3>
<B>Latest traffic condition on CA highway <font color=#336699"><%=request.getParameter("hwyNum")%></font> is as follows :</B>
<PRE><%= (String)hwyInfo %></PRE>

<ws:webservice id="stockQuote" 
               wsdlUrl="http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl"
               service="net.xmethods.services.stockquote.StockQuoteService"
               port="net.xmethods.services.stockquote.StockQuotePort"
               scope="page">
  <ws:property name="http.proxyHost" value="<%=request.getParameter(\"httpProxyHost\")%>"/>
  <ws:property name="http.proxyPort" value="<%=request.getParameter(\"httpProxyPort\")%>"/>
</ws:webservice>
<ws:invoke id="stockPrice"  webservice="stockQuote" operation="getQuote">
	<ws:part name="symbol" value="<%= request.getParameter(\"stockSymbol\")%>"/>
</ws:invoke>

<h2>&nbsp;</h2>
<h3>Stock Web Service :</h3>
<B>Last trade price of  <font color=#336699"><%= request.getParameter("stockSymbol")%></font> stock is (20 min delayed):<font color="#FF5050" size=+1>&nbsp;<%=stockPrice%>
</font></B>

<h2>&nbsp;</h2>
<PRE><font face="Arial" size="1">Web Service owner and provider is  <A HREF="http://www.xmethods.org">XMethods</A>
Source of the this information is Caltrans website (California Department of Transportation).</PRE></font>
<%}%>
<jsp:include page="copyright.html" flush="true" /> 
</BODY>
</HTML>
