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:
<!--1 or more repetitions:-->
The flow has the following input:
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?
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.
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">
<ns:UpdateTsiChangeRequest attachmentInfo="" attachmentData="" ignoreEmptyElements="true" updateconstraint="-1">
<ns:keys query="" updatecounter="">
<ns:ChangeID type="String" mandatory="" readonly="">SIT-C000971625</ns:ChangeID>
<ns:instance query="" uniquequery="" recordid="" updatecounter="" />
It looks that something wrong happen while Invoke Method 2 tries to parse json array.
<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.
Later in same document is this fragment of XML:
<!--Zero or more repetitions:-->
<ns:AffectedCI type="String" mandatory="" readonly=""></ns:AffectedCI>
I have same comment in my WSDL, because it is from HP SM9. I think that here is not a problem.
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.
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
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.
There was a hotfix provided, but I'm been waiting for it to come out in a release.