質問

I am a beginner in the development of web services. I want to generate artifacts using wsgen.exe.

Here is my code:

  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);
      }
  }

The problem I'm facing is when I want to generate the artifacts from the command line with this command (one liner):

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\"

I get this error:

Missing SEI.

What is causing this?

役に立ちましたか?

解決

Wsgen.exe is called in the following way:

WSGEN [options] <SEI>

It reads a web service endpoint implementation class (SEI) and generates all the required artifacts for web service deployment, and invocation.

In the command line you posted I only see options, you specified no SEI. And from here the message "Missing SEI" (i.e. you didn't provide a mandatory command line argument).

I don't know your exact setup but if I were to have this structure:

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

If I run (on one line):

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

I will get my classes, but if I run just:

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

I will get:

Missing SEI

他のヒント

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...

In my case I am migrating from JAX-RPC to JAX-WS and I changed the package name. By changing this I would have to change all the mappings in xml files, like in webservices.xml for example. A simple solution if you get the "Missing SEI" error will be to find and delete the webservices.xml file and you should be good to go with JAX-WS.

For my case. this work.

  1. cd {project_path}/bin
  2. "C:\Program Files\Java\jdk1.7.0_05\bin\wsgen" -cp . com.calc.ws.Calculator -verbose -d "C:\users\mico\classes\"
  3. done.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top