1

I am trying to build Web-Service.

WS interface

@WebService
public interface StreamWS {
    public void addLog(String description, String param1, String param2, String param3, String param4,
            String comment);
}

WS impl

@WebService(endpointInterface = "package.StreamWS")
public class StreamWSImpl implements StreamWS {

@Autowired
private LogDAO logDAO;

@Override
public void addLog(String description, String param1, String param2, String param3, String param4,
        String comment) {
    Log log = new Log();
    log.setDescription(description);
    log.setParam1(param1);
    log.setParam2(param2);
    log.setParam3(param3);
    log.setParam4(param4);
    log.setComment(comment);
    log.setTime();
    logDAO.insertOrUpdate(log);
}

}

ws.xml

<?xml version="1.0"?>
<beans
    xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://jax-ws.dev.java.net/spring/core http://jax-ws.dev.java.net/spring/core.xsd http://jax-ws.dev.java.net/spring/servlet http://jax-ws.dev.java.net/spring/servlet.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
    xmlns:wss="http://jax-ws.dev.java.net/spring/servlet" xmlns:ws="http://jax-ws.dev.java.net/spring/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.springframework.org/schema/beans">


    <wss:binding url="/webservices/streamWS">
        <wss:service>
            <ws:service bean="#streamWS" />
        </wss:service>
    </wss:binding>

    <bean class="package.StreamWSImpl" id="streamWS" />

</beans>

I am getting the following error:

Caused by: com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class package.jaxws.AddLog is not found. Have you run APT to generate them?
user123454321
  • 1,028
  • 8
  • 26

1 Answers1

2

You probably just need to generate the WS artefacts to make it work.

Try to run that command in the target/classes/ directory :

wsgen -keep -cp your.package.StreamWSImpl

Check the documentation.

Jean-Philippe Bond
  • 10,089
  • 3
  • 34
  • 60