cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF 2.0 Documentation: Developing a Service (page edited)
Date Sat, 20 Oct 2007 20:36:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence" />
    <style type="text/css">
    <!--
    body, p, td, table, tr, .bodytext, .stepfield {
	font-family: Verdana, arial, sans-serif;
	font-size: 11px;
	line-height: 16px;
	color: #000000;
	font-weight: normal;
}
#PageContent {
	text-align: left;
	background-color: #fff;
	padding: 0px;
	margin: 0px;
    padding-bottom:20px;
}
/*
** when this stylesheet is used for the Tiny MCE Wysiwyg editor's edit area, we can't
** use an id=PageContent or class=wiki-content, so we must
** set the body style to that used for PageContent, and p to that used for wiki-content.
*/

body {
	margin: 0px;
	padding: 0px;
	text-align: center;
    background-color: #f0f0f0;
}

@media print {

body {
    background-color: #fff;
}

}

.monospaceInput {
    font:12px monospace
}

.wiki-content p, .commentblock p {
    margin: 16px 0px 16px 0px;
    padding: 0px;
}

.wiki-content-preview {
    padding: 5px;
    border-left: 1px solid #3c78b5;
    border-right: 1px solid #3c78b5;
}

ul, ol {
    margin-top: 2px;
    margin-bottom: 2px;
    padding-top: 0px;
    padding-bottom: 0px;
}

pre {
    padding: 0px;
    margin-top: 5px;
    margin-left: 15px;
    margin-bottom: 5px;
    margin-right: 5px;
    text-align: left;
}

.helpheading {
    font-weight: bold;
    background-color: #D0D9BD;
        border-bottom: 1px solid #3c78b5;
        padding: 4px 4px 4px 4px;
        margin: 0px;
        margin-top: 10px;
}
.helpcontent {
        padding: 4px 4px 20px 4px;
    background-color: #f5f7f1;
}

.code {
 	border: 1px dashed #3c78b5;
    font-size: 11px;
	font-family: Courier;
    margin: 10px;
	line-height: 13px;
}

.focusedComment {
    background: #ffffce;
}

.commentBox, .focusedComment {
    padding: 10px;
    margin: 5px 0 5px 0;
    border: 1px #bbb solid;
}

.codeHeader {
    background-color: #f0f0f0;
 	border-bottom: 1px dashed #3c78b5;
    padding: 3px;
	text-align: center;
}

.codeContent {
    text-align: left;
    background-color: #f0f0f0;
    padding: 3px;
}

.preformatted {
 	border: 1px dashed #3c78b5;
    font-size: 11px;
	font-family: Courier;
    margin: 10px;
	line-height: 13px;
}

.preformattedHeader {
    background-color: #f0f0f0;
 	border-bottom: 1px dashed #3c78b5;
    padding: 3px;
	text-align: center;
}

.preformattedContent {
    background-color: #f0f0f0;
    padding: 3px;
}

.panel {
 	border: 1px dashed #3c78b5;
    margin: 10px;
    margin-top: 0px;
}

.panelHeader {
    background-color: #f0f0f0;
 	border-bottom: 1px dashed #3c78b5;
    padding: 3px;
	text-align: center;
}

.panelContent {
    background-color: #f0f0f0;
    padding: 5px;
}

.anonymousAlert {
    background-color: #f0f0f0;
 	border: 1px dashed red;
    font-size: 11px;
    padding: 10px 5px 10px 5px;
    margin: 4px;
	line-height: 13px;
}

.lockAlert {
    background-color: #f0f0f0;
    width: 50%;
 	border: 1px dashed red;
    font-size: 11px;
    padding: 10px 5px 10px 5px;
    margin: 4px;
	line-height: 13px;
}


.code-keyword {
  color: #000091;
  background-color: inherit;
}

.code-object {
  color: #910091;
  background-color: inherit;
}

.code-quote {
  color: #009100;
  background-color: inherit;
}

.code-comment {
  color: #808080;
  background-color: inherit;
}


.code-xml .code-keyword {
  color: inherit;
  font-weight: bold;
}

.code-tag {
  color: #000091;
  background-color: inherit;
}

.breadcrumbs {
    background-color: #f0f0f0;
 	border-color: #3c78b5;
	border-width: 1px 0px 1px 0px;
	border-style: solid;
    font-size: 11px;
    padding: 3px 0px 3px 0px;
}

.navmenu {
    border: 1px solid #ccc;
}

.menuheading {
    font-weight: bold;
    background-color: #f0f0f0;
 	border-bottom: 1px solid #3c78b5;
	padding: 4px 4px 2px 4px;
}

.menuitems {
	padding: 4px 4px 20px 4px;
}

.rightpanel {
    border-left: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

#helpheading {
    text-align: left;
    font-weight: bold;
    background-color: #D0D9BD;
 	border-bottom: 1px solid #3c78b5;
	padding: 4px 4px 4px 4px;
	margin: 0px;
}
#helpcontent {
	padding: 4px 4px 4px 4px;
    background-color: #f5f7f1;
}
.helptab-unselected {
    font-weight: bold;
	padding: 5px;
    background-color: #f5f7f1;
}
.helptab-selected {
    font-weight: bold;
    background-color: #D0D9BD;
	padding: 5px;
}
.helptabs {
    margin: 0px;
    background-color: #f5f7f1;
	padding: 5px;
}
.infopanel-heading {
    font-weight: bold;
	padding: 4px 0px 2px 0px;
}

.pagebody {
}

.pageheader {
	padding: 5px 5px 5px 0px;
 	border-bottom: 1px solid #3c78b5;
}

.pagetitle {
	font-size: 22px;
	font-weight: bold;
	font-family: Arial, sans-serif;
	color: #003366;
}

.newpagetitle {
    color: #ccc !important;
}

.steptitle {
	font-size: 18px;
	font-weight: bold;
	font-family: Arial, sans-serif;
	color: #003366;
	margin-bottom: 7px;
}

.substeptitle {
    font-size: 12px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    color: #003366;
    margin: 2px 4px 4px 4px;
    padding: 2px 4px 1px 4px;
}

.stepdesc {
    font-family: Verdana, arial, sans-serif;
	font-size: 11px;
	line-height: 16px;
	font-weight: normal;
    color: #666666;
    margin-top: 7px;
    margin-bottom: 7px;
}

.steplabel {
    font-weight: bold;
    margin-right: 4px;
    color: black;
    float: left;
    width: 15%;
    text-align: right;
}

.stepfield {
    background: #f0f0f0;
    padding: 5px;
}

.submitButtons{
    margin-top:5px;
    text-align:right;
}

.formtitle {
	font-size: 12px;
	font-weight: bold;
	font-family: Arial, sans-serif;
	color: #003366;
}

.sectionbottom {
    border-bottom: 1px solid #3c78b5;
}

.topRow {
    border-top: 2px solid #3c78b5;
}

.tabletitle {
	font-size: 14px;
	font-weight: bold;
	font-family: Arial, sans-serif;
    padding: 3px 0px 2px 0px;
    margin: 8px 4px 2px 0px;
	color: #003366;
	border-bottom: 2px solid #3c78b5;
}
.pagesubheading {
    color: #666666;
    font-size: 10px;
    padding: 0px 0px 5px 0px;
}

HR {
	color: 3c78b5;
	height: 1;
}

A:link, A:visited, A:active, A:hover {
	color: #003366;
}

h1 A:link, h1 A:visited, h1 A:active {
	text-decoration: none;
}

h1 A:hover {
    border-bottom: 1px dotted #003366;
}

.wiki-content > :first-child, .commentblock > :first-child {
    margin-top: 3px;
}

.logocell {
    padding: 10px;
}

input {
	font-family: verdana, geneva, arial, sans-serif;
	font-size: 11px;
	color: #000000;
}

textarea, textarea.editor {
	font-family: verdana, geneva, arial, sans-serif;
	font-size: 11px;
	color: #333333;
}

/* use logoSpaceLink instead.
.spacenametitle {
	font: 21px/31px Impact, Arial, Helvetica;
    font-weight: 100;
    color: #999999;
	margin: 0px;
}
.spacenametitle img {
  margin: 0 0 -4px 0;
}
.spacenametitle a {
    text-decoration: none;
    color: #999999;
}
.spacenametitle a:visited {
    text-decoration: none;
    color: #999999;
}*/

.spacenametitle-printable {
	font: 20px/25px Impact, Arial, Helvetica;
    font-weight: 100;
    color: #999999;
	margin: 0px;
}
.spacenametitle-printable a {
    text-decoration: none;
    color: #999999;
}
.spacenametitle-printable a:visited {
    text-decoration: none;
    color: #999999;
}

.blogDate {
	font-weight: bold;
	text-decoration: none;
	color: black;
}

.blogSurtitle {
    background: #f0f0f0;
 	border: 1px solid #ddd;
	padding: 3px;
	margin: 1px 1px 10px 1px;
}

.blogHeading {
    font-size: 20px;
    line-height: normal;
    font-weight: bold;
    padding: 0px;
    margin: 0px;
}

.blogHeading a {
   text-decoration: none;
   color: black;
}

.endsection {
	align: right;
	color: #666666;
	margin-top: 10px;
}
.endsectionleftnav {
	align: right;
	color: #666666;
	margin-top: 10px;
}

h1 {
	font-size: 24px;
	line-height: normal;
	font-weight: bold;
	background-color: #f0f0f0;
	color: #003366;
 	border-bottom: 1px solid #3c78b5;
	padding: 2px;
	margin: 36px 0px 4px 0px;
}

h2 {
	font-size: 18px;
	line-height: normal;
	font-weight: bold;
	background-color: #f0f0f0;
 	border-bottom: 1px solid #3c78b5;
	padding: 2px;
	margin: 27px 0px 4px 0px;
}

h3 {
	font-size: 14px;
	line-height: normal;
	font-weight: bold;
	background-color: #f0f0f0;
	padding: 2px;
	margin: 21px 0px 4px 0px;
}

h4 {
	font-size: 12px;
	line-height: normal;
	font-weight: bold;
	background-color: #f0f0f0;
	padding: 2px;
	margin: 18px 0px 4px 0px;
}

h4.search {
	font-size: 12px;
	line-height: normal;
	font-weight: normal;
	background-color: #f0f0f0;
	padding: 4px;
	margin: 18px 0px 4px 0px;
}

h5 {
	font-size: 10px;
	line-height: normal;
	font-weight: bold;
	background-color: #f0f0f0;
	padding: 2px;
	margin: 14px 0px 4px 0px;
}

h6 {
	font-size: 8px;
	line-height: normal;
	font-weight: bold;
	background-color: #f0f0f0;
	padding: 2px;
	margin: 14px 0px 4px 0px;
}

.smallfont {
    font-size: 10px;
}
.descfont {
    font-size: 10px;
    color: #666666;
}
.smallerfont {
    font-size: 9px;
}
.smalltext {
    color: #666666;
    font-size: 10px;
}
.smalltext a {
    color: #666666;
}
.smalltext-blue {
    color: #3c78b5;
    font-size: 10px;
}
.surtitle {
    margin-left: 1px;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666666;
}

/* css hack found here:  http://www.fo3nix.pwp.blueyonder.co.uk/tutorials/css/hacks/ */
.navItemOver { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #003366; cursor: hand; voice-family: '\'}\''; voice-family:inherit; cursor: pointer;}
.navItemOver a { color: #ffffff; background-color:#003366; text-decoration: none; }
.navItemOver a:visited { color: #ffffff; background-color:#003366; text-decoration: none; }
.navItemOver a:hover { color: #ffffff; background-color:#003366; text-decoration: none; }
.navItem { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; }
.navItem a { color: #ffffff; text-decoration: none; }
.navItem a:hover { color: #ffffff; text-decoration: none; }
.navItem a:visited { color: #ffffff; text-decoration: none; }

div.padded { padding: 4px; }
div.thickPadded { padding: 10px; }
h3.macrolibrariestitle {
    margin: 0px 0px 0px 0px;
}

div.centered { text-align: center; margin: 10px; }
div.centered table {margin: 0px auto; text-align: left; }

.tableview table {
    margin: 0;
}

.tableview th {
    text-align: left;
    color: #003366;
    font-size: 12px;
    padding: 5px 0px 0px 5px;
    border-bottom: 2px solid #3c78b5;
}
.tableview td {
    text-align: left;
    border-color: #ccc;
    border-width: 0px 0px 1px 0px;
    border-style: solid;
    margin: 0;
    padding: 4px 10px 4px 5px;
}

.grid {
    margin: 2px 0px 5px 0px;
    border-collapse: collapse;
}
.grid th  {
    border: 1px solid #ccc;
    padding: 2px 4px 2px 4px;
    background: #f0f0f0;
    text-align: center;
}
.grid td  {
    border: 1px solid #ccc;
    padding: 3px 4px 3px 4px;
}
.gridHover {
	background-color: #f9f9f9;
}

td.infocell {
    background-color: #f0f0f0;
}
.label {
	font-weight: bold;
	color: #003366;
}

label {
	font-weight: bold;
	color: #003366;
}

.error {
	background-color: #fcc;
}

.errorBox {
	background-color: #fcc;
    border: 1px solid #c00;
    padding: 5px;
    margin: 5px;
}

.errorMessage {
	color: #c00;
}

.success {
	background-color: #dfd;
}

.successBox {
	background-color: #dfd;
    border: 1px solid #090;
    padding: 5px;
    margin-top:5px;
    margin-bottom:5px;
}

blockquote {
	padding-left: 10px;
	padding-right: 10px;
	margin-left: 5px;
	margin-right: 0px;
	border-left: 1px solid #3c78b5;
}

table.confluenceTable
{
    margin: 5px;
    border-collapse: collapse;
}

/* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */
table.confluenceTable td.confluenceTd
{
    border-width: 1px;
    border-style: solid;
    border-color: #ccc;
    padding: 3px 4px 3px 4px;
}

/* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */
table.confluenceTable th.confluenceTh
{
    border-width: 1px;
    border-style: solid;
    border-color: #ccc;
    padding: 3px 4px 3px 4px;
    background-color: #f0f0f0;
    text-align: center;
}

td.confluenceTd
{
    border-width: 1px;
    border-style: solid;
    border-color: #ccc;
    padding: 3px 4px 3px 4px;
}

th.confluenceTh
{
    border-width: 1px;
    border-style: solid;
    border-color: #ccc;
    padding: 3px 4px 3px 4px;
    background-color: #f0f0f0;
    text-align: center;
}

DIV.small {
	font-size: 9px;
}

H1.pagename {
	margin-top: 0px;
}

IMG.inline  {}

.loginform {
    margin: 5px;
    border: 1px solid #ccc;
}

/* The text how the "This is a preview" comment should be shown. */
.previewnote { text-align: center;
                font-size: 11px;
                    color: red; }

/* How the preview content should be shown */
.previewcontent { background: #E0E0E0; }

/* How the system messages should be shown (DisplayMessage.jsp) */
.messagecontent { background: #E0E0E0; }

/* How the "This page has been modified..." -comment should be shown. */
.conflictnote { }

.createlink {
    color: maroon;
}
a.createlink {
    color: maroon;
}
.templateparameter {
    font-size: 9px;
    color: darkblue;
}

.diffadded {
    background: #ddffdd;
    padding: 1px 1px 1px 4px;
	border-left: 4px solid darkgreen;
}
.diffdeleted {
    color: #999;
    background: #ffdddd;
    padding: 1px 1px 1px 4px;
	border-left: 4px solid darkred;
}
.diffnochange {
    padding: 1px 1px 1px 4px;
	border-left: 4px solid lightgrey;
}
.differror {
    background: brown;
}
.diff {
    font-family: lucida console, courier new, fixed-width;
	font-size: 12px;
	line-height: 14px;
}
.diffaddedchars {
    background-color:#99ff99;
    font-weight:bolder;
}
.diffremovedchars {
    background-color:#ff9999;
    text-decoration: line-through;
    font-weight:bolder;
}

.greybackground {
    background: #f0f0f0
}

.greybox {
 	border: 1px solid #ddd;
	padding: 3px;
	margin: 1px 1px 10px 1px;
}

.borderedGreyBox {
    border: 1px solid #cccccc;
    background-color: #f0f0f0;
    padding: 10px;
}

.greyboxfilled {
 	border: 1px solid #ddd;
    background: #f0f0f0;
    padding: 3px;
	margin: 1px 1px 10px 1px;
}

.navBackgroundBox {
    padding: 5px 5px 5px 5px;
    font-size: 22px;
	font-weight: bold;
	font-family: Arial, sans-serif;
	color: white;
    background: #3c78b5;
    text-decoration: none;
}

.previewBoxTop {
	background-color: #f0f0f0;
    border-width: 1px 1px 0px 1px;
    border-style: solid;
    border-color: #3c78b5;
    padding: 5px;
    margin: 5px 0px 0px 0px;
    text-align: center;
}
.previewContent {
    background-color: #fff;
 	border-color: #3c78b5;
	border-width: 0px 1px 0px 1px;
	border-style: solid;
	padding: 10px;
	margin: 0px;
}
.previewBoxBottom {
	background-color: #f0f0f0;
    border-width: 0px 1px 1px 1px;
    border-style: solid;
    border-color: #3c78b5;
    padding: 5px;
    margin: 0px 0px 5px 0px;
    text-align: center;
}

.functionbox {
    background-color: #f0f0f0;
 	border: 1px solid #3c78b5;
	padding: 3px;
	margin: 1px 1px 10px 1px;
}

.functionbox-greyborder {
    background-color: #f0f0f0;
 	border: 1px solid #ddd;
	padding: 3px;
	margin: 1px 1px 10px 1px;
}

.search-highlight {
    background-color: #ffffcc;
}

/* normal (white) background */
.rowNormal {
    background-color: #ffffff;
 }

/* alternate (pale yellow) background */
.rowAlternate {
    background-color: #f7f7f7;
}

/* used in the list attachments table */
.rowAlternateNoBottomColor {
    background-color: #f7f7f7;
}

.rowAlternateNoBottomNoColor {
}

.rowAlternateNoBottomColor td {
    border-bottom: 0px;
}

.rowAlternateNoBottomNoColor td {
    border-bottom: 0px;
}

/* row highlight (grey) background */
.rowHighlight {
    background-color: #f0f0f0;

}

TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c; PADDING: 0px; }
TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; }
TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; }

TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; }
TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; }

.toolbar  {
    margin: 0px;
    border-collapse: collapse;
}

.toolbar td  {
    border: 1px solid #ccc;
    padding: 2px 2px 2px 2px;
    color: #ccc;
}

td.noformatting {
    border-width: 0px;
    border-style: none;
    text-align: center;
	padding: 0px;
}

.commentblock {
    margin: 12px 0 12px 0;
}

/*
 * Divs displaying the license information, if necessary.
 */
.license-eval, .license-none, .license-nonprofit {
    border-top: 1px solid #bbbbbb;
    text-align: center;
    font-size: 10px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
}

.license-eval, .license-none {
    background-color: #ffcccc;
}

.license-eval b, .license-none b {
    color: #990000
}

.license-nonprofit {
    background-color: #ffffff;
}

/*
 * The shadow at the bottom of the page between the main content and the
 * "powered by" section.
 */
.bottomshadow {
    height: 12px;
    background-image: url("$req.contextPath/images/border/border_bottom.gif");
    background-repeat: repeat-x;
}

/*
 * Styling of the operations box
 */
.navmenu .operations li, .navmenu .operations ul {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

.navmenu .operations ul {
    margin-bottom: 9px;
}

.navmenu .label {
    font-weight: inherit;
}

/*
 * Styling of ops as a toolbar
 */
.toolbar div {
    display: none;
}

.toolbar .label {
    display: none;
}

.toolbar .operations {
    display: block;
}

.toolbar .operations ul {
    display: inline;
    list-style: none;
    margin-left: 10px;
    padding-left: 0;
}

.toolbar .operations li {
    list-style: none;
    display: inline;
}

/* list page navigational tabs */
#foldertab {
padding: 3px 0px 3px 8px;
margin-left: 0;
border-bottom: 1px solid #3c78b5;
font: bold 11px Verdana, sans-serif;
}

#foldertab li {
list-style: none;
margin: 0;
display: inline;
}

#foldertab li a {
padding: 3px 0.5em;
margin-left: 3px;
border: 1px solid #3c78b5;
border-bottom: none;
background: #3c78b5;
text-decoration: none;
}

#foldertab li a:link { color: #ffffff; }
#foldertab li a:visited { color: #ffffff; }

#foldertab li a:hover {
color: #ffffff;
background: #003366;
border-color: #003366;
}

#foldertab li a.current {
background: white;
border-bottom: 1px solid white;
color: black;
}

#foldertab li a.current:link { color: black; }
#foldertab li a.current:visited { color: black; }
#foldertab li a.current:hover {
background: white;
border-bottom: 1px solid white;
color: black;
}

/* alphabet list */
ul#squaretab {
margin-left: 0;
padding-left: 0;
white-space: nowrap;
font: bold 8px Verdana, sans-serif;
}

#squaretab li {
display: inline;
list-style-type: none;
}

#squaretab a {
padding: 2px 6px;
border: 1px solid #3c78b5;
}

#squaretab a:link, #squaretab a:visited {
color: #fff;
background-color: #3c78b5;
text-decoration: none;
}

#squaretab a:hover {
color: #ffffff;
background-color: #003366;
border-color: #003366;
text-decoration: none;
}

#squaretab li a#current {
background: white;
color: black;
}

.blogcalendar * {
    font-family:verdana, arial, sans-serif;
    font-size:x-small;
    font-weight:normal;
    line-height:140%;
    padding:2px;
}


table.blogcalendar {
    border: 1px solid #3c78b5;
}

.blogcalendar th.calendarhead, a.calendarhead {
    font-size:x-small;
    font-weight:bold;
    padding:2px;
    text-transform:uppercase;
    background-color: #3c78b5;
    color: #ffffff;
    letter-spacing: .3em;
    text-transform: uppercase;
}

.calendarhead:visited {color: white;}
.calendarhead:active {color: white;}
.calendarhead:hover {color: white;}

.blogcalendar th {
    font-size:x-small;
    font-weight:bold;
    padding:2px;
    background-color:#f0f0f0;
}

.blogcalendar td {
    font-size:x-small;
    font-weight:normal;
}

.searchGroup { padding: 0 0 10px 0; background: #f0f0f0; }
.searchGroupHeading { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; padding: 2px 4px 1px 4px; }
.searchItem { padding: 1px 4px 1px 4px; }
.searchItemSelected { padding: 1px 4px 1px 4px; font-weight: bold; background: #ddd; }

/* permissions page styles */
.permissionHeading {
    border-bottom: #bbb; border-width: 0 0 1px 0; border-style: solid; font-size: 16px; text-align: left;
}
.permissionTab {
    border-width: 0 0 0 1px; border-style: solid; background: #3c78b5; color: #ffffff; font-size: 10px;
}
.permissionSuperTab {
    border-width: 0 0 0 1px; border-style: solid; background: #003366; color: #ffffff;
}
.permissionCell {
    border-left: #bbb; border-width: 0 0 0 1px; border-style: solid;
}

/* warning panel */
.warningPanel { background: #FFFFCE; border:#F0C000 1px solid; padding: 8px; margin: 10px; }
/* alert panel */
.alertPanel { background: #FFCCCC; border:#C00 1px solid; padding: 8px; margin: 10px; }
/* info panel */
.infoPanel { background: #D8E4F1; border:#3c78b5 1px solid; padding: 8px; margin: 10px; }

/* side menu highlighting (e.g. space content screen) */
.optionPadded { padding: 2px; }
.optionSelected { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; margin: -1px; }
.optionSelected a { font-weight: bold; text-decoration: none; color: black; }

/* information macros */
.noteMacro { border-style: solid; border-width: 1px; border-color: #F0C000; background-color: #FFFFCE; text-align:left; margin-top: 5px; margin-bottom: 5px}
.warningMacro { border-style: solid; border-width: 1px; border-color: #c00; background-color: #fcc; text-align:left; margin-top: 5px; margin-bottom: 5px}
.infoMacro { border-style: solid; border-width: 1px; border-color: #3c78b5; background-color: #D8E4F1; text-align:left; margin-top: 5px; margin-bottom: 5px}
.tipMacro { border-style: solid; border-width: 1px; border-color: #090; background-color: #dfd; text-align:left; margin-top: 5px; margin-bottom: 5px}
.informationMacroPadding { padding: 5px 0 0 5px; }

table.infoMacro td, table.warningMacro td, table.tipMacro td, table.noteMacro td, table.sectionMacro td {
    border: none;
}

table.sectionMacroWithBorder td.columnMacro { border-style: dashed; border-width: 1px; border-color: #cccccc;}

.pagecontent
{
    padding: 10px;
    text-align: left;
}

/* styles for links in the top bar */
.topBarDiv a:link {color: #ffffff;}
.topBarDiv a:visited {color: #ffffff;}
.topBarDiv a:active {color: #ffffff;}
.topBarDiv a:hover {color: #ffffff;}
.topBarDiv {color: #ffffff;}

.topBar {
    background-color: #003366;
}


/* styles for extended operations */
.greyLinks a:link {color: #666666; text-decoration:underline;}
.greyLinks a:visited {color: #666666; text-decoration:underline;}
.greyLinks a:active {color: #666666; text-decoration:underline;}
.greyLinks a:hover {color: #666666; text-decoration:underline;}
.greyLinks {color: #666666; display:block; padding: 10px}

.logoSpaceLink {color: #999999; text-decoration: none}
.logoSpaceLink a:link {color: #999999; text-decoration: none}
.logoSpaceLink a:visited {color: #999999; text-decoration: none}
.logoSpaceLink a:active {color: #999999; text-decoration: none}
.logoSpaceLink a:hover {color: #003366; text-decoration: none}

/* basic panel (basicpanel.vmd) style */
.basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bottom: 8px; width: 100%}
.basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; color: black; font-weight: bold;}
.basicPanelBody {padding: 5px; margin: 0px}

.separatorLinks a:link {color: white}
.separatorLinks a:visited {color: white}
.separatorLinks a:active {color: white}

.greynavbar {background-color: #f0f0f0; border-top: 1px solid #3c78b5; margin-top: 2px}

div.headerField {
    float: left;
    width: auto;
    height: 100%;
}

.headerFloat {
    margin-left: auto;
    width: 50%;
}

.headerFloatLeft {
    float: left;
    margin-right: 20px;
    margin-bottom: 10px;
}

#headerRow {
    padding: 10px;
}

div.license-personal {
   background-color: #003366;
   color: #ffffff;
}

div.license-personal a {
   color: #ffffff;
}

.greyFormBox {
    border: 1px solid #cccccc;
    padding: 5px;
}

/* IE automatically adds a margin before and after form tags. Use this style to remove that */
.marginlessForm {
    margin: 0px;
}

.openPageHighlight {
    background-color: #ffffcc;
    padding: 2px;
    border: 1px solid #ddd;
}

.editPageInsertLinks, .editPageInsertLinks a
{
    color: #666666;
    font-weight: bold;
    font-size: 10px;
}

/* Style for label heatmap. */
.top10 a {
    font-weight: bold;
    font-size: 2em;
    color: #003366;
}
.top25 a {
    font-weight: bold;
    font-size: 1.6em;
    color: #003366;
}
.top50 a {
    font-size: 1.4em;
    color: #003366;
}
.top100 a {
    font-size: 1.2em;
    color: #003366;
}

.heatmap {
    list-style:none;
    width: 95%;
    margin: 0px auto;
}

.heatmap a {
    text-decoration:none;
}

.heatmap a:hover {
    text-decoration:underline;
}

.heatmap li {
    display: inline;
}

.minitab {
padding: 3px 0px 3px 8px;
margin-left: 0;
margin-top: 1px;
margin-bottom: 0px;
border-bottom: 1px solid #3c78b5;
font: bold 9px Verdana, sans-serif;
text-decoration: none;
float:none;
}
.selectedminitab {
padding: 3px 0.5em;
margin-left: 3px;
margin-top: 1px;
border: 1px solid #3c78b5;
background: white;
border-bottom: 1px solid white;
color: #000000;
text-decoration: none;
}
.unselectedminitab {
padding: 3px 0.5em;
margin-left: 3px;
margin-top: 1px;
border: 1px solid #3c78b5;
border-bottom: none;
background: #3c78b5;
color: #ffffff;
text-decoration: none;
}

a.unselectedminitab:hover {
color: #ffffff;
background: #003366;
border-color: #003366;
}

a.unselectedminitab:link { color: white; }
a.unselectedminitab:visited { color: white; }

a.selectedminitab:link { color: black; }
a.selectedminitab:visited { color: black; }

.linkerror { background-color: #fcc;}

a.labelOperationLink:link {text-decoration: underline}
a.labelOperationLink:active {text-decoration: underline}
a.labelOperationLink:visited {text-decoration: underline}
a.labelOperationLink:hover {text-decoration: underline}

a.newLabel:link {background-color: #ddffdd}
a.newLabel:active {background-color: #ddffdd}
a.newLabel:visited {background-color: #ddffdd}
a.newLabel:hover {background-color: #ddffdd}

ul.square {list-style-type: square}

.inline-control-link {
    background: #ffc;
    font-size: 9px;
    color: #666;
    padding: 2px;
    text-transform: uppercase;
    text-decoration: none;
}


.inline-control-link a:link {text-decoration: none}
.inline-control-link a:active {text-decoration: none}
.inline-control-link a:visited {text-decoration: none}
.inline-control-link a:hover {text-decoration: none}

.inline-control-link {
    background: #ffc;
    font-size: 9px;
    color: #666;
    padding: 2px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}

div.auto_complete {
    width: 350px;
    background: #fff;
}
div.auto_complete ul {
    border: 1px solid #888;
    margin: 0;
    padding: 0;
    width: 100%;
    list-style-type: none;
}
div.auto_complete ul li {
    margin: 0;
    padding: 3px;
}
div.auto_complete ul li.selected {
    background-color: #ffb;
}
div.auto_complete ul strong.highlight {
    color: #800;
    margin: 0;
    padding: 0;
}

/******* Edit Page Styles *******/
.toogleFormDiv{
    border:1px solid #A7A6AA;
    background-color:white;
    padding:5px;
    margin-top: 5px;
}

.toogleInfoDiv{
    border:1px solid #A7A6AA;
    background-color:white;
    display:none;
    padding:5px;
    margin-top: 10px;
}

.inputSection{
    margin-bottom:20px;
}

#editBox{
   border:1px solid lightgray;
   background-color:#F0F0F0;
}

/******* Left Navigation Theme Styles ********/
.leftnav li a {
    text-decoration:none;
    color:white;
    margin:0px;
    display:block;
    padding:2px;
    padding-left:5px;
    background-color: #3c78b5;
    border-top:1px solid #3c78b5;
}

.leftnav li a:active {color:white;}
.leftnav li a:visited {color:white;}
.leftnav li a:hover {background-color: #003366; color:white;}

/* Added by Shaun during i18n */
.replaced
{
    background-color: #33CC66;
}

.topPadding
{
    margin-top: 20px;
}

/* new form style */
.form-block {
    padding: 6px;
}
.form-error-block {
    padding: 6px;
    background: #fcc;
    border-top: #f0f0f0 1px solid;
    border-bottom: #f0f0f0 1px solid;
    margin-bottom: 6px;
    padding: 0 12px 0 12px;
}
.form-element-large {
    font-size: 16px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    color: #003366;
}

.form-element-small {
    font-size: 12px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    color: #003366;
}

.form-header {
    background: lightyellow;
    border-top: #f0f0f0 1px solid;
    border-bottom: #f0f0f0 1px solid;
    margin-bottom: 6px;
    padding: 0 12px 0 12px;
}
.form-header p, .form-block p, .form-error-block p {
    line-height: normal;
    margin: 12px 0 12px 0;
}
.form-example {
    color: #888;
    font-size: 11px;
}
.form-divider {
    border-bottom: #ccc 1px solid;
    margin-bottom: 6px;
}
.form-buttons {
    margin-top: 6px;
    border-top: #ccc 1px solid;
    border-bottom: #ccc 1px solid;
    background: #f0f0f0;
    padding: 10px;
    text-align: center;
}
.form-buttons input {
    width: 100px;
}
.form-block .error {
    padding: 6px;
    margin-bottom: 6px;
}
    -->
    </style>
</head>
<body>

<div id="PageContent">
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%"><tr>
<td valign="top" class="pagebody">

    <div class="pageheader">
        <span class="pagetitle">
            Page Edited :
            <a href="http://cwiki.apache.org/confluence/display/CXF20DOC">CXF20DOC</a> :
            <a href="http://cwiki.apache.org/confluence/display/CXF20DOC/Developing+a+Service">Developing a Service</a>
        </span>
    </div>

     <p>
        <a href="http://cwiki.apache.org/confluence/display/CXF20DOC/Developing+a+Service">Developing a Service</a>
        has been edited by             <a href="http://cwiki.apache.org/confluence/display/~chris@die-schneider.net">Christian Schneider</a>
            <span class="smallfont">(Oct 20, 2007)</span>.
     </p>
    <p>
      Change summary:
      <div class="greybox wiki-content"><p>Added toc as this article is quite long. Added the WebParam annotation as not using it is a source of frequent problems</p></div>
    </p>
     <p>
                 <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=27270&originalVersion=9&revisedVersion=10">(View changes)</a>
     </p>

    <span class="label">Content:</span><br/>
    <div class="greybox wiki-content"><div>
<ul>
  <li><a href='#DevelopingaService-DevelopingaServiceusingJAXWS'>Developing a Service using JAX-WS</a>
<ul>
  <li><a href='#DevelopingaService-WSDLFirstDevelopment'>WSDL First Development</a>
<ul>
  <li><a href='#DevelopingaService-GeneratingtheStartingPointCode'>Generating the Starting Point Code</a>
<ul>
  <li><a href='#DevelopingaService-Runningwsdl2java'>Running wsdl2java</a></li>
  <li><a href='#DevelopingaService-Generatedcode'>Generated code</a></li>
</ul></li>
  <li><a href='#DevelopingaService-ImplementingtheService'>Implementing the Service</a>
<ul>
  <li><a href='#DevelopingaService-Generatingtheimplementationcode'>Generating the implementation code</a></li>
  <li><a href='#DevelopingaService-Generatedcode'>Generated code</a></li>
  <li><a href='#DevelopingaService-Implementtheoperation%27slogic'>Implement the operation's logic</a></li>
  <li><a href='#DevelopingaService-Example'>Example</a></li>
</ul></li>
</ul></li>
  <li><a href='#DevelopingaService-JavaFirstDevelopment'>Java First Development</a>
<ul>
  <li><a href='#DevelopingaService-CreatingtheSEI'>Creating the SEI</a>
<ul>
  <li><a href='#DevelopingaService-Writingtheinterface'>Writing the interface</a></li>
  <li><a href='#DevelopingaService-Implementingtheinterface'>Implementing the interface</a></li>
</ul></li>
  <li><a href='#DevelopingaService-AnnotatingtheCode'>Annotating the Code</a>
<ul>
  <li><a href='#DevelopingaService-RequiredAnnotations'>Required Annotations</a>
<ul>
  <li><a href='#DevelopingaService-The%7B%7B@WebService%7D%7Dannotation'>The <tt>@WebService</tt> annotation</a></li>
  <li><a href='#DevelopingaService-AnnotatingtheSEI'>Annotating the SEI</a></li>
  <li><a href='#DevelopingaService-Annotatingtheserviceimplementation'>Annotating the service implementation</a></li>
</ul></li>
  <li><a href='#DevelopingaService-OptionalAnnotations'>Optional Annotations</a>
<ul>
  <li><a href='#DevelopingaService-DefiningtheBindingPropertieswithAnnotations'>Defining the Binding Properties with Annotations</a></li>
  <li><a href='#DevelopingaService-The%7B%7B@SOAPBinding%7D%7Dannotation'>The <tt>@SOAPBinding</tt> annotation</a></li>
  <li><a href='#DevelopingaService-DefiningOperationPropertieswithAnnotations'>Defining Operation Properties with Annotations</a></li>
  <li><a href='#DevelopingaService-The%7B%7B@WebMethod%7D%7Dannotation'>The <tt>@WebMethod</tt> annotation</a></li>
  <li><a href='#DevelopingaService-The%7B%7B@RequestWrapper%7D%7Dannotation'>The <tt>@RequestWrapper</tt> annotation</a></li>
  <li><a href='#DevelopingaService-The%7B%7B@ResponseWrapper%7D%7Dannotation'>The <tt>@ResponseWrapper</tt> annotation</a></li>
  <li><a href='#DevelopingaService-The%7B%7B@WebFault%7D%7Dannotation'>The <tt>@WebFault</tt> annotation</a></li>
  <li><a href='#DevelopingaService-The%7B%7B@OneWay%7D%7Dannotation'>The <tt>@OneWay</tt> annotation</a></li>
  <li><a href='#DevelopingaService-Example'>Example</a></li>
  <li><a href='#DevelopingaService-DefiningParameterPropertieswithAnnotations'>Defining Parameter Properties with Annotations</a></li>
  <li><a href='#DevelopingaService-The%7B%7B@WebParam%7D%7Dannotation'>The <tt>@WebParam</tt> annotation</a></li>
  <li><a href='#DevelopingaService-The%7B%7B@WebResult%7D%7Dannotation'>The <tt>@WebResult</tt> annotation</a></li>
  <li><a href='#DevelopingaService-Example'>Example</a></li>
</ul></li>
</ul></li>
  <li><a href='#DevelopingaService-GeneratingWSDL'>Generating WSDL</a>
<ul>
  <li><a href='#DevelopingaService-Example'>Example</a></li>
</ul></li>
</ul></li>
</ul></li>
</ul></div>

<h1><a name="DevelopingaService-DevelopingaServiceusingJAXWS"></a>Developing a Service using JAX-WS</h1>

<p>You can develop a service using one of two approaches:</p>
<ul>
	<li>Start with a WSDL contract and generate Java objects to implement the service.</li>
	<li>Start with a Java object and service enable it using annotations.<br/>
For new development the preferred path is to design your services in WSDL and then generate the code to implement them. This approach enforces the concept that a service is an abstract entity that is implementation neutral. It also means you can spend more time working out the exact interface your service requires before you start coding.</li>
</ul>


<p>However, there are many cases where you may need to service enable an existing application. While JAX-WS eases the process, it does require that you make some changes to source code of your application. You will need to add annotations to the source. It also requires that you migrate your code to Java 5.0.</p>

<h2><a name="DevelopingaService-WSDLFirstDevelopment"></a>WSDL First Development</h2>

<p>Using the WSDL first model of service development, you start with a WSDL document that defines the service you wish to implement. This WSDL document could be obtained from another developer, a system architect, a UDDI registry, or you could write it yourself. The document must contain at least a fully specified logical interface before you can begin generating code from it.</p>

<p>Once you have a WSDL document, the process for developing a JAX-WS service is three steps:</p>
<ol>
	<li>Generate starting point code.</li>
	<li>Implement the service's operations.</li>
	<li>Publish the implemented service.</li>
</ol>


<h3><a name="DevelopingaService-GeneratingtheStartingPointCode"></a>Generating the Starting Point Code</h3>

<p>JAX-WS specifies a detailed mapping from a service defined in WSDL to the Java classes that will implement that service. The logical interface, defined by the <tt>wsdl:portType</tt> element, is mapped to a service endpoint interface (SEI). Any complex types defined in the WSDL are mapped into Java classes following the mapping defined by the Java Architecture for XML Binding (JAXB) specification. The endpoint defined by the <tt>wsdl:service</tt> element is also generated into a Java class that is used by consumers to access endpoints implementing the service.</p>

<p>The <b>wsdl2java</b> command automates the generation of this code. It also provides options for generating starting point code for your implementation and an ant based makefile to build the application. <b>wsdl2java</b> provides a number of arguments for controlling the generated code.</p>

<h4><a name="DevelopingaService-Runningwsdl2java"></a>Running wsdl2java</h4>

<p>You can generate the code needed to develop your service using the following command:<br/>
 wsdl2java &#45;ant &#45;impl &#45;server &#45;d <em>outputDir</em> myService.wsdl</p>

<p> The command does the following:</p>
<ul>
	<li>The <tt>&#45;ant</tt> argument generates a Ant makefile, called <tt>build.xml</tt>, for your application.</li>
	<li>The <tt>&#45;impl</tt> argument generates a shell implementation class for each portType element in the WSDL document.</li>
	<li>The <tt>&#45;server</tt> argument generates a simple <tt>main()</tt> to launch your service as a stand alone application.</li>
	<li>The <tt>&#45;d <em>outputDir</em></tt> argument tells <b>wsdl2java</b> to write the generated code to a directory called outputDir.</li>
	<li><tt>myService.wsdl</tt> is  the WSDL document from which code is generated.</li>
</ul>


<h4><a name="DevelopingaService-Generatedcode"></a>Generated code</h4>

<p><a href="#DevelopingaService-Table1" title="Table1 on Developing a Service">Table1</a> describes the files generated for creating a service.</p>

<p><a name="DevelopingaService-Table1"></a> <b>Table 1: Generated Classes for a Service</b></p>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> File </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt><em>portTypeName</em>.java</tt> </td>
<td class='confluenceTd'> The SEI. This file contains the interface your service implements. You should not edit this file. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt><em>serviceName</em>.java</tt> </td>
<td class='confluenceTd'> The endpoint. This file contains the Java class your clients will use to make requests on the service. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#95;portTypeName_Impl.java</tt> </td>
<td class='confluenceTd'> The skeleton implementation class. You will modify this file to implement your service. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>&#95;portTypeName_Server.java</tt> </td>
<td class='confluenceTd'> A basic server <tt>main()</tt> that allows you to deploy your service as a stand alone process. </td>
</tr>
</tbody></table>

<h3><a name="DevelopingaService-ImplementingtheService"></a>Implementing the Service</h3>

<p>Once the starting point code is generated, you must provide the business logic for each of the operations defined in the service's interface.</p>

<h4><a name="DevelopingaService-Generatingtheimplementationcode"></a>Generating the implementation code</h4>

<p>You generate the implementation class for your service with <b>wsdl2java</b>'s <tt>&#45;impl</tt> flag.</p>
<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Tip</b><br />
<p>If your service's contract included any custom types defined in XML Schema, you will also need to ensure that the classes for the types are also generated and available.</p></td></tr></table>

<h4><a name="DevelopingaService-Generatedcode"></a>Generated code</h4>

<p>The service implementation code consists of two files:</p>
<ul>
	<li><tt><em>portTypeName</em>.java</tt> is the service interface(SEI) for the service.</li>
	<li><tt>&#95;portTypeName_Impl.java</tt> is the class you will use to implement the operations defined for the service.</li>
</ul>


<h4><a name="DevelopingaService-Implementtheoperation%27slogic"></a>Implement the operation's logic</h4>

<p>You provide the business logic for your service's operations by completing the stub methods in <tt>&#95;portTypeName_Impl.java</tt>. For the most part, you use standard Java to implement the business logic. If your service uses custom XML Schema types, you will need to use the generated classes for each type to manipulate them. There are also some CXF specific APIs that you can use to access some advanced features.</p>

<h4><a name="DevelopingaService-Example"></a>Example</h4>

<p>For example, an implementation class for a service that defined the operations <tt>sayHi</tt> and <tt>greetMe</tt> may look like <a href="#DevelopingaService-Example1" title="Example1 on Developing a Service">Example1</a></p>

<p><a name="DevelopingaService-Example1"></a></p>
<div class="code"><div class="codeHeader"><b>Example 1: Implementation of the Greeter Service</b></div><div class="codeContent">
<pre class="code-java"><span class="code-keyword">package</span> demo.hw.server;

<span class="code-keyword">import</span> org.apache.hello_world_soap_http.Greeter;

@javax.jws.WebService(portName = <span class="code-quote">"SoapPort"</span>, serviceName = <span class="code-quote">"SOAPService"</span>,
 targetNamespace = <span class="code-quote">"http:<span class="code-comment">//apache.org/hello_world_soap_http"</span>,
</span> endpointInterface = <span class="code-quote">"org.apache.hello_world_soap_http.Greeter"</span>)

<span class="code-keyword">public</span> class GreeterImpl <span class="code-keyword">implements</span> Greeter {

 <span class="code-keyword">public</span> <span class="code-object">String</span> greetMe(<span class="code-object">String</span> me)
{
        <span class="code-object">System</span>.out.println(<span class="code-quote">"Executing operation greetMe"</span>);
        <span class="code-object">System</span>.out.println(<span class="code-quote">"Message received: "</span> + me + <span class="code-quote">"\n"</span>);
        <span class="code-keyword">return</span> <span class="code-quote">"Hello "</span> + me;
     }

 <span class="code-keyword">public</span> <span class="code-object">String</span> sayHi()
{
        <span class="code-object">System</span>.out.println(<span class="code-quote">"Executing operation sayHi\n"</span>);
        <span class="code-keyword">return</span> <span class="code-quote">"Bonjour"</span>;
     }
}</pre>
</div></div>

<h2><a name="DevelopingaService-JavaFirstDevelopment"></a>Java First Development</h2>

<p>To create a service starting from Java you need to do the following:</p>
<ol>
	<li>Create a Service Endpoint Interface (SEI) that defines the methods you wish to expose as a service.
<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>
<p>You can work directly from a Java class, but working from an interface is the recommended approach. Interfaces are better for sharing with the developers who will be responsible for developing the applications consuming your service. The interface is smaller and does not provide any of the service's implementation details.</p></td></tr></table></li>
	<li>Add the required annotations to your code.</li>
	<li>Generate the WSDL contract for your service.
<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Tip</b><br /><br/>
If you intend to use the SEI as the service's contract, it is not necessary to generate a WSDL contract</td></tr></table></li>
	<li>Publish the service.</li>
</ol>


<h3><a name="DevelopingaService-CreatingtheSEI"></a>Creating the SEI</h3>

<p>The service endpoint interface (SEI) is the piece of Java code that is shared between a service and the consumers that make requests on it. When starting with a WSDL contract, the SEI is generated by the code generators. However, when starting from Java, it is the up to a developer to create the SEI.</p>

<p>There are two basic patterns for creating an SEI:</p>
<ul>
	<li>Green field development<br clear="all" />
You are developing a new service from the ground up. When starting fresh, it is best to start by creating the SEI first. You can then distribute the SEI to any developers that are responsible for implementing the services and consumers that use the SEI.
<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Note</b><br />
<p>The recommended way to do green field service development is to start by creating a WSDL contract that defines the service and its interfaces.</p></td></tr></table></li>
	<li>Service enablement<br clear="all" />
In this pattern, you typically have an existing set of functionality that is implemented as a Java class and you want to service enable it. This means that you will need to do two things:
	<ol>
		<li>Create an SEI that contains <b>only</b> the operations that are going to be exposed as part of the service.</li>
		<li>Modify the existing Java class so that it implements the SEI.
<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Note</b><br />
<p>You can add the JAX-WS annotations to a Java class, but that is not recommended.</p></td></tr></table></li>
	</ol>
	</li>
</ul>


<h4><a name="DevelopingaService-Writingtheinterface"></a>Writing the interface</h4>

<p>The SEI is a standard Java interface. It defines a set of methods that a class will implement. It can also define a number of member fields and constants to which the implementing class has access.</p>

<p>In the case of an SEI the methods defined are intended to be mapped to operations exposed by a service. The SEI corresponds to a <tt>wsdl:portType</tt> element. The methods defined by the SEI correspond to <tt>wsdl:operation</tt> elements in the <tt>wsdl:portType</tt> element.</p>
<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Tip</b><br />
<p>JAX-WS defines an annotation that allows you to specify methods that are not exposed as part of a service. However, the best practice is to leave such methods out of the SEI.</p></td></tr></table>
<p><a href="#DevelopingaService-Example2" title="Example2 on Developing a Service">Example2</a> shows a simple SEI for a stock updating service.<br/>
<a name="DevelopingaService-Example2"></a></p>
<div class="code"><div class="codeHeader"><b>Example2:Simple SEI</b></div><div class="codeContent">
<pre class="code-java"><span class="code-keyword">package</span> org.apache.cxf;

<span class="code-keyword">public</span> <span class="code-keyword">interface</span> quoteReporter
{
  <span class="code-keyword">public</span> Quote getQuote(<span class="code-object">String</span> ticker);
}</pre>
</div></div>

<h4><a name="DevelopingaService-Implementingtheinterface"></a>Implementing the interface</h4>

<p>Because the SEI is a standard Java interface, the class that implements it is just a standard Java class. If you started with a Java class you will need to modify it to implement the interface. If you are starting fresh, the implementation class will need to implement the SEI.</p>

<p><a href="#DevelopingaService-Example3" title="Example3 on Developing a Service">Example3</a> shows a class for implementing the interface in <a href="#DevelopingaService-Example2" title="Example2 on Developing a Service">Example2</a>.</p>

<p><a name="DevelopingaService-Example3"></a></p>
<div class="code"><div class="codeHeader"><b>Example3:Implementation for SEI</b></div><div class="codeContent">
<pre class="code-java"><span class="code-keyword">package</span> org.apache.cxf;

<span class="code-keyword">import</span> java.util.*;

<span class="code-keyword">public</span> class stockQuoteReporter <span class="code-keyword">implements</span> quoteReporter
{
  ...
<span class="code-keyword">public</span> Quote getQuote(<span class="code-object">String</span> ticker)
  {
    Quote retVal = <span class="code-keyword">new</span> Quote();
    retVal.setID(ticker);
    retVal.setVal(Board.check(ticker));[1]
    Date retDate = <span class="code-keyword">new</span> Date();
    retVal.setTime(retDate.toString());
    <span class="code-keyword">return</span>(retVal);
  }
}</pre>
</div></div>

<h3><a name="DevelopingaService-AnnotatingtheCode"></a>Annotating the Code</h3>

<p>JAX-WS relies on the annotation feature of Java 5. The JAX-WS annotations are used to specify the metadata used to map the SEI to a fully specified service definition. Among the information provided in the annotations are the following:</p>
<ul>
	<li>The target namespace for the service.</li>
	<li>The name of the class used to hold the request message.</li>
	<li>The name of the class used to hold the response message.</li>
	<li>If an operation is a one way operation.</li>
	<li>The binding style the service uses.</li>
	<li>The name of the class used for any custom exceptions.</li>
	<li>The namespaces under which the types used by the service are defined.
<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Tip</b><br />
<p>Most of the annotations have sensible defaults and do not need to be specified. However, the more information you provide in the annotations, the better defined your service definition. A solid service definition increases the likely hood that all parts of a distributed application will work together.</p></td></tr></table></li>
</ul>


<h4><a name="DevelopingaService-RequiredAnnotations"></a>Required Annotations</h4>

<p>In order to create a service from Java code you are only required to add one annotation to your code. You must add the <tt>@WebService()</tt> annotation on both the SEI and the implementation class.</p>

<h5><a name="DevelopingaService-The%7B%7B@WebService%7D%7Dannotation"></a>The <tt>@WebService</tt> annotation</h5>

<p>The <tt>@WebService</tt> annotation is defined by the <tt>javax.jws.WebService</tt> interface and it is placed on an interface or a class that is intended to be used as a service. <tt>@WebService</tt> has the following properties:</p>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Property</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'> name </td>
<td class='confluenceTd'> Specifies the name of the service interface. This property is mapped to the name attribute of the <tt>wsdl:portType</tt> element that defines the service's interface in a WSDL contract. The default is to append <tt>PortType</tt> to the name of the implementation class.</td>
</tr>
<tr>
<td class='confluenceTd'> targetNamespace </td>
<td class='confluenceTd'> Specifies the target namespace under which the service is defined. If this property is not specified, the target namespace is derived from the package name. </td>
</tr>
<tr>
<td class='confluenceTd'> serviceName </td>
<td class='confluenceTd'> Specifies the name of the published service. This property is mapped to the <tt>name</tt> attribute of the <tt>wsdl:service</tt> element that defines the published service. The default is to use the name of the service's implementation class.</td>
</tr>
<tr>
<td class='confluenceTd'> wsdlLocation </td>
<td class='confluenceTd'> Specifies the URI at which the service's WSDL contract is stored. The default is the URI at which the service is deployed. </td>
</tr>
<tr>
<td class='confluenceTd'> endpointInterface </td>
<td class='confluenceTd'> Specifies the full name of the SEI that the implementation class implements. This property is only used when the attribute is used on a service implementation class. </td>
</tr>
<tr>
<td class='confluenceTd'> portName </td>
<td class='confluenceTd'> Specifies the name of the endpoint at which the service is published. This property is mapped to the <tt>name</tt> attribute of the <tt>wsdl:port</tt> element that specifies the endpoint details for a published service. The default is the append <tt>Port</tt> to the name of the service's implementation class.</td>
</tr>
</tbody></table>
<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Tip</b><br />
<p>You do not need to provide values for any of the <tt>@WebService</tt> annotation's properties. However, it is recommended that you provide as much information as you can.</p></td></tr></table>

<h5><a name="DevelopingaService-AnnotatingtheSEI"></a>Annotating the SEI</h5>

<p>The SEI requires that you add the <tt>@WebService</tt> annotation. Since the SEI is the contract that defines the service, you should specify as much detail as you can about the service in the <tt>@WebService</tt> annotation's properties.</p>

<p><a href="#DevelopingaService-Example4" title="Example4 on Developing a Service">Example4</a> shows the interface defined in <a href="#DevelopingaService-Example2" title="Example2 on Developing a Service">Example2</a> with the <tt>@WebService</tt> annotation.</p>

<p><a name="DevelopingaService-Example4"></a></p>

<div class="code"><div class="codeHeader"><b>Example4:Interface with the @WebService Annotation</b></div><div class="codeContent">
<pre class="code-java"><span class="code-keyword">package</span> com.iona.demo;

<span class="code-keyword">import</span> javax.jws.*;

@WebService(name=<span class="code-quote">"quoteUpdater"</span>,
            targetNamespace=<span class="code-quote">"http:\\cxf.apache.org"</span>,
	    serviceName=<span class="code-quote">"updateQuoteService"</span>,
            wsdlLocation=<span class="code-quote">"http:\\cxf.apache.org\quoteExampleService?wsdl"</span>,
            portName=<span class="code-quote">"updateQuotePort"</span>)
<span class="code-keyword">public</span> <span class="code-keyword">interface</span> quoteReporter
{
  <span class="code-keyword">public</span> Quote getQuote(@WebParam(name=<span class="code-quote">"ticker"</span>) <span class="code-object">String</span> ticker);
}</pre>
</div></div>

<p>The <tt>@WebService</tt> annotation in <a href="#DevelopingaService-Example4" title="Example4 on Developing a Service">Example4</a> does the following:</p>
<ol>
	<li>Specifies that the value of the name attribute of the <tt>wsdl:portType</tt> element defining the service interface is <tt>quoteUpdater</tt>.</li>
	<li>Specifies that the target namespace of the service is <tt>http:<br clear="all" />cxf.apache.org</tt>.</li>
	<li>Specifies that the value of the name of the <tt>wsdl:service</tt> element defining the published service is <tt>updateQuoteService</tt>.</li>
	<li>Specifies that the service will publish its WSDL contract at <tt>http:\\cxf.apache.org\quoteExampleService?wsdl</tt>.</li>
	<li>Specifies that the value of the name attribute of the <tt>wsdl:port</tt> element defining the endpoint exposing the service is <tt>updateQuotePort</tt>.</li>
</ol>


<p>The @WebParam annotation is necessary as java interfaces do not store the Parameter name in the .class file. So if you leave out the annotation your parameter will be named arg0.</p>

<h5><a name="DevelopingaService-Annotatingtheserviceimplementation"></a>Annotating the service implementation</h5>

<p>In addition to annotating the SEI with the <tt>@WebService</tt> annotation, you also have to annotate the service implementation class with the <tt>@WebService</tt> annotation. When adding the annotation to the service implementation class you only need to specify the <tt>endpointInterface</tt> property. As shown in <a href="#DevelopingaService-Example5" title="Example5 on Developing a Service">Example5</a> the property needs to be set to the full name of the SEI.</p>

<p><a name="DevelopingaService-Example5"></a></p>
<div class="code"><div class="codeHeader"><b>Example5:Annotated Service Implementation Class</b></div><div class="codeContent">
<pre class="code-java"><span class="code-keyword">package</span> org.apache.cxf;

<span class="code-keyword">import</span> javax.jws.*;

@WebService(endpointInterface=<span class="code-quote">"org.apache.cxf.quoteReporter"</span>)
<span class="code-keyword">public</span> class stockQuoteReporter <span class="code-keyword">implements</span> quoteReporter
{
<span class="code-keyword">public</span> Quote getQuote(<span class="code-object">String</span> ticker)
  {
  ...
  }
}</pre>
</div></div>

<h4><a name="DevelopingaService-OptionalAnnotations"></a>Optional Annotations</h4>

<p>While the <tt>@WebService</tt> annotation is sufficient for service enabling a Java interface or a Java class, it does not provide a lot of information about how the service will be exposed as an endpoint. The JAX-WS programming model uses a number of optional annotations for adding details about your service, such as the binding it uses, to the Java code. You add these annotations to the service's SEI.</p>

<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Tip</b><br />
<p>The more details you provide in the SEIthe easier it will be for developers to implement applications that can use the functionality it defines. It will also provide for better generated WSDL contracts.</p></td></tr></table>

<h5><a name="DevelopingaService-DefiningtheBindingPropertieswithAnnotations"></a>Defining the Binding Properties with Annotations</h5>

<p>If you are using a SOAP binding for your service, you can use JAX-WS annotations to specify a number of the bindings properties. These properties correspond directly to the properties you can specify in a service's WSDL contract.</p>

<h5><a name="DevelopingaService-The%7B%7B@SOAPBinding%7D%7Dannotation"></a>The <tt>@SOAPBinding</tt> annotation</h5>

<p>The <tt>@SOAPBinding</tt> annotation is defined by the <tt>javax.jws.soap.SOAPBinding</tt> interface. It provides details about the SOAP binding used by the service when it is deployed. If the <tt>@SOAPBinding</tt> annotation is not specified, a service is published using a wrapped doc/literal SOAP binding.</p>

<p>You can put the <tt>@SOAPBinding</tt> annotation on the SEI and any of the SEI's methods. When it is used on a method, setting of the method's <tt>@SOAPBinding</tt> annotation take precedent.</p>

<p>The following table shows the properties for the @SOAPBinding annotation.</p>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Property</th>
<th class='confluenceTh'>Values</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'> style </td>
<td class='confluenceTd'> <tt>Style.DOCUMENT</tt> (default)<br clear="all" />
<tt>Style.RPC</tt> </td>
<td class='confluenceTd'> Specifies the style of the SOAP message. If <tt>RPC</tt> style is specified, each message part within the SOAP body is a parameter or return value and will appear inside a wrapper element within the <tt>soap:body</tt> element. The message parts within the wrapper element correspond to operation parameters and must appear in the same order as the parameters in the operation. If <tt>DOCUMENT</tt> style is specified, the contents of the SOAP body must be a valid XML document, but its form is not as tightly constrained. </td>
</tr>
<tr>
<td class='confluenceTd'> use </td>
<td class='confluenceTd'> <tt>Use.LITERAL</tt> (default)<br clear="all" />
<tt>Use.ENCODED</tt> </td>
<td class='confluenceTd'> Specifies how the data of the SOAP message is streamed. </td>
</tr>
<tr>
<td class='confluenceTd'> parameterStyle</td>
<td class='confluenceTd'> <tt>ParameterStyle.BARE</tt><br clear="all" />
<tt>ParameterStyle.WRAPPED</tt> (default) </td>
<td class='confluenceTd'> Specifies how the method parameters, which correspond to message parts in a WSDL contract, are placed into the SOAP message body. A parameter style of <tt>BARE</tt> means that each parameter is placed into the message body as a child element of the message root. A parameter style of <tt>WRAPPED</tt> means that all of the input parameters are wrapped into a single element on a request message and that all of the output parameters are wrapped into a single element in the response message. If you set the style to RPC you must use the <tt>WRAPPED</tt> parameter style. </td>
</tr>
</tbody></table>

<p><a href="#DevelopingaService-Example6" title="Example6 on Developing a Service">Example6</a> shows an SEI that uses rpc/literal SOAP messages.<br/>
<a name="DevelopingaService-Example6"></a></p>
<div class="code"><div class="codeHeader"><b>Example6:Specifying an RPC/LITERAL SOAP Binding</b></div><div class="codeContent">
<pre class="code-java"><span class="code-keyword">package</span> org.eric.demo;

<span class="code-keyword">import</span> javax.jws.*;
<span class="code-keyword">import</span> javax.jws.soap.*;
<span class="code-keyword">import</span> javax.jws.soap.SOAPBinding.*;

@WebService(name=<span class="code-quote">"quoteReporter"</span>)
@SOAPBinding(style=Style.RPC, use=Use.LITERAL)
<span class="code-keyword">public</span> <span class="code-keyword">interface</span> quoteReporter
{
  ...
}</pre>
</div></div>

<h5><a name="DevelopingaService-DefiningOperationPropertieswithAnnotations"></a>Defining Operation Properties with Annotations</h5>

<p>When the runtime maps your Java method definitions into XML operation definitions it fills in details such as:</p>
<ul>
	<li>what the exchanged messages look like in XML.</li>
	<li>if the message can be optimized as a one way message.</li>
	<li>the namespaces where the messages are defined.</li>
</ul>


<h5><a name="DevelopingaService-The%7B%7B@WebMethod%7D%7Dannotation"></a>The <tt>@WebMethod</tt> annotation</h5>

<p> The <tt>@WebMethod</tt> annotation is defined by the <tt>javax.jws.WebMethod</tt> interface. It is placed on the methods in the SEI. The <tt>@WebMethod</tt> annotation provides the information that is normally represented in the <tt>wsdl:operation</tt> element describing the operation to which the method is associated.</p>

<p>The following table describes the properties of the <tt>@WebMethod</tt> annotation.</p>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Property</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'> operationName </td>
<td class='confluenceTd'> Specifies the value of the associated <tt>wsdl:operation</tt> element's name. The default value is the name of the method. </td>
</tr>
<tr>
<td class='confluenceTd'> action </td>
<td class='confluenceTd'> Specifies the value of the <tt>soapAction</tt> attribute of the <tt>soap:operation</tt> element generated for the method. The default value is an empty string. </td>
</tr>
<tr>
<td class='confluenceTd'> exclude </td>
<td class='confluenceTd'> Specifies if the method should be excluded from the service interface. The default is <tt>false</tt>. </td>
</tr>
</tbody></table>


<h5><a name="DevelopingaService-The%7B%7B@RequestWrapper%7D%7Dannotation"></a>The <tt>@RequestWrapper</tt> annotation</h5>

<p> The <tt>@RequestWrapper</tt> annotation is defined by the <tt>javax.xml.ws.RequestWrapper</tt> interface. It is placed on the methods in the SEI. As the name implies, <tt>@RequestWrapper</tt> specifies the Java class that implements the wrapper bean for the method parameters that are included in the request message sent in a remote invocation. It is also used to specify the element names, and namespaces, used by the runtime when marshalling and unmarshalling the request messages.</p>

<p>The following table describes the properties of the @RequestWrapper annotation.</p>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Property</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'> localName </td>
<td class='confluenceTd'> Specifies the local name of the wrapper element in the XML representation of the request message. The default value is the name of the method or the value of the <tt>@WebMethod</tt> annotation's <tt>operationName</tt> property. </td>
</tr>
<tr>
<td class='confluenceTd'> targetNamespace </td>
<td class='confluenceTd'> Specifies the namespace under which the XML wrapper element is defined. The default value is the target namespace of the SEI. </td>
</tr>
<tr>
<td class='confluenceTd'> className </td>
<td class='confluenceTd'> Specifies the full name of the Java class that implements the wrapper element. </td>
</tr>
</tbody></table>
<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Tip</b><br />
<p>Only the <tt>className</tt> property is required.</p></td></tr></table>

<h5><a name="DevelopingaService-The%7B%7B@ResponseWrapper%7D%7Dannotation"></a>The <tt>@ResponseWrapper</tt> annotation</h5>

<p>The <tt>@ResponseWrapper</tt> annotation is defined by the <tt>javax.xml.ws.ResponseWrapper</tt> interface. It is placed on the methods in the SEI. As the name implies, <tt>@ResponseWrapper</tt> specifies the Java class that implements the wrapper bean for the method parameters that are included in the response message sent in a remote invocation. It is also used to specify the element names, and namespaces, used by the runtime when marshalling and unmarshalling the response messages.</p>

<p>The following table describes the properties of the <tt>@ResponseWrapper</tt> annotation.</p>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Property</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'> localName </td>
<td class='confluenceTd'> Specifies the local name of the wrapper element in the XML representation of the response message. The default value is the name of the method with <tt>Response</tt> appended or the value of the <tt>@WebMethod</tt> annotation's <tt>operationName</tt> property with <tt>Response</tt> appended. </td>
</tr>
<tr>
<td class='confluenceTd'> targetNamespace </td>
<td class='confluenceTd'> Specifies the namespace under which the XML wrapper element is defined. The default value is the target namespace of the SEI. </td>
</tr>
<tr>
<td class='confluenceTd'> className </td>
<td class='confluenceTd'> Specifies the full name of the Java class that implements the wrapper element. </td>
</tr>
</tbody></table>

<table cellpadding='5' width='85%' cellspacing='8px' class='tipMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Tip</b><br />
<p>Only the <tt>className</tt> property is required.</p></td></tr></table>

<h5><a name="DevelopingaService-The%7B%7B@WebFault%7D%7Dannotation"></a>The <tt>@WebFault</tt> annotation</h5>

<p>The <tt>@WebFault</tt> annotation is defined by the <tt>javax.xml.ws.WebFault</tt> interface. It is placed on exceptions that are thrown by your SEI. The <tt>@WebFault</tt> annotation is used to map the Java exception to a <tt>wsdl:fault</tt> element. This information is used to marshall the exceptions into a representation that can be processed by both the service and its consumers.</p>

<p>The following table describes the properties of the <tt>@WebFault</tt> annotation.</p>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Property</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'> name </td>
<td class='confluenceTd'> Specifies the local name of the fault element. </td>
</tr>
<tr>
<td class='confluenceTd'> targetNamespace </td>
<td class='confluenceTd'> Specifies the namespace under which the fault element is defined. The default value is the target namespace of the SEI. </td>
</tr>
<tr>
<td class='confluenceTd'> faultName </td>
<td class='confluenceTd'> Specifies the full name of the Java class that implements the exception. </td>
</tr>
</tbody></table>
<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Important</b><br />
<p>The <tt>name</tt> property is required.</p></td></tr></table>

<h5><a name="DevelopingaService-The%7B%7B@OneWay%7D%7Dannotation"></a>The <tt>@OneWay</tt> annotation</h5>

<p>The <tt>@OneWay</tt> annotation is defined by the <tt>javax.jws.OneWay</tt> interface. It is placed on the methods in the SEI that will not require a response from the service. The <tt>@OneWay</tt> annotation tells the run time that it can optimize the execution of the method by not waiting for a response and not reserving any resources to process a response.</p>

<h5><a name="DevelopingaService-Example"></a>Example</h5>

<p><a href="#DevelopingaService-Example7" title="Example7 on Developing a Service">Example7</a> shows an SEI whose methods are annotated.</p>

<p><a name="DevelopingaService-Example7"></a></p>
<div class="code"><div class="codeHeader"><b>Example7:SEI with Annotated Methods</b></div><div class="codeContent">
<pre class="code-java"><span class="code-keyword">package</span> org.apache.cxf;

<span class="code-keyword">import</span> javax.jws.*;
<span class="code-keyword">import</span> javax.xml.ws.*;

@WebService(name=<span class="code-quote">"quoteReporter"</span>)
<span class="code-keyword">public</span> <span class="code-keyword">interface</span> quoteReporter
{
  @WebMethod(operationName=<span class="code-quote">"getStockQuote"</span>)
  @RequestWrapper(targetNamespace=<span class="code-quote">"http:<span class="code-comment">//demo.iona.com/types"</span>,
</span>                  className=<span class="code-quote">"java.lang.<span class="code-object">String</span>"</span>)
  @ResponseWrapper(targetNamespace=<span class="code-quote">"http:<span class="code-comment">//demo.iona.com/types"</span>,
</span>                   className=<span class="code-quote">"org.eric.demo.Quote"</span>)
  <span class="code-keyword">public</span> Quote getQuote(<span class="code-object">String</span> ticker);
}</pre>
</div></div>

<h5><a name="DevelopingaService-DefiningParameterPropertieswithAnnotations"></a>Defining Parameter Properties with Annotations</h5>

<p>The method parameters in the SEI coresspond to the <tt>wsdl:message</tt> elements and their <tt>wsdl:part</tt> elements. JAX-WS provides annotations that allow you to describe the <tt>wsdl:part</tt> elements that are generated for the method parameters.</p>

<h5><a name="DevelopingaService-The%7B%7B@WebParam%7D%7Dannotation"></a>The <tt>@WebParam</tt> annotation</h5>

<p>The <tt>@WebParam</tt> annotation is defined by the <tt>javax.jws.WebParam</tt> interface. It is placed on the parameters on the methods defined in the SEI. The <tt>@WebParam</tt> annotation allows you to specify the direction of the parameter, if the parameter will be placed in the SOAP header, and other properties of the generated <tt>wsdl:part</tt>.</p>

<p>The following table describes the properties of the <tt>@WebParam</tt> annotation.</p>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Property</th>
<th class='confluenceTh'>Values</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'> name </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> Specifies the name of the parameter as it appears in the WSDL. For RPC bindings, this is name of the <tt>wsdl:part</tt> representing the parameter. For document bindings, this is the local name of the XML element representing the parameter. Per the JAX-WS specification, the default is <em>argN</em>, where <em>N</em> is replaced with the zero-based argument index (i.e., <em>arg0</em>, <em>arg1</em>, etc.)</td>
</tr>
<tr>
<td class='confluenceTd'> targetNamespace </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> Specifies the namespace for the parameter. It is only used with document bindings where the parameter maps to an XML element. The defaults is to use the service's namespace. </td>
</tr>
<tr>
<td class='confluenceTd'> mode </td>
<td class='confluenceTd'> <tt>Mode.IN</tt> (default)<br clear="all" />
<tt>Mode.OUT</tt><br clear="all" />
<tt>Mode.INOUT</tt> </td>
<td class='confluenceTd'> Specifies the direction of the parameter. </td>
</tr>
<tr>
<td class='confluenceTd'> header </td>
<td class='confluenceTd'> <tt>false</tt> (default)<br clear="all" />
<tt>true</tt> </td>
<td class='confluenceTd'> Specifies if the parameter is passed as part of the SOAP header. </td>
</tr>
<tr>
<td class='confluenceTd'> partName </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> Specifies the value of the name attribute of the <tt>wsdl:part</tt> element for the parameter when the binding is document. </td>
</tr>
</tbody></table>


<h5><a name="DevelopingaService-The%7B%7B@WebResult%7D%7Dannotation"></a>The <tt>@WebResult</tt> annotation</h5>

<p>The <tt>@WebResult</tt> annotation is defined by the <tt>javax.jws.WebResult</tt> interface. It is placed on the methods defined in the SEI. The <tt>@WebResult</tt> annotation allows you to specify the properties of the generated <tt>wsdl:part</tt> that is generated for the method's return value.</p>

<p>The following table describes the properties of the <tt>@WebResult</tt> annotation.</p>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'>Property</th>
<th class='confluenceTh'>Description</th>
</tr>
<tr>
<td class='confluenceTd'> name </td>
<td class='confluenceTd'> Specifies the name of the return value as it appears in the WSDL. For RPC bindings, this is name of the <tt>wsdl:part</tt> representing the return value. For document bindings, this is the local name of the XML element representing the return value. The default value is return. </td>
</tr>
<tr>
<td class='confluenceTd'> targetNamespace </td>
<td class='confluenceTd'> Specifies the namespace for the return value. It is only used with document bindings where the return value maps to an XML element. The defaults is to use the service's namespace. </td>
</tr>
<tr>
<td class='confluenceTd'> header </td>
<td class='confluenceTd'> Specifies if the return value is passed as part of the SOAP header. </td>
</tr>
<tr>
<td class='confluenceTd'> partName </td>
<td class='confluenceTd'> Specifies the value of the name attribute of the <tt>wsdl:part</tt> element for the return value when the binding is document. </td>
</tr>
</tbody></table>


<h5><a name="DevelopingaService-Example"></a>Example</h5>

<p><a href="#DevelopingaService-Example8" title="Example8 on Developing a Service">Example8</a> shows an SEI that is fully annotated.</p>

<p><a name="DevelopingaService-Example8"></a></p>
<div class="code"><div class="codeHeader"><b>Example8:Fully Annotated SEI</b></div><div class="codeContent">
<pre class="code-java"><span class="code-keyword">package</span> org.apache.cxf;

<span class="code-keyword">import</span> javax.jws.*;
<span class="code-keyword">import</span> javax.xml.ws.*;
<span class="code-keyword">import</span> javax.jws.soap.*;
<span class="code-keyword">import</span> javax.jws.soap.SOAPBinding.*;
<span class="code-keyword">import</span> javax.jws.WebParam.*;

@WebService(name=<span class="code-quote">"quoteReporter"</span>)
@SOAPBinding(style=Style.RPC, use=Use.LITERAL)
<span class="code-keyword">public</span> <span class="code-keyword">interface</span> quoteReporter
{
  @WebMethod(operationName=<span class="code-quote">"getStockQuote"</span>)
  @RequestWrapper(targetNamespace=<span class="code-quote">"http:<span class="code-comment">//demo.iona.com/types"</span>,
</span>                  className=<span class="code-quote">"java.lang.<span class="code-object">String</span>"</span>)
  @ResponseWrapper(targetNamespace=<span class="code-quote">"http:<span class="code-comment">//demo.iona.com/types"</span>,
</span>                   className=<span class="code-quote">"org.eric.demo.Quote"</span>)
  @WebResult(targetNamespace=<span class="code-quote">"http:<span class="code-comment">//demo.iona.com/types"</span>,
</span>             name=<span class="code-quote">"updatedQuote"</span>)
  <span class="code-keyword">public</span> Quote getQuote(
                        @WebParam(targetNamespace=<span class="code-quote">"http:<span class="code-comment">//demo.iona.com/types"</span>,
</span>                                  name=<span class="code-quote">"stockTicker"</span>,
                                  mode=Mode.IN)
                        <span class="code-object">String</span> ticker
  );
}</pre>
</div></div>

<h3><a name="DevelopingaService-GeneratingWSDL"></a>Generating WSDL</h3>

<p>Once you have annotated your code, you can generate a WSDL contract for your service using the <b>java2wsdl</b> command.</p>

<h4><a name="DevelopingaService-Example"></a>Example</h4>

<p><a href="#DevelopingaService-Example9" title="Example9 on Developing a Service">Example9</a> shows the WSDL contract generated for the SEI shown in <a href="#DevelopingaService-Example8" title="Example8 on Developing a Service">Example8</a>.</p>

<p><a name="DevelopingaService-Example9"></a></p>
<div class="code"><div class="codeHeader"><b>Example9:Generated WSDL from an SEI</b></div><div class="codeContent">
<pre class="code-java">&lt;?xml version=<span class="code-quote">"1.0"</span> encoding=<span class="code-quote">"UTF-8"</span>?&gt;
&lt;wsdl:definitions targetNamespace=<span class="code-quote">"http:<span class="code-comment">//demo.eric.org/"</span>
</span>                  xmlns:tns=<span class="code-quote">"http:<span class="code-comment">//demo.eric.org/"</span>
</span>		  xmlns:ns1=""
		  xmlns:xsd=<span class="code-quote">"http:<span class="code-comment">//www.w3.org/2001/XMLSchema"</span>
</span>		  xmlns:ns2=<span class="code-quote">"http:<span class="code-comment">//demo.eric.org/types"</span>
</span>		  xmlns:soap=<span class="code-quote">"http:<span class="code-comment">//schemas.xmlsoap.org/wsdl/soap/"</span>
</span>		  xmlns:wsdl=<span class="code-quote">"http:<span class="code-comment">//schemas.xmlsoap.org/wsdl/"</span>&gt;
</span>  &lt;wsdl:types&gt;
    &lt;xsd:schema&gt;
      &lt;xs:complexType name=<span class="code-quote">"quote"</span>&gt;
        &lt;xs:sequence&gt;
          &lt;xs:element name=<span class="code-quote">"ID"</span> type=<span class="code-quote">"xs:string"</span> minOccurs=<span class="code-quote">"0"</span>/&gt;
          &lt;xs:element name=<span class="code-quote">"time"</span> type=<span class="code-quote">"xs:string"</span> minOccurs=<span class="code-quote">"0"</span>/&gt;
          &lt;xs:element name=<span class="code-quote">"val"</span> type=<span class="code-quote">"xs:<span class="code-object">float</span>"</span>/&gt;
        &lt;/xs:sequence&gt;
      &lt;/xs:complexType&gt;
    &lt;/xsd:schema&gt;
  &lt;/wsdl:types&gt;
  &lt;wsdl:message name=<span class="code-quote">"getStockQuote"</span>&gt;
    &lt;wsdl:part name=<span class="code-quote">"stockTicker"</span> type=<span class="code-quote">"xsd:string"</span>&gt;
    &lt;/wsdl:part&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:message name=<span class="code-quote">"getStockQuoteResponse"</span>&gt;
    &lt;wsdl:part name=<span class="code-quote">"updatedQuote"</span> type=<span class="code-quote">"tns:quote"</span>&gt;
    &lt;/wsdl:part&gt;
  &lt;/wsdl:message&gt;
  &lt;wsdl:portType name=<span class="code-quote">"quoteReporter"</span>&gt;
    &lt;wsdl:operation name=<span class="code-quote">"getStockQuote"</span>&gt;
      &lt;wsdl:input name=<span class="code-quote">"getQuote"</span> message=<span class="code-quote">"tns:getStockQuote"</span>&gt;
    &lt;/wsdl:input&gt;
      &lt;wsdl:output name=<span class="code-quote">"getQuoteResponse"</span> message=<span class="code-quote">"tns:getStockQuoteResponse"</span>&gt;
    &lt;/wsdl:output&gt;
    &lt;/wsdl:operation&gt;
  &lt;/wsdl:portType&gt;
  &lt;wsdl:binding name=<span class="code-quote">"quoteReporterBinding"</span> type=<span class="code-quote">"tns:quoteReporter"</span>&gt;
    &lt;soap:binding style=<span class="code-quote">"rpc"</span> transport=<span class="code-quote">"http:<span class="code-comment">//schemas.xmlsoap.org/soap/http"</span>/&gt;
</span>    &lt;wsdl:operation name=<span class="code-quote">"getStockQuote"</span>&gt;
      &lt;soap:operation style=<span class="code-quote">"rpc"</span>/&gt;
      &lt;wsdl:input name=<span class="code-quote">"getQuote"</span>&gt;
        &lt;soap:body use=<span class="code-quote">"literal"</span>/&gt;
      &lt;/wsdl:input&gt;
      &lt;wsdl:output name=<span class="code-quote">"getQuoteResponse"</span>&gt;
        &lt;soap:body use=<span class="code-quote">"literal"</span>/&gt;
      &lt;/wsdl:output&gt;
    &lt;/wsdl:operation&gt;
  &lt;/wsdl:binding&gt;
  &lt;wsdl:service name=<span class="code-quote">"quoteReporterService"</span>&gt;
    &lt;wsdl:port name=<span class="code-quote">"quoteReporterPort"</span> binding=<span class="code-quote">"tns:quoteReporterBinding"</span>&gt;
      &lt;soap:address location=<span class="code-quote">"http:<span class="code-comment">//localhost:9000/quoteReporterService"</span>/&gt;
</span>    &lt;/wsdl:port&gt;
  &lt;/wsdl:service&gt;
&lt;/wsdl:definitions&gt;</pre>
</div></div></div>


</td></tr></table></div>
<p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="http://cwiki.apache.org/confluence/images/border/spacer.gif" width="1" height="1" border="0"/></td>
    </tr>
</table>

<div class="smalltext">
    Powered by
    <a href="http://www.atlassian.com/software/confluence/default.jsp?clicked=footer" class="smalltext">Atlassian Confluence</a>
    (Version: 2.2.9 Build:#527 Sep 07, 2006)
    -
    <a href="http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470" class="smalltext">Bug/feature request</a><br/>
    <br>
    <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action">Unsubscribe or edit your notifications preferences</a>

</div>

</body>
</html>


Mime
View raw message