Samaadan Super Contributor.
Super Contributor.
184 views

Pass an XML tag as a variable value to the Invoke Method 2

Got a need to pass the XML tag as input to Invoke Method 2, The XML tags "<" and ">" are getting converted into &lt; and &gt; which the webservice is not able to handle. Looking for some suggestions on how i can approch this. 

 

#########################################################

XML Template:

#########################################################

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://configuration.api.sitescope.mercury.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

   <soapenv:Header/>

   <soapenv:Body>

      <con:disableAssociatedAlerts soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

         <in0 xsi:type="con:ArrayOf_xsd_string" soapenc:arrayType="xsd:string[]">?</in0>

         <in1 xsi:type="xsd:string">?</in1>

         <in2 xsi:type="xsd:string">?</in2>

         <in3 xsi:type="xsd:string">?</in3>

         <in4 xsi:type="xsd:string">?</in4>

         <in5 xsi:type="xsd:string">?</in5>

         <in6 xsi:type="xsd:string">?</in6>

      </con:disableAssociatedAlerts>

   </soapenv:Body>

</soapenv:Envelope>

#########################################################

 

#########################################################

inputMap

#########################################################

disableAssociatedAlerts|in0=disableAssociatedAlerts.in0

disableAssociatedAlerts|in1=disableAssociatedAlerts.in1

disableAssociatedAlerts|in2=disableAssociatedAlerts.in2

disableAssociatedAlerts|in3=disableAssociatedAlerts.in3

disableAssociatedAlerts|in4=disableAssociatedAlerts.in4

disableAssociatedAlerts|in5=disableAssociatedAlerts.in5

disableAssociatedAlerts|in6=disableAssociatedAlerts.in6

#########################################################

 

#########################################################

Format in which the Webservcie is expecting the data

#########################################################

         <in0 xsi:type="con:ArrayOf_xsd_string" soapenc:arrayType="xsd:string[]">

                                <item xsi:type="xsd:string">Value 1</item>

                                <item xsi:type="xsd:string">Value 2</item>

         </in0>

         <in1 xsi:type="xsd:string">0</in1>

         <in2 xsi:type="xsd:string">1</in2>

         <in3 xsi:type="xsd:string">This is a test</in3>

         <in4 xsi:type="xsd:string">userid</in4>

         <in5 xsi:type="xsd:string">password</in5>

         <in6 xsi:type="xsd:string">Id</in6>

#########################################################

The array value is the folder path, so the number of items could vary from one webservice request to an another, modifying the input map dosent seem to be an option.

 

Tried to do with the HTTP Client Post Raw, but seem to fail, not sure how i can see the actual request that OO is sending to the webservice, The HTTP Client Post Raw dosent have the "returnXMLRequest" variable. Any suggestion would be helpful.

Labels (1)
0 Likes
4 Replies
Absent Member.. Sussan_Z_OO Absent Member..
Absent Member..

Re: Pass an XML tag as a variable value to the Invoke Method 2

Hello Samaadan,

Thank you for contacting us.

 

Regarding your request to pass the XML tag as input to Invoke Method 2, so in order to start with my research, could you please confirm me the following information:

 

  1. HPOO Version
  2. Is the first time that it happens.
  3. Did you receive any error message?

Waiting your answer,

Best Regards,

“Regards,
If you find this or any post useful to resolve the issue, please mark this thread as correct answer and other members can benefit with the information given
Sussan Zamora
SW Support Technical Consultant
San Jose, Costa Rica
hpe.com
Hewlett Packard Enterprise “
0 Likes
Samaadan Super Contributor.
Super Contributor.

Re: Pass an XML tag as a variable value to the Invoke Method 2

Susan,

 1. OO Version is 10.22

 2. No, this is the actual behaviour of the Oprtaion, OO treats the supplied value as a string and decodes the xml tags "<" into &lt; and &gt;, since the "<" and "<" are reserved chars in xml,

 3. Couldnt find a way to change the behaviour or OO on how it treats the value. Since it is an array i cant modify the input map or the template (Theroitically i can, but would be ugly since i have to create seperate opertions for handling the dynamic nature of the xml tag, example, have to create a opreation that takes 2 values and a seperate operation that takes 3 values and so on)

 4. solved it buy using the HTTP Client Post Raw Oprtaion. Which seemed to be a viable solution for now.

 5. Would be nice if we can have a override in the variables for convertion, so in cases like this we can use the override so that the values are not getting treated as string instead of an xml tag.

 

0 Likes
Absent Member.. Sussan_Z_OO Absent Member..
Absent Member..

Re: Pass an XML tag as a variable value to the Invoke Method 2

Hello Samadaan,

Thank you for  provide  me the information, so please let me to research and consult with my OO Team, when I have an answer I will back to you with an update.

 

Thank you & Regards,

“Regards,
If you find this or any post useful to resolve the issue, please mark this thread as correct answer and other members can benefit with the information given
Sussan Zamora
SW Support Technical Consultant
San Jose, Costa Rica
hpe.com
Hewlett Packard Enterprise “
0 Likes
Absent Member.. Sussan_Z_OO Absent Member..
Absent Member..

Re: Pass an XML tag as a variable value to the Invoke Method 2

Hello Samadaan,

 

Please take a look the following suggestion:

 

Try using the READ file operation to read an XML, and then add a result assigned to a variable, then use the variable in the XML invoke method 2 to see if it works.

 

I hope this information helps you,

Best Regards,

“Regards,
If you find this or any post useful to resolve the issue, please mark this thread as correct answer and other members can benefit with the information given
Sussan Zamora
SW Support Technical Consultant
San Jose, Costa Rica
hpe.com
Hewlett Packard Enterprise “
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.