Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
borderStylesolid
titleCalculatorService.java
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;
    }
}

...