Java Reference
In-Depth Information
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import org.apache.log4j.Logger;
/**
* Demonstrates a service that uses JAXB-generated types as
* parameters for a start-from-schema-and-java method.
* Uses Credit.wsdl and Credit.xsd.
*/
@WebService(
name="CreditAuthorizer",
serviceName="CreditService",
targetNamespace="http://ns.soacookbook.com/credit",
wsdlLocation="WEB-INF/wsdl/ch03/Credit.wsdl")
public class CreditService {
private static final Logger LOGGER =
Logger.getLogger(CreditService.class);
/** Creates an instance of CreditService.
*/
public CreditService() {
LOGGER.debug("Created provider instance.");
}
//business method
@WebMethod(operationName="authorize")
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
use=SOAPBinding.Use.LITERAL,
parameterStyle=SOAPBinding.ParameterStyle.BARE)
public @WebResult(name="authorization",
targetNamespace="http://ns.soacookbook.com/credit")
Authorization
authorize(
@WebParam(name="creditCard",
mode=WebParam.Mode.IN,
targetNamespace="http://ns.soacookbook.com/credit")
CreditCard creditCard) {
LOGGER.debug("Authorizing.");
LOGGER.debug("Card Number: " + creditCard.getCardNumber());
//get data from compound type
Search WWH ::




Custom Search