webservice 发布后怎么能通过postman来调用?

服务已经生成了

clipboard.png

@WebService
public class HelloWorld {

 @WebMethod
    public String sayHello(String str){
         System.out.println("get Message...");
         String result = "Hello World, "+str;
         return result;
    }
    public static void main(String[] args) {
        System.out.println("server is running");
        String address="http://localhost:8888/HelloWorld";
        Object implementor =new HelloWorld();
         Endpoint.publish(address, implementor);

    }

}

怎么样才能在postman调我的sayHello方法

阅读 3.2k
1 个回答

你得把请求信息封装成soap协议规定的xml格式才能通过postman调用,与其这样,还不如直接用soap测试工具。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题