0

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:

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

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

  1. 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?
  2. 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);
    }

}
user1211530
  • 116
  • 8
  • Can you provide a link to the tutorial you're following? Did you already generate the WSDL or are you generating the WSDL during deployment? – Hobert Bush III Jun 27 '16 at 18:04
  • The tutorial is on a paid site, unfortunately for this. Perhaps, some explanation into the creation of things could help: The working EAR, which included a separate WAR,deploy and function, no problem. I created a new dynamic web project, then in that project, in the Java Resources "src" folder, I created the code you see above - ctrl-shift-o'd the imports, including a binding to my datasource in the binding file, and deployed. No luck. Exported the same EAR, now with the webService WAR as well, and installed via the admin console - selected deploy web services - and it worked. – user1211530 Jun 27 '16 at 18:16
  • I'm also unclear on what a WSDL is/does, I don't know if it is deployed or exists, however - within my Project I have the following structure: Java Resources || Services || JavaScript Resources || WebRoot . Under **Services** I have 1 listing: {http://soap.service.web.listmanager.pluralsight.com/}UserSoapService. Clicking on it takes me to my class, in the code above – user1211530 Jun 27 '16 at 18:24
  • Edit (for WSDL): This link was useful: http://stackoverflow.com/questions/5890438/what-is-the-difference-between-a-top-down-web-service-and-a-bottom-up-web-servic – user1211530 Jun 27 '16 at 18:36

0 Answers0