moldin Absent Member.
Absent Member.
559 views

Reformat Response into Instance

On subscriber Matching I send the following request:
<nds dtdversion="4.0" ndsversion="8.x">
<source>
<product edition="Advanced" version="4.5.5.0">DirXML</product>
<contact>NetIQ Corporation</contact>
</source>
<input>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:syn="http://www.synchronicer.dk">
<soap-env:Body>
<syn:userGet password="xxxxxxxx" requestId="" user="user" userCommonID="ACHRI"/>
<operation-data soap-action="userGet"/>
</soap-env:Body>
</soap-env:Envelope>
</input>
</nds>


On itp I get this response (after removing SOAP header and body):
<nds dtdversion="2.0">
<source>
<product build="20141001_0707" instance="SOAPSynchronicer" version="4.0.0.2">Identity Manager Driver for SOAP</product>
<contact>NetIQ Corporation</contact>
</source>
<output>
<userGetResponse status="success" xmlns="http://www.synchronicer.dk" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<user userCommonID="ACHRI" userMail="n/a" userInitials="ACHRI" userLanguage=DAN" userLogonName="ACHRI" userName="Anna Christiansen" userSalaryID="1234">
<roles/>
<request>
<syn:userGet password="xxxxxxxx" requestId="" user="user" userCommonID="ACHRI"/> xmlns:syn="http://www.synchronicer.dk"/>
</request>
</userGetResponse>
<operation-data soap-action="userGet" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/>
</output>
</nds>


I am trying to reformat the response into an instance that can will be returned to the matching policy.
Any ideas on how to do that?
Labels (1)
0 Likes
5 Replies
Knowledge Partner
Knowledge Partner

Re: Reformat Response into Instance

On 12/13/2018 8:24 AM, moldin wrote:
>
> On subscriber Matching I send the following request:
>
> Code:
> --------------------
> <nds dtdversion="4.0" ndsversion="8.x">
> <source>
> <product edition="Advanced" version="4.5.5.0">DirXML</product>
> <contact>NetIQ Corporation</contact>
> </source>
> <input>
> <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:syn="http://www.synchronicer.dk">
> <soap-env:Body>
> <syn:userGet password="xxxxxxxx" requestId="" user="user" userCommonID="ACHRI"/>
> <operation-data soap-action="userGet"/>
> </soap-env:Body>
> </soap-env:Envelope>
> </input>
> </nds>
> --------------------
>
>
> On itp I get this response (after removing SOAP header and body):
>
> Code:
> --------------------
> <nds dtdversion="2.0">
> <source>
> <product build="20141001_0707" instance="SOAPSynchronicer" version="4.0.0.2">Identity Manager Driver for SOAP</product>
> <contact>NetIQ Corporation</contact>
> </source>
> <output>
> <userGetResponse status="success" xmlns="http://www.synchronicer.dk" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
> <user userCommonID="ACHRI" userMail="n/a" userInitials="ACHRI" userLanguage=DAN" userLogonName="ACHRI" userName="Anna Christiansen" userSalaryID="1234">
> <roles/>
> <request>
> <syn:userGet password="xxxxxxxx" requestId="" user="user" userCommonID="ACHRI"/> xmlns:syn="http://www.synchronicer.dk"/>
> </request>
> </userGetResponse>
> <operation-data soap-action="userGet" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/>
> </output>
> </nds>
> --------------------
>
>
> I am trying to reformat the response into an instance that can will be
> returned to the matching policy.
> Any ideas on how to do that?


There was someone else in the forum doing a SOAP driver and I suggested
you read my attempt to do all this in Policy n this series of articles.
I knonw teh answer you need is in there, and I do not feel like retyping
it. 🙂

If it was you, and you did not find it, let me know and I shall.

https://www.netiq.com/communities/cool-solutions/getting-started-building-soap-driver-idm-part-1/
https://www.netiq.com/communities/cool-solutions/getting-started-building-soap-driver-idm-part-2/
http://www.novell.com/communities/node/11810/getting-started-building-soap-driver-idm-part-3
http://www.novell.com/communities/node/11850/getting-started-building-soap-driver-idm-part-4
http://www.novell.com/communities/node/11982/starting-soap-driver-idm-part-5
http://www.novell.com/communities/node/12022/getting-started-building-soap-driver-idm-part-6
http://www.novell.com/communities/node/12052/getting-started-building-soap-driver-idm-part-7
http://www.novell.com/communities/node/12138/getting-started-building-soap-driver-idm-part-8
http://www.novell.com/communities/node/12144/getting-started-building-soap-driver-idm-part-9


0 Likes
moldin Absent Member.
Absent Member.

Re: Reformat Response into Instance

I went through those but perhaps somewhat lightly 🙂
I will read them more thorough to find the answer.

Thank you.
0 Likes
Knowledge Partner
Knowledge Partner

Re: Reformat Response into Instance

On 12/14/2018 1:54 AM, moldin wrote:
>
> I went through those but perhaps somewhat lightly 🙂
> I will read them more thorough to find the answer.


I do not object to answering, but there is an expectation of some
homework on your part.

The short version thatw ill get you moving is that the node under the
<input> or <output> is actually the operation, and XPATH current context
so evenn if it is not add/modify/delete you can test for
If Operation = userGetResponse

Then XPATH of @status will simply work.

Then you can append XML Element of instance to ..
Then set XML attribute of level=success to ../instance[last()]

and so on.


0 Likes
moldin Absent Member.
Absent Member.

Re: Reformat Response into Instance

geoffc;2492580 wrote:
On 12/14/2018 1:54 AM, moldin wrote:
>
> I went through those but perhaps somewhat lightly 🙂
> I will read them more thorough to find the answer.


I do not object to answering, but there is an expectation of some
homework on your part.

The short version thatw ill get you moving is that the node under the
<input> or <output> is actually the operation, and XPATH current context
so evenn if it is not add/modify/delete you can test for
If Operation = userGetResponse

Then XPATH of @status will simply work.

Then you can append XML Element of instance to ..
Then set XML attribute of level=success to ../instance[last()]

and so on.


I have done my home work now. And it is quite embarrassing as the thinks I was looking for was in part 1 of the series.
It is kind of working now. I get the instance back and the object gets an association, but to set an association value I have added the add-association after the instance.
I would think that this should not be necessary but for now it works.
0 Likes
Knowledge Partner
Knowledge Partner

Re: Reformat Response into Instance


> I have done my home work now. And it is quite embarrassing as the thinks
> I was looking for was in part 1 of the series.


Shame! And if it is in part one, you cannot even use Lothar's mockery
of my verbosity as your excuse.

But good, I was pretty confident it was in there, I wrote it like 8
years ago now, so I do not remember the details, and would probably
re-read it myself to refresh. But I know the concepts.

Glad to hear it helped


> It is kind of working now. I get the instance back and the object gets
> an association, but to set an association value I have added the
> add-association after the instance.
> I would think that this should not be necessary but for now it works.


You can append the XML or you can use the add-assocation token at that
point.

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.