cancel
Showing results for 
Search instead for 
Did you mean: 

Set dynamic XML element value to a mockResponse present in external file.

SOLVED
nmrao
Community Hero

Re: Set dynamic XML element value to a mockResponse present in external file.

You really want to do that? I doubt you wouldn't. If you do so, then the file will no more have place holders and there is nothing to replace next time.


Regards,
Rao.
Apoorva6
Frequent Contributor

Re: Set dynamic XML element value to a mockResponse present in external file.

Hi Rao,

 

Yes, however, I will close this thread accepting as solution. I have bigger integration step where I need to write values to mockResponse file, then again filter the xml response back from same file. Just let me know if below scenario can be achived ? You have already provided solution for STEP1 earlier. If doable, I can open a new thread, whatever you suggest.

 

STEP1
GetBill_Request ---> Input = (MODE=SUBMITTEDORCORRECTED and ContractSolutionNumber=globalproprty)
GetBill_Response ---> Get globalproperty.xml as response

STEP2
setBill_Request   Input= ContractSolutionNumber and Account numbers (write account numbers to same file globalproperty.xml)
setBill_Response

STEP3
GetBill_Request (Mode=LITE) ContractSolutionNumber  
GetBill_Response (From same file globalproperty.xml, get the Filtered XML response)

nmrao
Community Hero

Re: Set dynamic XML element value to a mockResponse present in external file.

1. You do not even have to have different responses for each value, instead make the script dynamic. i.e., should be able to achieve with single response for each operation for that respective service.
2. There can be added all the conditions in the script dispatcher.
3. If you still have any confusions, you close this thread and start a new topic for further queries.


Regards,
Rao.
nmrao
Community Hero

Re: Set dynamic XML element value to a mockResponse present in external file.

You can find an example to read data from data base from script dispathcer in below link (point 6)
https://www.soapui.org/soap-mocking/creating-dynamic-mockservices.html


Regards,
Rao.
Apoorva6
Frequent Contributor

Re: Set dynamic XML element value to a mockResponse present in external file.

Hi Rao,
I need to know if above solution can be achieved from property expansion, I have 2 separate soap projects.
1) First project has request1 which gives response1 having account number .
2) Second project has request2 which gives response2 from an external file, and in that external file I need to give property of account number of response1 of first project. , so that in response 2 I get account number as well. Is there a way to achieve this?
New Here?
Join us and watch the welcome video:
Top Kudoed Authors