Hello all,

I've been reading up on Geoffc's writeup on the SOAP driver (article
http://tinyurl.com/p7swl5j )

I started out as he has described, getting the login part ( as discussed
in part 2 of the series)

So, i have my SOAP responce to a login:


<SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:HNS="http://tempuri.org/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<HNS:ROClientID SOAP-ENV:mustUnderstand="0">{Unique code is here}</HNS:ROClientID>
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ro="urn:MediusServer_Soap">
<NS1:LoginResponse xmlns:NS1="urn:MediusServer_Soap">
<Result xsi:type="xsd:boolean">true</Result>
<ResultMessage xsi:type="xsd:string"/>
<SessionToken xsi:type="xsd:string">Unique String/code is also here</SessionToken>


Now i do not have direct access to the source itself, so i ran this
whilst able to and saved the responce for 'local'/offsite development.
In following the article i started building up my policies, crafting
them to the given responce from my SOAP server/source

In building it up i used the policy simulator to verify my policy and
its behaviour ..
And this is where i'm getting strange results :

here's whats happening :

1. i fire up policy simulator
2. switch to tab 'Source' to paste in the original SOAP responce i
3. Now if i would click next the whole simulation wouldnt run and i get
a straightforward output as the input is ... this is odd behaviour #1
4. So i then pasted in the code and switched back to the other tab - XDS
Builder - when i do that it will spawn a message of my source not being
'valid XDS'.. understandable, as its not yet converted ( that is what
i'm trying to achieve here), so i click Yes to ignore the warning and
still go ahead with the simulation
5. i set the operation to Instance, as thats what i'm trying to get out
of this.
6. On clicking next the policy output nw really shows me its being
7. the result is unexpected , a 2nd 'instance' has appeared, and no attr
is in the document ?

Here's the trace :


SOAP Driver :Applying policy: %+C%14Cpub-itp-LoginResponce%-C.
SOAP Driver : Applying to instance #1.
SOAP Driver : Evaluating selection criteria for rule 'ConvertLoginResponce'.
SOAP Driver : Rule selected.
SOAP Driver : Applying rule 'ConvertLoginResponce'.
SOAP Driver : Action: do-append-xml-element("instance","..").
SOAP Driver : Action: do-set-xml-attr("class-name","../instance","login").
SOAP Driver : arg-string("login")
SOAP Driver : token-text("login")
SOAP Driver : Arg Value: "login".
SOAP Driver : Action: do-set-xml-attr("src-dn","../instance","magister").
SOAP Driver : arg-string("magister")
SOAP Driver : token-text("magister")
SOAP Driver : Arg Value: "magister".
SOAP Driver : Action: do-set-xml-attr("attr-name","../instance/attr[last()]","SessionToken").
SOAP Driver : arg-string("SessionToken")
SOAP Driver : token-text("SessionToken")
SOAP Driver : Arg Value: "SessionToken".
SOAP Driver : Action: do-append-xml-element("value","../instance/attr[@attr-name='SessionToken']").
SOAP Driver : Action: do-append-xml-text("../instance[@class-name="login"]/attr[@attr-name="SessionToken"]/value",token-xpath("*//*[local-name()='SessionToken']/text()")).
SOAP Driver : arg-string(token-xpath("*//*[local-name()='SessionToken']/text()"))
SOAP Driver : token-xpath("*//*[local-name()='SessionToken']/text()")
SOAP Driver : Token Value: "".
SOAP Driver : Arg Value: "".
SOAP Driver : Action: do-set-xml-attr("attr-name","../instance/attr[last()]","Result").
SOAP Driver : arg-string("Result")
SOAP Driver : token-text("Result")
SOAP Driver : Arg Value: "Result".
SOAP Driver : Action: do-append-xml-element("value","../instance/attr[@attr-name='Result']").
SOAP Driver : Action: do-append-xml-text("../instance[@class-name="login"]/attr[@attr-name="Result"]/value",token-xpath("*//*[local-name()='Result']/text()")).
SOAP Driver : arg-string(token-xpath("*//*[local-name()='Result']/text()"))
SOAP Driver : token-xpath("*//*[local-name()='Result']/text()")
SOAP Driver : Token Value: "".
SOAP Driver : Arg Value: "".
SOAP Driver : Action: do-append-xml-element("attr","../instance").
SOAP Driver : Action: do-strip-xpath("self::SOAP-ENV:Envelope").
SOAP Driver : Action: do-break().
SOAP Driver :Policy returned:
SOAP Driver :
<nds dtdversion="4.0" ndsversion="8.x">
<product version="">DirXML</product>
<contact>NetIQ Corporation</contact>
<instance class-name="login" src-dn="magister">
<instance class-name="login" src-dn="magister">


Next to that here's the policy as i have it now:

<comment xml:space="preserve">[Magister] Handle loginResponse documents, with soapenv: header left behind</comment>
<or disabled="true">
<if-xpath op="true">self::/SOAP-ENV:Envelope/SOAP-ENV:Body</if-xpath>
<do-append-xml-element expression=".." name="instance"/>
<do-set-xml-attr expression="../instance" name="class-name">
<token-text xml:space="preserve">login</token-text>
<do-set-xml-attr expression="../instance" name="src-dn">
<token-text xml:space="preserve">magister</token-text>
<do-set-xml-attr expression="../instance/attr[last()]" name="attr-name">
<token-text xml:space="preserve">SessionToken</token-text>
<do-append-xml-element expression="../instance/attr[@attr-name='SessionToken']" name="value"/>
<do-append-xml-text expression='../instance[@class-name="login"]/attr[@attr-name="SessionToken"]/value'>
<token-xpath expression="*//*[local-name()='SessionToken']/text()"/>
<do-set-xml-attr expression="../instance/attr[last()]" name="attr-name">
<token-text xml:space="preserve">Result</token-text>
<do-append-xml-element expression="../instance/attr[@attr-name='Result']" name="value"/>
<do-append-xml-text expression='../instance[@class-name="login"]/attr[@attr-name="Result"]/value'>
<token-xpath expression="*//*[local-name()='Result']/text()"/>
<do-append-xml-element expression="../instance" name="attr"/>
<do-strip-xpath expression="self::SOAP-ENV:Envelope"/>


The questions i have after repeating this ( and trying to get this with
the correct output) are as following :

- i have the distinct feeling Designer is caching simulator info, as
whenever i startup Designer fresh, i get a 'single' instance (so not the
duplicate behaviour i've just shown) - can anyone confirm ? - if so how
can i get rid of it ?
- if i edit my rule, run the XPATH editor, paste in my source and select
the correct node, i get a result, but in designer simulation its not
grabbing the value - is that due to the 'no valid XDS -> continue? -
also same as previous how can i get around it ?

- an additional question (more driverwise, so i dont think it belongs in
the designer-part of the forum)i have is that when i buildup my
(XPATH-)condition it keeps nagging about the NS1: namespace not being
defined, all mentioned namespaces were added to the policy from the

i know this is a sort-of cross-touching both designer-behaviour and
driver development, but as the output from designer and its behaviout is
confusing me so much i've put it in here, and not gonna crosspost.

Best regards,


Shadowm's Profile: https://forums.netiq.com/member.php?userid=6005
View this thread: https://forums.netiq.com/showthread.php?t=54365