【问题标题】:"Missing SEI" when generating artifacts with WSGEN使用 WSGEN 生成工件时“缺少 SEI”
【发布时间】:2012-11-01 15:27:07
【问题描述】:

我是 Web 服务开发的初学者。我想使用 wsgen.exe 生成工件。

这是我的代码:

  package com.calc.ws;

  import javax.jws.WebService;

  @WebService
  public class Calculator {
      public int add(int a, int b) {
          return (a + b);
      }
      public int sub(int a, int b) {
          return (a - b);
      }
  }

我面临的问题是当我想用这个命令(一个衬里)从命令行生成工件时:

C:\Program Files\Java\jdk1.7.0_05\bin\wsgen 
     -cp "c:\users\mico\workspaceSOA\calcWS\src\com.calc.ws.Calculator" 
     -verbose 
     -d "C:\users\mico\classes\"

我得到这个错误:

Missing SEI.

这是什么原因造成的?

【问题讨论】:

    标签: java web-services jaxb jax-ws wsgen


    【解决方案1】:

    Wsgen.exe的调用方式如下:

    WSGEN [options] <SEI>
    

    reads a web service endpoint implementation class (SEI) 并为 Web 服务部署和调用生成所有必需的工件。

    在您发布的命令行中,我只看到选项,您没有指定 SEI。并且从这里消息“缺少 SEI”(即您没有提供强制性命令行参数)。

    我不知道你的确切设置,但如果我有这个结构:

    c:\temp
    ├───classpath
    │   └───com
    │       └───calc
    │           └───ws
    │               └───Calculator.class
    └───generated
    

    如果我跑(单行):

    wsgen -cp c:\temp\classpath 
          -keep 
          -s c:\temp\generated 
          com.calc.ws.Calculator
    

    我会上课,但如果我只是跑步:

    wsgen -cp c:\temp\classpath 
          -keep 
          -s c:\temp\generated 
    

    我会得到:

    Missing SEI
    

    【讨论】:

    • 这是我到 Calculator.class 的完整路径:“c:\users\mico\workspaceSOA\calcWS\bin\com.calc.ws.Calculator”,这是我生成输出的路径: "c:\users\mico\workspaceSOA\calcWS\src\com.calc.ws.jaxws" 这里有类路径,这是类文件的路径还是其他什么?我正在运行您的线路,但我得到错误类未找到“com.calc.ws.jaxws”
    • 我能对这个答案说些什么,谢谢,但博格丹我不喜欢这个 3663 回文。
    • @MitjaRogl 很高兴它对您有很大帮助,但为什么不分享您的解决方案呢?我的意思是,这是一个分享知识的地方,而不仅仅是在你需要的时候帮助你好吗?
    • 我已经尝试过了,但我仍然无法生成工件,并且仍然显示相同的错误,你能帮帮我吗。
    【解决方案2】:
    The error "Missing SEI" means Service Endpoint Interface is missing. Please create an interface for your service. please refer below code:
    
    Service Interface:
    package com;
    import javax.jws.WebService;
    
    @WebService
    public interface Calculator {
        public int add(int a, int b);
        public int sub(int a, int b);
    }
    
    Service Class implementing Service Interface:
    package com;
    
    import javax.jws.WebService;
    
    @WebService
    public class CalculatorImpl implements Calculator {
        public int add(int a, int b) {
            return (a + b);
        }
        public int sub(int a, int b) {
            return (a - b);
        }
    }
    
    Command which i have used is:
    >wsgen -cp . com.CalculatorImpl -keep -verbose -d ./stub
    
    Before executing above please make sure that destination folder stub is already created.
    
    Please try and let me know if still you are facing issue in this...
    

    【讨论】:

    • 构建 JAX-WS 端点时不需要服务端点接口 (SEI)。 该消息具有误导性:它指的是 wsgen.exe 参数 SEI(服务端点实现)而不是服务端点接口(也缩写为 SEI)。
    【解决方案3】:

    就我而言,我正在从 JAX-RPC 迁移到 JAX-WS,并且更改了包名称。通过更改它,我将不得不更改 xml 文件中的所有映射,例如在 webservices.xml 中。如果您收到 "Missing SEI" 错误,一个简单的解决方案是查找并删除 webservices.xml 文件,您应该可以使用 JAX-WS。

    【讨论】:

      【解决方案4】:

      对于我来说。这项工作。

      1. cd {project_path}/bin
      2. "C:\Program Files\Java\jdk1.7.0_05\bin\wsgen" -cp。 com.calc.ws.Calculator -详细 -d "C:\users\mico\classes\"
      3. 完成。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-02-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多