Package webApp.RssNews.WS;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface theServerSideInf extends Remote {
public rssVO[] getNewsList() throws RemoteException;
} |
package webApp.RssNews.WS;
import com.sun.cnpi.rss.elements.Item;
import com.sun.cnpi.rss.elements.Rss;
import com.sun.cnpi.rss.parser.RssParser;
import com.sun.cnpi.rss.parser.RssParserException;
import com.sun.cnpi.rss.parser.RssParserImpl;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
public class theServerSide implements theServerSideInf {
public theServerSide() {
}
public rssVO[] getNewsList() {
try {
RssParser parser = new RssParserImpl();
//Rss rss = parser.parse(new URL("http://www.theserverside.com/rss/theserverside-0.9.rdf"));
Rss rss = parser.parse(new URL("http://servlet.java.sun.com/syndication/rss_java_highlights-PARTNER-20.xml"));
return verifyRss(rss);
}
catch (MalformedURLException e) {
e.printStackTrace();
return null;
}
catch (IOException e) {
e.printStackTrace();
return null;
}
catch (RssParserException e) {
e.printStackTrace();
return null;
}
}
private rssVO[] verifyRss(Rss rss) {
Collection items = rss.getChannel().getItems();
ArrayList array = new ArrayList();
if(items != null && !items.isEmpty()) {
for(Iterator i = items.iterator(); i.hasNext(); ) {
Item item = (Item)i.next();
rssVO vo = new rssVO();
vo.setTitle(item.getTitle().toString());
vo.setLink(item.getLink().toString());
vo.setDescription(item.getDescription().toString());
array.add(vo);
}
}
rssVO vo[] = new rssVO[array.size()];
array.toArray(vo);
return vo;
}
} |
package webApp.RssNews.WS;
import java.io.Serializable;
public class rssVO implements Serializable {
private String title;
private String description;
private String link;
public rssVO() {
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
} |
<?xml version='1.0' encoding='UTF-8'?>
<webServices version="1.0" xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/dd"
targetNamespaceBase="http://192.168.11.128:80/RSSNewsWS/webservice/wsdl"
typeNamespaceBase="http://192.168.11.128:80/RSSNewsWS/webservice/type">
<endpoint name="webservice" interface="webApp.RssNews.WS.theServerSideInf"
implementation="webApp.RssNews.WS.theServerSide"/>
<endpointMapping endpointName="webservice" urlPattern="/webservice"/>
</webServices> |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>
</web-app> |
JWSDP/jaxrpc/lib 디렉토리에 있는 파일
jaxrpc-api.jar
jaxrpc-impl.jar
jaxrpc-spi.jar
JWSDP/saaj/lib 디렉토리에 있는 파일
saaj-api.jar
saaj-impl.jar |
<context>
<context-name>RSSNewsWS</context-name>
<context-path>/RSSNewsWS</context-path>
</context> |
<?xml version="1.0"?>
<!DOCTYPE jeus-web-dd PUBLIC "-//Tmax Soft., Inc.//DTD JEUS WEB Deployment Info 4.0//EN"
"http://www.tmaxsoft.com/jeus/dtd/4.0/jeus-web-dd.dtd">
<jeus-web-dd>
<context>
<context-name>RSSNewsWS</context-name>
<docbase>RSSNewsWS</docbase>
<auto-reload>
<enable-reload>true</enable-reload>
<check-on-demand>true</check-on-demand>
</auto-reload>
</context>
</jeus-web-dd> |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2004 Sun Microsystems, Inc. All rights reserved.
SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
-->
<configuration
xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<wsdl
location="http://192.168.11.128/RSSNewsWS/webservice?WSDL"
packageName="webApp.RssNews.client" />
</configuration> |
RssVO.class
RssVO_SOAPBuilder.class
RssVO_SOAPSerializer.class
TheServerSideInf.class
TheServerSideInf_getNewsList_RequestStr…
TheServerSideInf_getNewsList_RequestStr…
TheServerSideInf_getNewsList_ResponseSt…
TheServerSideInf_getNewsList_ResponseSt…
TheServerSideInf_getNewsList_ResponseSt…
TheServerSideInf_Stub.class
Webservice.class
Webservice_Impl.class
Webservice_SerializerRegistry.class |
<%@ page contentType="text/html;charset=EUC-KR"%>
<%@ page import="java.rmi.RemoteException"%>
<%@ page import="javax.xml.rpc.Stub"%>
<%@ page import="webApp.RssNews.client.*"%>
<%!
public RssVO[] getRSSList() {
try {
Webservice_Impl webservice = new Webservice_Impl();
Stub stub = (Stub) webservice.getTheServerSideInfPort();
TheServerSideInf rssInfo = (TheServerSideInf)stub;
return rssInfo.getNewsList();
}
catch (RemoteException e) {
System.out.println(e);
return null;
}
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>RSSNEWSLIST</title>
<table cellspacing="2" cellpadding="3" border="1" width="100%">
<tr>
<td> </td>
<td> </td>
</tr>
<%
RssVO rssvo[] = getRSSList();
for(int i = 0; i < rssvo.length; i++) {
%>
<tr>
<td><a href="<%=rssvo[i].getLink()%>" w"><%=rssvo[i].getTitle()%></a></td>
<td><%=rssvo[i].getDescription()%></td>
</tr>
<%
}
%>
</table>
</head>
<body>
</body>
</html> |