【问题标题】:generated objects via wsimport , can not call in spring mvc通过 wsimport 生成的对象,不能在 spring mvc 中调用
【发布时间】:2014-08-08 20:28:18
【问题描述】:

我已经尝试了所有方法来运行 ws 两天,但我不能。我通过 wsimport (jaxws) 将 Web 服务生成为对象类。 (https://repservice.automatic.com.tr/automaticreport.asmx?wsdl)

在 Spring MVC 中我无法得到响应。

  @RequestMapping(value = { "/", "/welcome**" }, method = RequestMethod.GET)
    public String defaultPage(Model model) {
        AutomaticReport service = new  AutomaticReport();
        Holder<Integer> getFletLimitResult = null;
        Holder<String> result = null;
        AutomaticReportSoap response = service.getAutomaticReportSoap();
        response.getFletLimit("username", "password", "101732", getFletLimitResult, result);
        System.out.println(getFletLimitResult+ "  - "  + result);
                return "home";

    }

【问题讨论】:

  • 你在哪里设置你的网络服务连接参数?
  • 正如我在示例中看到的 webservice 连接 url 已经添加到 automaticreport..class 中。其他参数正在由请求函数发送。
  • 您是否尝试在 Spring 之外运行它...当您说您没有得到任何响应时,您是什么意思?一切都是空的吗?
  • 是的,我做到了。 SoapUI 正确返回结果。 output 在 spring 中为 null。

标签: spring-mvc jax-ws wsimport


【解决方案1】:

Holder-s 是类对象。为此,我们必须分配对象。

  @RequestMapping(value = { "/", "/welcome**" }, method = RequestMethod.GET)
    public String defaultPage(Model model) {
        AutomaticReport service = new  AutomaticReport();
        Holder<Integer> getFletLimitResult = new  Holder<Integer>();
        Holder<String> result = new  Holder<String> ();
        AutomaticReportSoap response = service.getAutomaticReportSoap();
        response.getFletLimit("username", "password", "101732", getFletLimitResult, result);
       System.out.println(getFletLimitResult.value.toString() + "  -  "  + result.value.toString());
                return "home";

    }

【讨论】:

    猜你喜欢
    • 2017-12-20
    • 1970-01-01
    • 2016-08-11
    • 1970-01-01
    • 2013-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多