Trusted Contributor.. sunts Trusted Contributor..
Trusted Contributor..
733 views

Complex Arrays in SOAP Request

Hello, hoping someone may be able to offer some assistance with the Web Services Wizard and SOAP requests...

I am using HP OO Studio 10.70.

I've used the Web Services Wizard to create content for a web service by pointing it to the WSDL. This works fine and I'm able to consume the web services, however, I have an issue with passing arrays as an input where required.

The flow has an input parameter called 'getListValues.attributeNames.string0'

The flow uses the 'Invoke Method 2' operation to perform the call, which includes the following properties:

xmlTemplate (truncated):
   <soapenv:Body>
      <ser:getListValues>
         <attributeNames>
            <!--1 or more repetitions:-->
            <string>?</string>
         </attributeNames>
      </ser:getListValues>
   </soapenv:Body>


inputMap (truncated):
getListValues|attributeNames|*|string=^getListValues.attributeNames.string*$

usesJSON:
true

The flow has the following input:
getListValues.attributeNames.string0:


It's my understanding from the documentation that I should be able to pass a JSON array to the input and the flow will generate the SOAP request correctly. I am unable to get this working as desired and I have tried the following:

Pass in a single value:
getListValues.attributeNames.string0: = chg.category.sym - this works as expected and the API returns only the 'chg.category.sym' property from the queried object.

Pass in a single item in an array:
getListValues.attributeNames.string0: = ["chg.category.sym"] - this does not work, all fields are returned from the queried object. The RawXmlRequest result also shows the request was not created correctly.

Pass in mutlple values in an array:
getListValues.attributeNames.string0: = ["chg.category.sym","chg.status"] - this does not work, all fields are returned from the queried object. The RawXmlRequest result also shows the request was not created correctly.


Something must not be configured correctly somewhere but I'm not sure where, perhaps my understanding of the documentation is amiss?

Is anyone able to point me in the right direction and advise what I could be doing wrong?

Thanks

0 Likes
10 Replies
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: Complex Arrays in SOAP Request

0 Likes
Trusted Contributor.. sunts Trusted Contributor..
Trusted Contributor..

Re: Complex Arrays in SOAP Request

Yes, that is the documentation I referred to in my first post.
I still haven't be able to get it working but have a work around in place that uses the PowerShell Script operation. I have a call with a HP OO Technical Consultant tomorrow to try and get to the bottom of the issue.

0 Likes
Frequent Contributor.. Peter Listiak Frequent Contributor..
Frequent Contributor..

Re: Complex Arrays in SOAP Request

Do you have some news about this topic? I have same issue on HP OO 10.51. When I set usesJSON to true and put just plain string to input UpdateTsiChangeRequest.model.instance.ApprovalGroup.ApprovalGroup0, everything is OK also rawXMLRequest looks good. But when I put ["TESTSMX_CHM-APPROVER-GROUP"] into UpdateTsiChangeRequest.model.instance.ApprovalGroup.ApprovalGroup0 just following is in rawXMLRequest:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://schemas.hp.com/SM/7" xmlns:com="http://schemas.hp.com/SM/7/Common" xmlns:xm="http://www.w3.org/2005/05/xmlmime">
   <soapenv:Header />
   <soapenv:Body>
      <ns:UpdateTsiChangeRequest attachmentInfo="" attachmentData="" ignoreEmptyElements="true" updateconstraint="-1">
         <ns:model query="">
            <ns:keys query="" updatecounter="">
               <!--Optional:-->
               <ns:ChangeID type="String" mandatory="" readonly="">SIT-C000971625</ns:ChangeID>
            </ns:keys>
            <ns:instance query="" uniquequery="" recordid="" updatecounter="" />
            <!--Optional:-->
            <!--<messages />-->
         </ns:model>
      </ns:UpdateTsiChangeRequest>
   </soapenv:Body>
</soapenv:Envelope>

It looks that something wrong happen while Invoke Method 2 tries to parse json array.

0 Likes
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: Complex Arrays in SOAP Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
      <Test>         
         <!--1 or more repetitions-->
         <Name>?</Name>
         <!--1 or more repetitions-->
         <Address>?</Address>
      </Test>
   </soapenv:Body>
</soapenv:Envelope>

I did not follow on this thread at the moment.

What I remember is that the red highligthed were a must to make it work 

I extracted the sample from the specs above.

Andrei Vasile Truta
0 Likes
Frequent Contributor.. Peter Listiak Frequent Contributor..
Frequent Contributor..

Re: Complex Arrays in SOAP Request

Later in same document is this fragment of XML:

<ns:AffectedCI type="Array">
<!--Zero or more repetitions:-->
<ns:AffectedCI type="String" mandatory="" readonly=""></ns:AffectedCI>
</ns:AffectedCI>

I have same comment in my WSDL, because it is from HP SM9. I think that here is not a problem.

0 Likes
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: Complex Arrays in SOAP Request

Hi Peter,

I would suggest to open a ticket so that someone from HPE support to be able to assist you in live discussions

Andrei Vasile Truta
0 Likes
Frequent Contributor.. Peter Listiak Frequent Contributor..
Frequent Contributor..

Re: Complex Arrays in SOAP Request

I already did it. Till now, answer is that it is known error. If you want to use Json Array in Invoke Method 2, you have to not use period character "." in input name. Problem is that this "dotted" input names are generated by web service wizard. As workarround you should replace all "." with i.e. "_" and also update inputMap.

Problem is that I have many flows generated by webservice wizard (100+) and each of them has 20+ array inputs. So, I want to make script which find all inputs with "." in their name and replace "." with "_". If I have any news I will inform you.

 

 

0 Likes
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: Complex Arrays in SOAP Request

Thank you Peter for the update.

I was not personally aware about this. 

Andrei

Andrei Vasile Truta
0 Likes
Frequent Contributor.. Peter Listiak Frequent Contributor..
Frequent Contributor..

Re: Complex Arrays in SOAP Request

Hi everybody.

   So, I got fixed version of Invoke Method 2, but it is unofficial and I don't know when Microfocus will release fixed version of base content pack. So here is simple script which makes workarround for you - https://gist.github.com/plistiak/8352dda160e481fb13d27fd2ed9918af

0 Likes
Bridges Respected Contributor.
Respected Contributor.

Re: Complex Arrays in SOAP Request

I opened a case with HP back in Aug 2016 related to the useJSON.  Here is a link the KM that was opened based on the case.

https://softwaresupport.hpe.com/group/softwaresupport/search-result/-/facetsearch/document/KM02888871

There was a hotfix provided, but I'm been waiting for it to come out in a release.

 

 

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.