Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Jguar
Member.
842 views

How can i get more than one response for the same request

Hello,

I am trying to create the data model of a Virtualized Server. With the same request i want to have more than one response at the same time. For example:

With the same input field: 

<type>1</type>

I want to have the response: 

<info>

<shortName>MA</shortName>
<code>Test</code>

</info>

<info>

<shortName>MB</shortName>
<code>Test2</code>

</info>

I tried creating two rows in the same rule with the same request but it doesnt work (it always response the output of the first row added). Is there any way to have more than one response for the same request?

Thank you so much

 

EDIT: to be clear, what i'm trying is: In a service that response the telephone number(response) for a person (request) i want to have all the phone numbers for the same person and i cant find the way to get more than 1 with only one request.

0 Likes
3 Replies
Michaelhpe Valued Contributor.
Valued Contributor.

Re: How can i get more than one response for the same request

Hi,

which protocol did you use?

Michael

0 Likes
Jguar
Member.

Re: How can i get more than one response for the same request

Hello,

It was on SOAP but it is already solved.

The problem was when i virtualized the service I got problems with the attributes minOccurs and maxOccurs. So i deleted all this attributes from the wsdl and I could virtualize it. Because of that, in the data model, it was imposible to introduce data in arrays so i had to modify the service description manually to introduce again the attribute maxOccurs="unbounded" in the response where I needed an array. With that i could introduce multiple responses to the same request. 

What i don't know is why i can't virtualize a wsdl with that attributes (because i get an error creating it) but i can modify the description of the virtualized server to add the attributes after creating it. 

 

 

 

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: How can i get more than one response for the same request

Hi Jguar,

minOccurs and maxOccurs attributes in a XML Schema define how many times an element can be present in the message. SV uses this information to either create an array or a single item.

This will be treated as a single item:

minOccurs="0" maxOccurs="1"
minOccurs="1" maxOccurs="1" (this is as well a default when you don't specify these attributes)

This will be treated as an array:

minOccurs="0" maxOccurs="2" 
minOccurs="0" maxOccurs="unbounded"

You should not be getting errors creating a virtual service based on any WSDL. If you still have a broken one, please post it here or send it to me in a private message and we'll look into it.

---
Service Virtualization R&D
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.