Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么TCP/IP监视器不';在eclipse中捕获soap消息_Java_Eclipse_Web Services_Soap_Jax Ws - Fatal编程技术网

Java 为什么TCP/IP监视器不';在eclipse中捕获soap消息

Java 为什么TCP/IP监视器不';在eclipse中捕获soap消息,java,eclipse,web-services,soap,jax-ws,Java,Eclipse,Web Services,Soap,Jax Ws,我是soap和jax ws的新手 在阅读了许多信息之后,我知道eclipse可以捕获soap消息,但我对此有问题 我的出版商 public static void main(String[] args) { Endpoint.publish("http://localhost:8081/WS/Greeting", new GreetingImpl()); } 我的老师 public static void main(String[] ar

我是soap和jax ws的新手

在阅读了许多信息之后,我知道eclipse可以捕获soap消息,但我对此有问题

我的出版商

public static void main(String[] args) {
        Endpoint.publish("http://localhost:8081/WS/Greeting",
                new GreetingImpl());
    }
我的老师

public static void main(String[] args) {

        GreetingImplService service = new GreetingImplService();
        Greeting greeting = service.getGreetingImplPort();
        System.out.println("------->>  Call Started");
        System.out.println(greeting.sayHello("friend !!!"));
        System.out.println("------->>  Call Ended");
    }
当我在控制台中调用客户机时,我看到

------->>  Call Started
Hello, Welcom to jax-ws friend !!!
------->>  Call Ended
因此,它是工作服务

但在TCP | IP监视器中,我看到了空列表

我的TCP | IP监视器配置

我做错了什么


请,帮助)

我认为问题在于您的客户端直接指向端口8081(ws的端口),因此tcp/ip监视器无法发挥作用。由于监视器正在侦听端口8080,因此客户端应使用此端点:

http://localhost:8080/WS/Greeting
TCP/IP监视器将接收http请求,然后将消息转发给

http://localhost:8081/WS/Greeting
要更改客户端使用的端点,有两种可能:

  • 如果客户机使用本地wsdl文档(例如,您在文件系统上保存了wsdl的副本并使用它调用wsimport),则可以修改其中的端点(查看wsdl末尾的元素服务)。service.getGreetingImplPort()返回的存根从wsdl读取端点

  • 您可以在客户端的主方法中使用此指令

      ((BindingProvider) greeting).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,"http://localhost:8080/WS/Greeting");