Forum Discussion

pravin_k99's avatar
pravin_k99
Contributor
14 years ago

How to post a SOAP File and run the Web Service?

Hello There,



I have manually prepared the full SOAP XML file with all attributes required for the request populated for a webservice method and I want to post it and run the web service.



Can somebody provide me with a VB script for the same?



My wsdl is sitting at http://localhost:8080/calibre/batchservice.wsdl?



Thanks

Pravin

5 Replies

  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    Hi Pravin,



    I would recommend to examine the WebService Testing Sample project (that can be found in the <All Users>\Documents\TestComplete 8 Samples\Web Service Testing\Functional Testing\ folder).

    Also Testing Web Services help topic may be useful as well.
  • Hello Alex



    Thanks for the reply. I had a look at the project and all tests mentioned in the sample talk about preparing the SOAP request or sending a simple webservice with 4-5 attributes under the same node.



    In my case I have a webservice which has around 20 nodes and each of them have 4-5 children. So I cant prepare the SOAP and rather want to post an already created SOAP file and sample projects dont have any such example.



    Can you please atleast send me the function which posts an XML file directly



    I am guessing

    - Read the full file first

    - Post it using some function



    Thanks

    Pravin
  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    Hi Pravin,



    To say the truth, I'm absolutely lost what nodes, their children and file sending you are talking about...

    Could you describe in more details what you need to do (WSDL or screenshot of sample function provided by your web service might help)? This might help others to provide you with some piece of advise.
  • Hey Alex,



    For example I need to post the attached SOAP XML file to http://localhost:8080/test/clientservice.wsdl?



    How do I ?



    Thanks

    Pravin
  • AlexKaras's avatar
    AlexKaras
    Icon for Champion Level 1 rankChampion Level 1
    Hi
    Pravin,



    > For example I need to post the attached SOAP XML file to http://localhost:8080/test/clientservice.wsdl?

    A side note first: I hope that the address mentioned above is correct despite the fact that it looks a bit unusual. I would expect either http://localhost:8080/test/clientservice?wsdl or something like http://localhost:8080/test/clientservice.svc, but I will assume that the above address is correct.

    Another side note: if the request to the provided address returns wsdl, then I have to say that posting the file to it is useless as the posted file will not be processed.



    It looks like that you are trying to test web service. If my guess is correct, I think that you should read web services-related section of TestComplete documentation starting from http://support.smartbear.com/viewarticle/26970/.



    The sample of how to create and post a request to web service via script can be found here: http://support.smartbear.com/viewarticle/29074/.



    Does this help?