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
EV Contributor.
Contributor.
278 views

hpsv.request as string?

Hi, in the incoming xml message there is a line of the form: <myParam xmlns: xsi = "......" atribute1 = "valueOfAtribute1" xsi:type = "value2">, value2 changes depending on the message. How can I get this value into a string variable?

i try convert hpsv.request to string and use regexp, but it don't work (.

0 Likes
3 Replies
Jakub Honored Contributor.
Honored Contributor.

Re: hpsv.request as string?

Almost all attributes and values from the xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" namespace are discarded from a data model. One exception is when you have created the virtual service from XML Schema and that schema defined multiple types for a certain complex node (primitive types are not supported). Than we'll store and present the value of that type in the data model (there will be a combo box).

Can you please describe in more detail what you need to do and post a complete messages?

---
Service Virtualization R&D
0 Likes
EV Contributor.
Contributor.

Re: hpsv.request as string?

For example, I have two XML messages, the difference between them in "xsi : type":

I need to get the value from the attribute "xsi : type", how to do it? HP SV not learning this attribute

Example file in attach.

0 Likes
Jakub Honored Contributor.
Honored Contributor.

Re: hpsv.request as string?

This one is tricky.

Your examples looks like SOAP, but they are not valid SOAP. I had to fix following issues:

For the xsi:type selector to appear in the Data Model editor, you need to create the virtual service based on the WSDL or XSD, which would have proper type inheritance in XML Schema (a base type from which the types load, upLoad in your messages will inherint). I have constructed such sample WSDL and is attached.

After creation of VS from such WSDL and importing your messages, I can see such selector. Screenshot and SV 4.20 project attached.

---
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.