Our vBulletin migration is complete.
Welcome vBulletin users! All content and user information from the Micro Focus Forums (vBulletin) site has been migrated to this site. READ MORE.
Valued Contributor.. efluid-CGI Valued Contributor..
Valued Contributor..
157 views

How can i save the request message?

Hello,

I would like to save the request message in order to verify it's content. I am currently using the message logging option but i want to be able to rename these files or save them in another location. Is there a way to achieve this?

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

Re: How can i save the request message?

File name cannot be changed, but you can change the location in the app.config

app.config default locations:

  • c:\Program Files\Micro Focus\Service Virtualization Designer\Designer\bin\VirtualServiceDesigner.exe.config
  • c:\Program Files\Micro Focus\Service Virtualization Server\Server\bin\HP.SV.StandaloneServer.exe.config

change line

<add key="MessageLogger.BaseDirectory" value="%APPDATA%\Micro Focus\Service Virtualization Designer\logs\messages" />

to whatever suites you.

---
Service Virtualization R&D
0 Likes
Highlighted
Valued Contributor.. efluid-CGI Valued Contributor..
Valued Contributor..

Re: How can i save the request message?

Thank you for your reply but it does'nt help me. I would like to change the destination folder dynamically in function of the content of the message.

0 Likes
Micro Focus Expert
Micro Focus Expert

Re: How can i save the request message?

If you are just after the payload and you don't need the protocol-level formatting, you can use a C# scripted  rule, serialize content of the message to JSON and then store it wherever you want.

 

namespace HP.SV {
    public class CSharpRule {
        public static void Execute(HpsvRootObject hpsv) {
            string request = hpsv.Request.ToJson();
            System.IO.File.WriteAllText(@"c:\temp\request01.json", request);
        }
    }
}

Complete C# API is documented here: https://svsite.github.io/doc/5.0/DotNetRuleApi

I would also recommend to upgrade to latest SV 5.0.1 version as JSON serialization function had some issues in previous versions.

 

 

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