Jsr181:xfire and jsr181 annotations (III.)

Source: Internet
Author: User
Tags header interface string webservice annotation

Interface-oriented programming is used:
The Service interface is:
Package cn.com.csr.xfire.jsr.service;
Import Javax.jws.WebMethod;
Import Javax.jws.WebParam;
Import Javax.jws.WebResult;
Import Javax.jws.WebService;
/**
* Application of Service Interface class
* @author Bailonggang
* 2009-3-9
* 11:18:24
*/
@WebService (name = "HelloService", targetnamespace = "Http://www.openuri.org/2004/04/HelloWorld")
Public interface Ihelloservice {
@WebMethod (OperationName = "Hello", action = "urn:echostring")
@WebResult (name = "Echoresult")
public abstract String Hello (@WebParam (name = "Echoparam", Header = True)
String username);
}
Package cn.com.csr.xfire.jsr.service;
Import Javax.jws.WebService;
/**
* Service Implementation Class Code
* Service-side code is implemented using annotations
* This approach is similar to the release of WS in net
* Use the WebService annotation to annotate a class with the name of Ws,name as WS.
* The behavior of the service using the WebMethod annotation ws (method)
* Use webresult annotation WS service Results information
* Parameter information using the Webparam annotation WS service Behavior header=true Indicates whether the information is added to the SOAP header
* @author Bailonggang
* 2009-3-9
* 10:00:12
*/
@WebService (endpointinterface = "Cn.com.csr.xfire.jsr.service.IHelloService")
public class Helloserviceimpl implements Ihelloservice {
/* (Non-javadoc)
* @see Cn.com.csr.xfire.jsr.service.ihelloservice#hello (java.lang.String)
*/
public string Hello (string username)
{
Return "Hello," +username;
}
}
Other configurations are the same as the first section (ignoring) O (∩_∩) o ... haha if you have any questions please leave a message ^_^ this article link http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20120723/32110.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.