How to use the webservice SEAM

2010-04-29  来源:本站原创  分类:Web  人气:278 

1. Write POJO-based implementation of Web Service:

@WebService public class TestService
 {
        @WebMethod public String test(){ //.... }
}

2. POJO code location in the META-INF directory with standard-jaxws-endpoint-config.xml, as follows:

<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
<endpoint-config>
        <config-name>Seam WebService Endpoint</config-name>
        <pre-handler-chains>
                <javaee:handler-chain> <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-         bindings>
        <javaee:handler> <javaee:handler-name>SOAP Request Handler</javaee:handler-name> <javaee:handler-class>org.jboss.seam.webservice.SOAPRequestHandler</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</pre-handler-chains>
</endpoint-config>
 </jaxws-config>

3. Registered in web.xml

<!-- Web Service -->
 <servlet>
        <servlet-name>TestService Servlet</servlet-name>
        <servlet-class>test.TestService</servlet-class>
        <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
        <servlet-name>TestService Servlet</servlet-name>
        <url-pattern>/TestService</url-pattern>
 </servlet-mapping>

4. Configure Web Service to access Seam components in components.xml file needs to do to add the following configuration statement:
xmlns: web = "http://jboss.com/products/seam/web"
And
http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd
In addition:
<web:context-filter url-pattern="/TestService/*"/>
5. WebService to access Seam components

TestSeamComp comp = (TestSeamComp) Component.getInstance("testSeamComp");

6. Access to the generated WSDL file
http://localhost:8080/jbossws/services

相关文章
  • How to use the webservice SEAM 2010-04-29

    1. Write POJO-based implementation of Web Service: @WebService public class TestService { @WebMethod public String test(){ //.... } } 2. POJO code location in the META-INF directory with standard-jaxws-endpoint-config.xml, as follows: <jaxws-config x

  • 深入浅出JBoss Seam 2014-04-08

    什么是Seam? JBoss Seam是"Java EE 5.0的一个轻量级的框架".这是什么意思?难道Java EE(Enterprise Edition) 5.0本身不是一套"框架吗"?为什么在官方规范之外,还需要另外一个框架?好吧,我们就将seam看作是本应该被包括在Java EE 5.0中的一个"遗漏的框架"吧.它在Java EE 5.0框架的上层,为所有的在企业Web应用中的组件提供了一个统一的.易于理解的编程模型.它同样使基于状态的应

  • Seam allows the use of native Hibernate 2009-04-05

    Seam built-in seam-gen is a very good command-line tool, it automatically creates a process template, which can be created directly using Netbeans and Eclipse open. But it has created data layers are EntityManager. Accustomed to Hibernate for the dev

  • Webservice design and model 2009-04-21

    In this paper, are chapter asked (at the original DevX ), For preliminary want to know webservice friend may help. Webservice as a new technology appears in front of us, it's birth are used to address different applications platform synergy. At prese

  • WebService development examples (Xfire + Spring + Hibernate) 2009-05-11

    This article is taken from: http://blog.csdn.net/caok/archive/2008/12/29/3637734.aspx Please note that required download Xfire1.2.6, spring2.0, hibernate 3.0 libraries and related databases related to the jdbc driver. In this paper, relevant content

  • JBoss Seam to learn from scratch 6 --- eclipse foot in, blog examples of the realization of 2009-08-06

    First of all, create a blog called the "Seam Web Project" 1: blog-ejb project under the following ejbModule, create a package, the name is org.domain.blog.entity 2: the ~ ~ \ examples \ blog \ src \ domain \ under three java files, copied to the

  • JBoss Seam to learn from scratch 5 --- eclipse foot in, registration example of the realization of 2009-08-06

    The best way to learn or to see more examples of learned knowledge point. registration is the official seam examples, function is relatively simple, but they can generally learn about the working principle of the seam. The example is in the seam unde

  • webservice study II (2) axis2 client to develop summary (annex containing the item) 2009-08-13

    A, first of all create a webservice client projects webservice_client 1, Contents 2, will be required to include the jar to the lib directory under the project lib Second, the development of client-side webservice 1, the development of client-side co

  • Jboss Seam, mysql Chinese garbled summary of 4 steps 2009-08-17

    Jboss Seam, mysql Chinese garbled summary of 4 steps Keywords: seam hbm2ddl Chinese garbled mysql In fact, the following summary is suitable for any situation hibernate + mysql; Step 1: In the Create Database Schema Please specify code when, for exam

  • JBoss Seam to learn from scratch 14 --- eclipse foot in, dvdstore example of the realization of 2009-08-18

    Continue to bring their own learning in the seam examples, this study is dvdstore, characterized by the use of -> jBPM pageflow -> business process management. The realization of these steps: Create a "dvdstore" The seam web project. Copy

  • JBoss Seam foot from scratch to learn that 13 --- javax.ejb.Local understanding 2009-08-18

    Seam learning process, to write an example of user registration, In accordance with Standing Orders, the user registration page, enter the password twice every item, that is, to have the two password the importation of items For example, a password,

  • JBoss Seam to learn from scratch 12 --- eclipse foot in, seamspace example of the realization and understanding of 2009-08-18

    Continue to bring their own learning in the seam examples, this study is seamspace, use the Seam security aspects of the technology, the realization of a SNS (social networking site) example. "Todo" part of studying in the future, huh, huh. The

  • WebService using C # to achieve the client software upgrade 2009-09-15

    Due to the reasons for the project, to implement customers too far from the author, considering the provision of online software upgrade capability. How do we achieve it! To talk about the next idea. Ideas: WEB client to achieve the development, the

  • Design and model Webservice 2009-09-28

    This is the chapter President (in the original devx ), A preliminary understanding for the webservice like there may be some help of friends. Webservice as a new technology appears in front of us, it is used to solve the birth of the platform in diff

  • Seam built environment 2009-10-15

    Installation JDK5 (j2SE development kit 5), Set environment variable JAVA_HOME = D: \ jdk1.5.0_18 Set Path Path =% path%; D: \ jdk1.5.0_18 \ jre \ bin Install Jboss 4.2.3.GA, Set environment variable JBOSS_HOME = D: \ jboss-4.2.3.GA Ant install Set A

  • seam hibernate search the full demo 2009-10-30

    seam and hibernate search to achieve the perfect integration, if you own seam debug some of you demo. Will have tasted the sweetness of the seam, you have to fall in love with this thing. Which in the seam for full-text search database is a very easy

  • EJB3 development using JBoss WS for the WebService interface 2010-02-03

    Recently in the development of EJB project, you need to. Net Section of WebService interface. JBossAS built JBossWS services that can improve the WebService development speed. And if yes EJB, you can not generate any code, and direct use of tag devel

  • Seam project to build records (1) 2010-02-15

    1. SEAM 2.2 and still can not properly support JSF 2.0 Tried two days or Gaobu Ding, seam of the phase analysis of the jsf appeared NullPointException, in exchange for jsf1.2 no problem, SEAM officials say could be a seamless upgrade, but in fact I G

  • axis2 the entire process of creating webservice client (called. net web service) 2010-02-17

    Operating environment: myeclipse + tomcat6 +. Net web service 1. Download axis2-1.5-bin.zip url: http://ws.apache.org/axis2/download.cgi 2. Download Axis2 and extract to a target directory 3. AXIS2_HOME environment variable is set to indicate the tar

  • B / S and C / S architecture, integration, software, client-side through the WebService interface, automatic updates and upload the data to achieve 2010-03-29

    B / S and C / S architecture - software to achieve the client through the WebService interface, automatic updates and upload data to support any client-side language environments. Test case: Open Client to automatically download the update file, uplo