...
#Example2 shows a simple SEI for a stock updating service.
Code Block |
---|
|
package org.apache.cxf;
public interface quoteReporter
{
public Quote getQuote(String ticker);
}
|
...
Code Block |
---|
title | Example4:Interface with the @WebService Annotation |
---|
|
package com.iona.demo;
import javax.jws.*;
@WebService(name="quoteUpdater",
targetNamespace="http:\\cxf.apache.org",
serviceName="updateQuoteService",
wsdlLocation="http:\\cxfsomewhere.apache.orgcom\quoteExampleService?wsdl",
portName="updateQuotePort")
public interface quoteReporter
{
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 is quoteUpdater
. - 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 publish its use the pre-defined WSDL contract which is published at
http:\\cxfsomewhere.apache.orgcom\quoteExampleService?wsdl
. - Specifies that the value of the name attribute of the
wsdl:port
element defining the endpoint exposing the service is updateQuotePort
.
...
#Example6 shows an SEI that uses rpc/literal SOAP messages.
Code Block |
---|
title | Example6:Specifying an RPC/LITERAL SOAP Binding |
---|
|
package org.eric.demo;
import javax.jws.*;
import javax.jws.soap.*;
import javax.jws.soap.SOAPBinding.*;
@WebService(name="quoteReporter")
@SOAPBinding(style=Style.RPC, use=Use.LITERAL)
public interface quoteReporter
{
...
}
|
...