이미지 출처: http://static.raibledesigns.com/repository/images/seam_logo_blue.png
이미지 출처: http://www.rippleinteractive.com/blog/images/typed_a_.png
이미지 출처: http://www.seamframework.org/themes/sfwkorg/img/seam_icon_large.png
이미지 출처: http://static.raibledesigns.com/repository/images/seam_logo_blue.png
이미지 출처: http://www.jboss.org/theme/images/spotlights/spotlight_as5_50k.jpg
이미지 출처: http://www.webthreads.de/article-data/uploads/2007/12/jbossdeveloperstudio.png
이미지 출처: http://www.seamframework.org/themes/sfwkorg/img/runningon_seamlogo_beige.gif
이미지 출처: http://nuncscio.com/wp-content/uploads/2008/01/lego_logo-710596.png
이미지 출처: http://i20.tinypic.com/314c6q0.jpg
이미지 출처: http://www.a1bazaar.in/Books/Management/Seam-In-Action_-Covers-Seam-20/admin/productimages/19643/9788177228861_medium.jpg
이미지 출처: http://img.tesco.com/pi/Books/L/93/9780137129393.jpg
이미지 출처: http://ec2.images-amazon.com/images/I/51q-qazhagL._SL500_AA240_.jpg
이미지 출처: http://i20.tinypic.com/314c6q0.jpg
이미지 출처: http://202.125.44.112/~linbaioz/img/2007/06/1590597923.jpg
이미지 출처: http://pixhost.ws/avaxhome/de/d5/000ad5de_medium.jpeg
이미지 출처: http://vig-fp.pearsoned.co.uk/bigcovers/0131347969.jpg
<mbean
code="org.jboss.services.binding.ServiceBindingManager"
name="jboss.system:service=ServiceBindingManager">
<attribute
name="ServerName">ports-01</attribute>
<attribute
name="StoreURL">${jboss.home.url}/conf/port-bindings.xml</attribute>
<attribute
name="StoreFactoryClassName">
org.jboss.services.binding.XMLServicesStoreFactory
</attribute>
|
AJP Port |
HTTP Port |
|
ports-01 |
8109 |
8180 |
|
ports-02 |
8209 |
8280 |
|
ports-03 |
8309 |
8380 |
|
ports-04 |
8409 |
8480 |
|
ports-05 |
8509 |
8580 |
|
ports-06 |
8609 |
8680 |
|
ports-07 |
8709 |
8780 |
|
ports-08 |
8809 |
8880 |
|
ports-09 |
8909 |
8980 |
|
아래의 코드를 복사하셔서 web application context에 vm.jsp로 저장하신 후 확인하시면 됩니다.
<%@ page contentType="text/html; charset=euc-kr" %>
<%@ page import="java.net.InetAddress" %>
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<%
if (request.getParameter("gc") != null) {
System.gc();
System.runFinalization();
}
Properties p = System.getProperties();
%>
<HTML>
<HEAD>
<META content="text/html; charset=euc-kr" http-equiv=Content-Type>
<!--META http-equiv="Refresh" content="10;url=<%= request.getRequestURI() %>"-->
<link href="style.css" rel=stylesheet type="text/css">
</HEAD>
<body leftmargin=15 topmargin=10>
<center><p>
<table width="600" cellpadding="7" cellspacing="0" border="1" bordercolordark="WHITE" bordercolorlight="BLACK">
<tr><td>
■ HOST : <%= InetAddress.getLocalHost().getHostName() %>
(<%= InetAddress.getLocalHost().getHostAddress() %>)
<% SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd 'at' HH:mm:ss z", Locale.CHINA); %>
■ Current Time : <%= formatter.format(new Date()) %>
</td></tr>
<tr><td align=center>
<%
Runtime rt = Runtime.getRuntime();
long free = rt.freeMemory();
long total = rt.totalMemory();
long usedRatio = (total - free) * 100 / total;
long unusedRatio = free * 100 / total;
%>
<table width=100% bgcolor="lightgrey" border=1 cellpadding=6 cellspacing=0>
<tr>
<td align="center" colspan="2">Total Java Virual Machine Memory (<b><%= total/1024 %> KB</b>)</td>
</tr>
<tr bgcolor=#E3E3E3>
<td align="center">Used Memory (<b><%= (total - free)/1024 %> KB</b>)</td>
<td align="center">Available Memory (<b><%= free/1024 %> KB</b>)</td>
</tr>
<tr bgcolor=#E8EEEC>
<td><hr color="#CC3366" align=left size=10 width="<%= usedRatio %>%" noshade>
(<%= usedRatio %> %)</td>
<td><hr color="#0066FF" align=left size=10 width="<%= unusedRatio %>%" noshade>
(<%= unusedRatio %> %)</td>
</tr>
</table>
<p>
<a href="<%= request.getRequestURI() %>?gc=">
<img src="trash.gif" valign=middle border=0> Execution GC</a>
<a href="<%= request.getRequestURI() %>">
<img src="refresh.gif" valign=middle border=0> Reload</a>
</td></tr>
</table>
</center>
</BODY>
</HTML>
이미지 출처: http://www.jboss.com/company/logos/jboss_inc_logo.jpg
이미지 출처: http://www.redhat.com/g/logo_jbossorg.png
이미지 출처: http://www.jboss.com/themes/jbosstheme/img/logo.gif
package com.jboss.webservice;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
/**
* This is a webservice class exposing a method called greet which takes a input
* parameter and greets the parameter with hello.
*
* @author Ji-Woong Choi
*/
/*
* @WebService indicates that this is webservice interface and the name
* indicates the webservice name.
*/
@WebService(name = "Hello", targetNamespace="http://client.jboss.com/", serviceName="GreetService")
/*
* @SOAPBinding indicates binding information of soap messages. Here we have
* document-literal style of webservice and the parameter style is wrapped.
*/
//@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
public class Hello {
/**
* This method takes a input parameter and appends "Hello" to it and returns
* the same.
*
* @param name
* @return
*/
@WebMethod
public String greet(@WebParam(name = "name")
String name) {
System.out.println("JBoss Web Service was invoked by " + name);
return "Hello!, " + name;
}
}
Web Service Annotation을 이용하여 필요한 메소드들을 구성합니다.
2. Web.xml 파일을 편집합니다. 본 예제에서는 servlet style을 이용하여 처리합니다.
다른 방법으로는 EJB를 이용하여 port proxy를 remote stub을 이용하는 방법이 있지만 web이 테스트하기 보다 단순하므로 이 예제를 이용하겠습니다.
3. 서버에 디플로이 후 Web Service에 대한 deploy상태를 확인합니다.
http://localhost:8080/jbossws/ 라고 입력하면 웹서비스 리스트를 확인할 수 있습니다.
4. WSDL의 디플로이된 상태를 확인합니다.
5. 이제 클라이언트 코드를 작성합니다. 여기서는 DII방식(Dynamic Invocation Interface) 방식을 이용하여 작성합니다.
위의 코드를 실행하면 서버에 System console에 적은 내용이 찍히게 되며, 클라이언트에서 응답을 받을 수 있습니다.