Forum Discussion

dpeterson157's avatar
dpeterson157
Contributor
13 years ago

WebService test getting exception 404

I'm trying to set up some simple webservice tests in TestComplete. I'm still pretty new to the product but I think I set it up correctl



Under the WebServices object, I added a new item. I then clicked the Select button in the editor. I specified the URL of the WSDL, and clicked "Get Services". The drop list under "Select the tested service was populated. I selected the target service and clicked "OK".



The editor was populated with the expected list of methods and types which correctly match the targeted webservice. So I know that TC linked to the web service. See attached screenshot_1.jpg.



I then created a script module "loadManagement" and defined the following function in it:



function test_CurrentlyActivePrograms() {


var rslt = WebServices.loadManagement.currentlyActivePrograms()


}




When I execute the function, I get a "404" error, see 404.jpg. It looks like the URL being addressed does not contain the ".wsdl". If I try to access this address through my browser, it doesn't work, but in that case I get a 405 error. If I append the suffix to the address, I do see the wsdl file, see screenshot_2.jpg.



When I look examine the webservice object in the editor, in the "Service Details" section, the URL is displayed without the ".wsdl", and this appears to be the problem. I can't figure out how to edit the URL and I'm stuck trying to get this to work. What did I do wrong and how do I fix it?



Thanks,

Dave

  • Hi David,



    The WSDL file is just a description of a service, but not the service itself. It seems that you do not have access to the actual web service from your machine while the WSDL document for this service is available.



    Please contact the service's developer or system administrator to get the actual address of the web service and compare it to the address used by TestComplete (specified in the WSDL document):

    http://10.106.33.228:8080/api/soap/loadManagement







  • Hi David,



    I feel like I'm talking to myself.



    I don't understand what you mean by "It seems that you do not have access to the actual web service from your machine while the WSDL document for this service is available." I DO have access to the web service. I am able to successfully send requests and receive responses from QTP, but not from TestComplete. I opened up the TestComplete documentation for testing webservices and followed it word for word. TC was able to successfully find and identify all the Objects and Methods for the target web service and display them in the WebService editor window. I then continue following the documentation to try to execute the request, and then I get the error message. I'm confused, where did I go wrong?

  • Hi David,



    Information on types and methods is stored in the WSDL document of a service (http://10.106.33.228:8080/api/soap/loadManagement.wsdl). TestComplete can read this document for your service without problems. However, according to the error on the image you sent, TestComplete cannot get access to the service itself (http://10.106.33.228:8080/api/soap/loadManagement).



    Can you open this link (http://10.106.33.228:8080/api/soap/loadManagement) in your web browser?



    It is possible that TestComplete founds the URL of the service incorrectly. Do you know the actual URL of the tested service?



    Can you send us the WSDL document for this service so we can look into it? You can contact us privately using our Contact Support form.







  • David



    I submitted a copy of the WSDL document as you requested through the indicated support link.



    I answer to you question, no, I cannot open the link http://10.106.33.228:8080/api/soap/loadManagement in my browser, I get a 405 error, "The specified HTTP method is not allowed for the requested resource ()." I spoke to one of the developers who told me that the correct address for the webservice is http://10.106.33.228:8080/api/soap. I can't open that in the web browser either, I don't expect to.



    As near as I can understand it, when I create the WebServices object in TC, the URL being recorded is incorrect, but I don't see any way to change that.
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi David,



    > [...] I don't see any way to
    change that.

    In order to change the address, you should open the needed WebService project item in the editor (right-click it in the Project Explorer which is on the left and select Edit from the context menu). This will open the WebService item in the editor in the Workspace area on the right. Then click the Select button (top-right area of the editor), correct the address, press Get Services button and select the needed service.



    However, the fact that you cannot access web service from the browser, means that something is incorrect with the test environment setup. This may be the problem with the web service itself, permissions problem, incorrect address, etc. and the first step must be to talk to developers and/or network administrator to make it possible to access the tested web service from the browser. With correct setup (as a general rule), web service should return a page with the list of all its available methods.

  • Hi David,



    Thanks for sending the file. I will pass it to our developers in a hope of getting more information.



    Here is a quotation from the WSDL file you sent:

      <wsdl:service name="loadManagementService">

        <wsdl:port binding="tns:loadManagementPortSoap11" name="loadManagementPortSoap11">

          <soap:address location="http://10.106.33.228:8080/api/soap/loadManagement"/>

        </wsdl:port>

      </wsdl:service>


    As you can see, the WSDL file clearly shows that the address of the loadManagementService service is http://10.106.33.228:8080/api/soap/loadManagement.



    Do you have any means to check connection to the service from your machine beside TestComplete (e.g. a client application using it)?

    Can you ask your system administrator to check whether the service is installed and running on the server machine?