使用原生JAVAAPI方式发布SOAP1.2 WebService

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebParam.Mode;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.xml.ws.BindingType;
import javax.xml.ws.Endpoint;
import javax.xml.ws.soap.SOAPBinding;

@WebService(targetNamespace = "http://ws.demo.com", serviceName = "TestWsService")
@BindingType(value=SOAPBinding.SOAP12HTTP_BINDING)
public class WsDemo {

	public static void main(String[] args) {
		WsDemo hello = new WsDemo();
		Endpoint.publish("http://localhost:8091/testWs/services/TestWs", hello);
		System.out.println("webservice Public Success");
	}

	@WebMethod(action = "access")
	@WebResult(name = "accessReturn")
	public String access(@WebParam(name = "xmldata", mode = Mode.IN) String xmldata) {
		return "invoke success" + xmldata;
	}
}

猜你喜欢

转载自blog.csdn.net/u013560667/article/details/81168529