THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
package org.apache.geronimo.samples.jws; import javax.annotation.Resource; import javax.jws.WebService; import javax.xml.ws.WebServiceContext; @WebService(serviceName = "Calculator", portName = portName="CalculatorPort", endpointInterface = "org.apache.geronimo.samples.jws.Calculator", targetNamespace = "http://jws.samples.geronimo.apache.org", wsdlLocation = "WEB-INF/wsdl/CalculatorService.wsdl") public class CalculatorService implements Calculator { @Resource private WebServiceContext context; public int add(int value1, int value2) { /** * @return returns javax.xml.ws.WebServiceContext */ public WebServiceContext System.out.println("User Principal: " + context.getUserPrincipal()getContext() { return context; } /** * @param value1 * @param value2 * @return returns int */ public int add(int value1, int value2) { System.out.println("User Principal: " + context.getUserPrincipal()); System.out.println("value1: " + value1 + " value2: " + value2); return value1 + value2; } } |
...