I am trying to use the SOAP driver to make a call to the User
Application. The purpose of this, at this point, it to add some
comments to a workflow when another driver renames an object. I have
the SOAP calls figured out, and using SOAP UI was able to do this
manually. Now I am trying to get this into policy builder and have been
struggling with what should be a relatively simple process.

It actually takes two calls to User App to do this, which is where the
rub lies. You have to pass the request ID, get back the work ID, and
then pass the work ID and comment. I successfully do the first part and
get a valid response, but for some reason I am getting a null document
back in my local variable.

Here's the code:

<?xml version="1.0" encoding="UTF-8"?><policy
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:command="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsCommandProcessor"
xmlns:ns1="http://www.novell.com/provisioning/service"
xmlns:query="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsQueryProcessor"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<rule>
<description>[TWC] Get workID</description>
<comment xml:space="preserve">This will make a call to retrieve the
workID via SOAP</comment>
<conditions>
<and>
<if-operation mode="case" op="equal">rename</if-operation>
</and>
</conditions>
<actions>
<do-set-local-variable name="requestID" scope="policy">
<arg-string>
<token-attr name="srvprvUUID"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="SOAP" scope="policy">
<arg-node-set>
<token-xml-parse>
<token-replace-all regex="_REQ_ID_" replace-with="$requestID$">
<token-global-variable name="getWorkEntries"/>
</token-replace-all>
</token-xml-parse>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="WorkEntries" scope="policy">
<arg-node-set>
<token-xpath
expression="command:execute($destCommandProcessor, $SOAP)"/>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="workID">
<arg-string>
<token-xpath expression="$WorkEntries//workentry/id/text()"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="commentText">
<arg-string>
<token-text xml:space="preserve">Assigned as SDE work order
</token-text>
<token-attr name="DirXML-nwoWorkOrderNumber"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="SOAP">
<arg-node-set>
<token-xml-parse>
<token-replace-all regex="_WORK_ID_" replace-with="$workID$">
<token-replace-all regex="_COMMENT_TEXT_"
replace-with="$commentText$">
<token-global-variable name="addComments"/>
</token-replace-all>
</token-replace-all>
</token-xml-parse>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="addCommentsResponse">
<arg-node-set>
<token-xpath
expression="command:execute($destCommandProcessor, $SOAP)"/>
</arg-node-set>
</do-set-local-variable>
</actions>
</rule>
</policy>

and here's some of the trace:

[07/29/08 19:57:04.950]:UA-Feedback ST: Submitting document
to subscriber shim:
[07/29/08 19:57:04.951]:UA-Feedback ST:
<nds dtdversion="3.5" ndsversion="8.x">
<input>
<soapenv:Envelope event-id="0"
xmlns:ser="http://www.novell.com/provisioning/service"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<ser:getWorkEntriesRequest>
<ser:WorkEntryQuery logic="OR" order="REQUEST_ID">
<!--You have a CHOICE of the next 13 items at this
level-->

<ser:requestId>2ae005d2cedb40b0aea759aadcf6750a</ser:requestId>
</ser:WorkEntryQuery>
<ser:arg1>-1</ser:arg1>
</ser:getWorkEntriesRequest>
</soapenv:Body>
</soapenv:Envelope>
</input>
</nds>
[07/29/08 19:57:04.975]:UA-Feedback ST: UA-Feedback:
HTTPSubscriberTransport.send()
[07/29/08 19:57:04.976]:UA-Feedback ST: UA-Feedback:
Preparing HTTP POST connection to
http://165.237.137.135:8080/IDM/provisioning/service
[07/29/08 19:57:04.978]:UA-Feedback ST: UA-Feedback: Setting
the following HTTP request properties:
[07/29/08 19:57:04.999]:UA-Feedback ST: UA-Feedback:
Authorization: <credentials suppressed>
[07/29/08 19:57:05.000]:UA-Feedback ST: UA-Feedback:
SOAPAction: #batchRequest
[07/29/08 19:57:05.001]:UA-Feedback ST: UA-Feedback:
Content-Type: text/xml; charset=utf-8
[07/29/08 19:57:05.003]:UA-Feedback ST: UA-Feedback: Did
HTTP POST with 563 bytes of data to
http://165.237.137.135:8080/IDM/provisioning/service
[07/29/08 19:57:05.758]:UA-Feedback ST: UA-Feedback: Setting
cookie: JSESSIONID=85CC43BEF1CFCB8FFEFA7B65FEDAFF70; Path=/
[07/29/08 19:57:05.759]:UA-Feedback ST: UA-Feedback: Didn't
understand this part of the cookie: Path=/
[07/29/08 19:57:05.760]:UA-Feedback ST: UA-Feedback:
Response code and message: 200 OK
[07/29/08 19:57:05.762]:UA-Feedback ST:
SubscriptionShim.execute() returned:
[07/29/08 19:57:05.764]:UA-Feedback ST:
<nds dtdversion="2.0">
<source>
<product build="20070918_0808 " instance="UA-Feedback"
version="3.5.2">Identity Manager Driver for SOAP</product>
<contact>Novell, Inc.</contact>
</source>
<output>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:getWorkEntriesResponse
xmlns="http://www.novell.com/provisioning/service"
xmlns:ns1="http://www.novell.com/provisioning/service">
<WorkEntryArray>
<workentry>
<activityId>Activity33</activityId>
<activityName>Approval</activityName>
<addressee>cn=admin,ou=services,o=lab</addressee>
<assignmentType>0</assignmentType>
<availableActions>
<availableAction>
<actionCode>0</actionCode>
<actionValue>Approve</actionValue>

<digitalSignatureRequired>false</digitalSignatureRequired>

<digitalSignatureType>not-required</digitalSignatureType>
</availableAction>
</availableActions>
<creationTime>2008-07-29T19:56:55</creationTime>
<expirationTime>2008-07-29T20:56:55</expirationTime>
<id>d5d62d6fa5854daba36f5a3aa672b5f4</id>
<owner>Unclaimed</owner>
<priority>2</priority>

<processId>cn=SARF,cn=RequestDefs,cn=AppConfig,cn= UserApplication35,cn=IDVAULT,ou=SERVICES,o=LAB</processId>
<requestId>2ae005d2cedb40b0aea759aadcf6750a</requestId>
<status>0</status>
<legalDisclaimer xsi:nil="1"/>

<digitalSignatureType>not-required</digitalSignatureType>
<processVersion>8657</processVersion>
<completionTime xsi:nil="1"/>

<recipient>cn=SDolan,ou=ACTIVE,ou=EMPLOYEES,o=LA B</recipient>

<initiator>cn=SDolan,ou=ACTIVE,ou=EMPLOYEES,o=LA B</initiator>
<proxyFor xsi:nil="1"/>
</workentry>
</WorkEntryArray>
</ns1:getWorkEntriesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</output>
</nds>

...

[07/29/08 19:57:05.917]:UA-Feedback ST: Token Value: {/}.
[07/29/08 19:57:05.919]:UA-Feedback ST: Arg Value: {/}.
[07/29/08 19:57:05.919]:UA-Feedback ST: Action:
do-set-local-variable("workID",token-xpath("$WorkEntries//workentry/id/text()")).
[07/29/08 19:57:05.921]:UA-Feedback ST:
arg-string(token-xpath("$WorkEntries//workentry/id/text()"))
[07/29/08 19:57:05.922]:UA-Feedback ST:
token-xpath("$WorkEntries//workentry/id/text()")
[07/29/08 19:57:05.923]:UA-Feedback ST: Token Value: "".
[07/29/08 19:57:05.924]:UA-Feedback ST: Arg Value: "".


--
rrawson
------------------------------------------------------------------------
rrawson's Profile: http://forums.novell.com/member.php?userid=4898
View this thread: http://forums.novell.com/showthread.php?t=338076