<%@ include file="../demoUtil.jsp" %>

<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>
OracleJSP Web Service Demo
</TITLE>
</HEAD>
<BODY>

<table BORDER=0 CELLSPACING=0 CELLPADDING=0 >
<tr>
<td WIDTH="10" BGCOLOR="#FF0000">&nbsp;</td>
<td BGCOLOR="#FF0000"><b><font face="Arial, Helvetica">
<font color="#FFFFFF"><font size=+1>OracleJSP CA Traffic info Web Service Demo</font></font></font></b></td>
<td WIDTH="10" BGCOLOR="#FF1010">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FF2020">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FF3030">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FF4040">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FF6060">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FF7070">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FF8080">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FF9090">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FFA0A0">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FFB0B0">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FFC0C0">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FFD0D0">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FFE0E0">&nbsp;</td>
<td WIDTH="10" BGCOLOR="#FFF0F0">&nbsp;</td>
</tr>
</table>

<%
  String hwy = request.getParameter("hwyNum");  
  if(hwy == null)
  {%>
<P>
<B>Description:</B>
<BR>
This example demonstrates use of JSP to develop a Web Service client for a web 
service provided by a third party provider.
<BR>
This demo uses a web service provided by <A HREF="http://www.xmethods.org">XMethods</A>.
The description WSDL of the web service is available at 
<A HREF="http://www.xmethods.net/sd/2001/CATrafficService.wsdl">http://www.xmethods.net/sd/2001/CATrafficService.wsdl</A>
<BR>
This demo uses a proxy generated (Automatically generated by Oracle JDeveloper 9i) 
from the above mentioned WSDL document.
<BR>
<BR>
This Information system provides current information regarding the condition of 
the California State Highway System. The information provided covers incidents 
that cause significant delays to the normal flow of traffic such as, but not 
limited to, full closures, 1-way traffic controls, lane closures, construction, 
maintenance projects, and emergencies. Normal commute traffic, ramp closures and
traffic flow conditions are not included in these reports. 
The information in each report is the latest information reported to the Highway Information Center.
<BR>
<BR>
Examples of CA highway numbers are I-80, I-5, US-101, SR-84, I-680 , US-50 , SR-92 etc..
</P>

<BR>
<form method=POST action=CATraffic.jsp>
<table>
<tr>
	<td><B>Enter California Highway number(s) ? </B></td>
	<td><input type=text name=hwyNum></td>
</tr>
<tr>
	<td COLSPAN="2">Separate multiple route numbers with commas.</td>
</tr>
<tr><td colspan="2"><CENTER><input type=submit value="Submit"></CENTER></td></tr>
</table>

</form>


<% }
  else
  {
%>
<jsp:usebean id='traffic' scope='page' class='caTraffic.bean.CATrafficServiceProxy' />
<jsp:setProperty name="traffic" property="*" />
<P>
<B>Current Time :</B><% out.println((new java.util.Date()).toString()); %>
</P>
<BR>
<B>Latest traffic condition on CA highway <%=util.HTMLReplace(hwy)%> is as follows :</B>
<BR>
<P>
<%=traffic.formatText(traffic.getTraffic(hwy)) %>
</P>


<BR>
<BR>
<hr WIDTH="100%">
Web Service owner and provider is  <A HREF="http://www.xmethods.org">XMethods</A>
<BR>
Source of the this information is Caltrans website (California Department of Transportation).
<BR>
<%}%>
<BR>
<p><b><font face="Arial, Helvetica"><font color="#FF5050"><font size=-1>Copyright
(c) 2001, 2002, Oracle Corporation. All rights reserved.</font></font></font></b>
</BODY>
</HTML>
