facebook

[Closed] Standalone Client and Web Service Explorer

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #266959 Reply

    Russ
    Member

    I have a simple web service which I built from the top-down approach using an existing WSDL. I am using Version: 5.1.0 GA Build id: 20061111-5.1.0-GA for MyEclipse. I am able to build the application, deploy it, and run it with a simple client I have created. When I try the same service using the Web Service Explorer within MyEclipse I am getting a http 404 error. When I go looking for the WSDL within my browser, the server displays the WSDL without a problem.

    This is the code I have working that is hitting the web service:

    
     public String callWebService(String userId, String taskId) 
           throws MalformedURLException, Exception {
           
           //Create a metadata of the service      
           Service serviceModel = new ObjectServiceFactory().create(WebServiceBean.class);        
           System.out.println("callSoapServiceLocal(): got service model." );
      
           //Create a proxy for the deployed service
           XFire xfire = XFireFactory.newInstance().getXFire();
           XFireProxyFactory factory = new XFireProxyFactory(xfire);      
       
           String serviceUrl = "http://localhost:8080/MyWebService/services/TheWebService";
           
           
           WebServiceBean client = null;
           try {
               client = (WebServiceBean) factory.create(serviceModel, serviceUrl);
           } catch (MalformedURLException e) {
               System.err.println("WsClient.callWebService(): EXCEPTION: " + e.toString());
           }    
                  
           //Invoke the service
           String serviceResponse = "";
           try { 
               serviceResponse = client.getTaskDetails("userId","blah blah");
          } catch (Exception e){
               System.err.println("WsClient.callWebService(): EXCEPTION: " + e.toString());                 
               serviceResponse = e.toString();
           }        
           System.out.println("WsClient.callWebService(): status=" + serviceResponse);              
           //Return the response
           return serviceResponse;
       }   
    

    Any suggestions guys?

    Thanks as always for your suggestions!

    Russ

    #266962 Reply

    Brian Fernandes
    Moderator

    Russ,

    Quick question, does the WS Explorer show up at all and 404 only when you attempt to connect to your web service? Or do you see a 404 error the moment you open the WS Explorer?
    What URL do you type into the WS Explorer and on what page?

    #266968 Reply

    Russ
    Member

    Sorry, I did not say it explicitly… but the 404 shows up when I try to run the service by calling the same method..

    I am finding the WSDL and calling the specific method on the web service. I am passing the same parameters as I do in the client code.

    #266973 Reply

    Russ
    Member

    I wanted to test this to be sure….so the results are the same…..

    When I cal from the client you can see the URL is

    
    "http://localhost:8080/MyWebService/services/TheWebService";
    

    When I call from the Web Service Explorer the URL is:

    
    http://localhost:8080/MyWebService/services/TheWebServiceBean";
    

    I was thinking the problem could be just a simple name change, so I tested that too.

    
    http://localhost:8080/MyWebService/services/TheWebService";
    

    The above URL was added as an authorized endpoint. In either case, the Web Service Explorer was returning a http 404 error for both URLs.

    When I go look at the services file, the name was

    
    TheWebService
    

    When I go look at the JSR 181 annotations for the declaration for the web service, I see

    
    TheWebServiceBean
    

    Russ

    #267766 Reply

    nvenkatarao
    Member

    I think you are not pointing to the exactly where service is configured….like
    http://localhost:8080/MyWebService/services/TheWebServiceBean check this url once “TheWebServiceBean” this should match with your service.xml file configured service name…..check once…

    #267847 Reply

    Russ
    Member

    The problem was the services.xml did not have the correct style/use combination.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: [Closed] Standalone Client and Web Service Explorer

You must be logged in to post in the forum log in