5

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?

Bogdan
  • 23,890
  • 3
  • 69
  • 61
Mitja Rogl
  • 894
  • 9
  • 22
  • 39

4 Answers4

5

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
Bogdan
  • 23,890
  • 3
  • 69
  • 61
  • here is my full path to the Calculator.class: "c:\users\mico\workspaceSOA\calcWS\bin\com.calc.ws.Calculator" and here is my path for generated output: "c:\users\mico\workspaceSOA\calcWS\src\com.calc.ws.jaxws" Here you have classpath, is this path to the class file or something else? I was running your line but I get error class not found "com.calc.ws.jaxws" – Mitja Rogl Nov 03 '12 at 10:35
  • what can i say about this answer , thanks but Bogdan i dont like this 3663 palindrome . – Tushar Pandey Jun 30 '13 at 12:11
  • @MitjaRogl it's good that it helped you a lot, but why not share your solution? My point is, this is a place to share knowledge, not just to help you when your in need ok? – Marco Oct 12 '17 at 08:27
  • I have tried this but still I couldn't generate the artifacts and still the same error is shown can u help me out. – Sagar Kharab May 25 '18 at 04:09
1
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...
Ravi Jain
  • 11
  • 1
  • 2
    **A service endpoint interface (SEI) is not required when building a JAX-WS endpoint.** The message is just misleading: It refers to the wsgen.exe parameter SEI (service endpoint implementation) and not the service endpoint interface (also abbreviated SEI). – Bogdan Nov 02 '12 at 21:14
0

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.

Marco
  • 2,445
  • 2
  • 25
  • 15
0

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.
Johan
  • 207
  • 4
  • 14