...
Property | Description |
---|---|
name | Specifies the name of the service interface. This property is mapped to the name attribute of the |
targetNamespace | 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. |
serviceName | Specifies the name of the published service. This property is mapped to the |
wsdlLocation | Specifies the URI at which the service's WSDL contract is stored. The default is the URI at which the service is deployed. |
endpointInterface | 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. Note: Not allowed on the SEI |
portName | Specifies the name of the endpoint at which the service is published. This property is mapped to the |
Tip | ||
---|---|---|
| ||
You do not need to provide values for any of the |
...
Code Block | ||
---|---|---|
| ||
package com.iona.demo; import javax.jws.*; @WebService(name="quoteUpdater", targetNamespace="http:\\//cxf.apache.org", wsdlLocation="http:\\//somewhere.com\/quoteExampleService?wsdl") public interface quoteReporterQuoteReporter { public Quote getQuote(@WebParam(name="ticker") String ticker); } |
...
- Specifies that the value of the name attribute of the
wsdl:portType
element defining the service interface isquoteUpdater
. - Specifies that the target namespace of the service is {{
http:
//cxf.apache.org
}}.
- Specifies that the value of the name of the wsdl: service element defining the published service is
updateQuoteService
.Specifies that the service will use the pre-defined WSDL contract which is published athttp:\\//somewhere.com\/quoteExampleService?wsdl
. - Specifies that the value of the name attribute of the
wsdl:port
element defining the endpoint exposing the service isupdateQuotePort
.
The @WebParam annotation is necessary as java interfaces do not store the Parameter name 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.
...
Code Block | ||
---|---|---|
| ||
package org.apache.cxf; import javax.jws.*; @WebService(endpointInterface="org.apache.cxf.quoteReporter", targetNamespace="http://cxf.apache.org", portName="StockQuotePort", serviceName="StockQuoteReporter", ) public class stockQuoteReporterStockQuoteReporter implements quoteReporterQuoteReporter { public Quote getQuote(String ticker) { ... } } |
...