Forum Discussion

arupacharya1784's avatar
arupacharya1784
Occasional Contributor
9 years ago

How to remove auto populated fields in SOAPUI Pro request?

Hi,

My request always comes with auto populated fields after I save.

For example. If I execute the below request, it works fine.

<abc>000012</abc>

Once I save, close & reopen the Test Step again, it comes like this

<123/><456/><789/><abc>000012</abc>

So the Step fails with errors.

I checked the WSDL. Fields 123, 456 & 789, like mentioned above, have MinOccurs=1 but Dev team are saying these are not mandatory fields & they can’t change schematics of the services.

Please suggest how best to manage this scenario. I am using SOAPUI Pro 5.1.0.

  • Radford's avatar
    Radford
    9 years ago

    Are you using the "Form" view of the request editor? As I can replicate the behaviour you describe by deleteing data from the "XML" view, switching to the "Form" view and then when going back to the "XML" view and elements with minOccurs=1 are recreated

     

    My guess (and this is a guess) is that when going from the "Form" view to the "XML" view, Ready API has to recreate the XML, thus all it can use to do that is the WSDL contract, thus if the contract states minOccurs=1 then it will add the element. Perhaps somebody from SmartBear can confirm?

     

    Fundamentally though if you have minOccurs=1 it is mandatory, regardless what somebody may say. Saying that, if your problem is caused by the "Form" view as described above, you can set the default SOAP request editor in the preferences to "Source" and never switch to the "Form", though to be honest I would only see this as a very temporary work around as simply switching to the Form view (a very common thing) will break your tests.

  • nmrao's avatar
    nmrao
    Champion Level 3
    Not sure if the problem is understand. Would you please show the problem using a screen shot?
    • arupacharya1784's avatar
      arupacharya1784
      Occasional Contributor

      Below is my Test Step (Request).

       

      <soapenv:Envelope>
      <soapenv:Header/>
      <soapenv:Body>
      <xyz>
      <Amount>50000</Amount>
      </xyz>
      </soapenv:Body>
      </soapenv:Envelope>

       

      It gives proper response. Then I save the project, close the Test Step & reopen again. Below is the Request.

       

      <soapenv:Envelope>
      <soapenv:Header/>
      <soapenv:Body> 
      <xyz>
      <Amount>50000</Amount>

      <Amount1/>

      <Amount2/>

      <Amount3/>
      </xyz>
      </soapenv:Body>
      </soapenv:Envelope>

       

      Because of new tags like <Amount1/>, <Amount2/> & <Amount3/>, which gets auto populated every time, the Test Step fails this time. Ideally only <Amount> should come in the Request like I saved earlier.

       

      WSDL has <Amount1>, <Amount2> & <Amount3> tags as MinOccurs=1 but Dev team are saying these are not mandatory fields.

       

      I want only <Amount> to come in the request all the time.

      • Radford's avatar
        Radford
        Super Contributor

        Are you using the "Form" view of the request editor? As I can replicate the behaviour you describe by deleteing data from the "XML" view, switching to the "Form" view and then when going back to the "XML" view and elements with minOccurs=1 are recreated

         

        My guess (and this is a guess) is that when going from the "Form" view to the "XML" view, Ready API has to recreate the XML, thus all it can use to do that is the WSDL contract, thus if the contract states minOccurs=1 then it will add the element. Perhaps somebody from SmartBear can confirm?

         

        Fundamentally though if you have minOccurs=1 it is mandatory, regardless what somebody may say. Saying that, if your problem is caused by the "Form" view as described above, you can set the default SOAP request editor in the preferences to "Source" and never switch to the "Form", though to be honest I would only see this as a very temporary work around as simply switching to the Form view (a very common thing) will break your tests.