[英]SOAP Messages In Eclipse don't trace
我是jax-ws的新手
我有以下界面
@WebService(name = "HelloWorld", targetNamespace = "http://pack/")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public interface HelloWorld {
/**
*
* @param arg0
* @return
* returns java.lang.String
*/
@WebMethod
@WebResult(partName = "return")
public String getHelloWorldAsString(
@WebParam(name = "arg0", partName = "arg0")
String arg0);
}
实施后
@WebService(endpointInterface = "pack.HelloWorld")
public class HelloWorldImpl implements HelloWorld{
@Override
public String getHelloWorldAsString(String name) {
return "Hello World JAX-WS " + name;
}
}
以下客户端代码:
public class HelloWorldClient{
public static void main(String[] args) throws Exception {
URL url = new URL("http://localhost:9999/ws/hello?wsdl");
//1st argument service URI, refer to wsdl document above
//2nd argument is service name, refer to wsdl document above
QName qname = new QName("http://pack/", "HelloWorldImplService");
Service service = Service.create(url, qname);
HelloWorld hello = service.getPort(HelloWorld.class);
System.out.println(hello.getHelloWorldAsString("mkyong"));
}
}
在控制台中,我看到了
Hello World JAX-WS mkyong
TCP / IP监视器:
我将其配置为:
为什么在TCP / IP监视器上看不到消息?
更新 Pignic
如果我键入相同的本地监视端口和端口(禁用“确定”按钮),则将看到以下内容:
更新2
之后
我看到了旧的行为
出版商
我忘记为发布者添加代码:
public class HelloWorldPublisher{
public static void main(String[] args) {
Endpoint.publish("http://localhost:9999/ws/hello", new HelloWorldImpl());
}
我认为在“主机名”中应该放置“ localhost”,在“ LocalPort”中应该放置“ 9999”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.