Forum Discussion

alvarogrm's avatar
alvarogrm
New Contributor
7 years ago

How to set http-headrar before a wsdl-definition is retrieved

Hi,

I have a problem, I need to retrieve a wsdl-definition with an url-address i order to create a SOAP-project, eg.

https://[maskin]:8443/my/webservice/test?wsdl

 

the problem is that I need to set a couple of HTTP-headrar that contains a "ticket" in order to grant access to the server. I cannot find a way to do this in SOAP-ui, you can set HTTP-headrar in restrospect, but I need to sett the http-headrar before I can retrieve the wsdl-definition. 

 

It should be a solution to this.

BR Alvaro

  • TNeuschwanger's avatar
    TNeuschwanger
    Champion Level 1

    Hello,

     

    My best understanding of question is how to set a header...

     

    In some groovy script that sets property values in a "Properties" named test step, set the desired header content:

       def xrequestid = UUID.randomUUID().toString();
       testRunner.testCase.testSteps["Properties"].setPropertyValue( "x-request-id-value-str", xrequestid);

       def xclientType = 'admin';
       testRunner.testCase.testSteps["Properties"].setPropertyValue( "x-client-type-value-str", xclientType);

     

    In headers tab of the request, define Header column value of what is actually needed for the request.  In the Value column of the tab, use property expansion to set it to what is contained in the "Properties" named test step...  

     

    Header             |      Value

    ----------             |     ----------

    x-request-id      |     ${Properties#x-request-id-value-str}

    x-client-type      |     ${Properties#x-client-type-value-str}

     

    I hope I interpreted your question as you meant it.  :)

    • Olga_T's avatar
      Olga_T
      SmartBear Alumni (Retired)

      Hi all,

       

      TNeuschwanger, thank you for your time looking into this, I sincerely appreciate the assistance.

      alvarogrm, have you had a chance to check the solution on your side? Does this work for you?

       

      • alvarogrm's avatar
        alvarogrm
        New Contributor

        Hi,

         

        I havn't had the time, but our test-expert is going to try out the solution, I still appreciate the effort you made in order to help us/me.

        BR Alvaro

  • Olga_T's avatar
    Olga_T
    SmartBear Alumni (Retired)

    Hi alvarogrm,

    Thanks for reaching out.

     

    Community, has anyone faced a similar task? Can you please assist?