Intro: following a tutorial for EE project setup, currently am able to generate an XHTML with JSF2.0, utilize some ManagedBeans, have some DataAccess Objects and Service implementations.
Current Topic: tutorial has a SOAP JAX-WS section for creating a simple WebService
Issue:
- Deploying via Eclipse Keplar's servers tab to my WAS 8.5 server results in 404|fileNotFound exception in browser, no console errors. (Seems the web service isn't working.)
This link: http://localhost:9080/ListManagerWebServices/UserSoapService?wsdl
Provides this result:
Error 404: java.io.FileNotFoundException: SRVE0190E: File not found: /UserSoapService
- Deploying via WAS's admin console under New Application and triggering the "Deploy WebServices" does work
This link: http://localhost:9080/ListManagerWebServices/UserSoapService?wsdl
Provides this results:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
- Why do the web services not fire when I deploy in the servers tab, but do when I explicitly enable it from the admin console?
- How can I enable the web services to fire after the deployment to the server from the servers tab?
UserSoapService.java
package com.pluralsight.listmanager.web.service.soap;
import java.util.List;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import org.pluralsite.listmanager.model.ListItem;
import org.pluralsite.listmanager.model.User;
import org.pluralsite.listmanager.service.UserService;
import org.pluralsite.listmanager.service.impl.UserServiceImpl;
@WebService(serviceName="UserSoapService")
public class UserSoapService {
private final UserService userService;
public UserSoapService() {
this.userService = new UserServiceImpl();
}
@WebMethod
public Long getUserId(@WebParam(name="username") String username) {
User user = userService.authenticateUser(username);
if (user != null) {
return user.getId();
}
return null;
}
@WebMethod
public List<ListItem> getUserListItems(@WebParam(name="userId") Long userId) {
return userService.getListItems(userId);
}
}