?? helloserviceimpl.java
字號:
package org.something.services.hello.impl;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import org.something.services.hello.HelloRequest;
import org.something.services.hello.HelloResponse;
import org.something.services.hello.ws.HelloFaultMessage;
import org.something.services.hello.ws.HelloService;
/**
* Hello Service Implementation.
* @author Michael Vorburger
*/
@WebService(serviceName = "HelloService", targetNamespace = "http://services.something.org/hello", endpointInterface = "org.something.services.hello.ws.HelloService")
//// wsdlLocation = "file:/C:/MyCode/Visana1/xfire-examples-fullmonty/src/wsdl/hello.wsdl"
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.BARE)
public class HelloServiceImpl implements HelloService {
/**
* Say "Hello {request.toWho}", or return Fault if toWho == "FAULT".
*/
public HelloResponse sayHello(HelloRequest helloRequest) throws HelloFaultMessage {
if ("fault".equalsIgnoreCase(helloRequest.getToWho())) {
org.something.services.hello.HelloFault fault =
new org.something.services.hello.HelloFault();
fault.setShortErrorMessage("SomeThingsAreVeryWrong");
fault.setTechImplementationDetails(new NullPointerException().toString());
throw new HelloFaultMessage("Failure", fault);
}
else {
HelloResponse response = new HelloResponse();
response.setGreeting("Hello " + helloRequest.getToWho());
return response;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -