01-13-2014 11:29 PM
I search for any tip for setting NULL value (clear previous value of attribute) using calling Web Services. I have default setting of WSDL (is generated automatically), where:
a) all Update Request methods have following element:
<xs:attribute default="true" name="ignoreEmptyElements" type="xs:boolean" use="optional"/>
so I update only attributes which I specify in Update Request. All other attributes is ignored (not change its values).
b) all attributes in InstanceType has enabled parameter "nillable":
<xs:element minOccurs="0" name="MobilePhone" nillable="true" type="cmn:StringType"/>
<xs:element minOccurs="0" name="Manager" nillable="true" type="cmn:StringType"/>
<xs:element minOccurs="0" name="ValidFrom" nillable="true" type="cmn:DateTimeType"/>
<xs:element minOccurs="0" name="ValidTo" nillable="true" type="cmn:DateTimeType"/>
so all this attributes can be set as NULL
But I don't know how to. In all documents which I read is following statement:
where xsi namespace is defined as:
All my attempts were not successful and all attributes which I set to "nil" was unchanged and still has same value.
There is a Update Request code one of my attempt:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pws="http://servicecenter.peregrine.com/PWS" xmlns:com="http://servicecenter.peregrine.com/PWS/Common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header/> <soapenv:Body> <pws:UpdateIdMContactRequest ignoreEmptyElements="true"> <pws:model> <pws:keys> <pws:ContactID type="String">87695</pws:ContactID> </pws:keys> <pws:instance> <pws:ModifyTimestamp type="DateTime">2014-01-14T07:21:07+00:00</pws:Mod
ifyTimestamp> <pws:MobilePhone type="String" xsi:nil="true"/> <pws:ValidTo type="DateTime" xsi:nil="true"/> </pws:instance> </pws:model> </pws:UpdateIdMContactRequest> </soapenv:Body> </soapenv:Envelope>
All attributes with specific value (as a ModifiedTime) was successfully updated. All attributes with nil value was ignored.
Thanks for any advice and yours experience with deleting values.
Solved! Go to Solution.
01-20-2014 06:10 AM
My knowledge of web services is very limited, so I can't offer a solution through that method, but if web services is updating a ticket, can't you just null the field through the relevant formatctrl if the update comes from web services. I'm not sure what in your environment identifies updates through web services, but perhaps something like this:
Calculation: field in $file=NULL
01-27-2014 12:42 AM
thank you for your reaction. It's fine you like to help but this is not exactly what I was looking for.
1) condition at Format Control: you really can catch this "WS Updates" but not using variable $G.ess (this identifies that client is using ESS portal access) but variable $G.bg is the right (bg as background identifies that request is not from Web/Java client but i.e. from external access)
2) expression at FC: can be used if you know which field you want to clear (fixed specification) but I don't know which field of course. This specification is in the Web Service request.
BTW: If I would like to clear specific attribute I can realize it in the "expression" tab of extaccess record not in the "calculation" tab of FC.
So if SM get a WS request to clear attribute X I want to process: "X in $L.file=NULL"
if SM get a WS request to clear attribute Y I want to process: "Y in $L.file=NULL" etc.
But this expressions must to realize SM automatically when receive the WS request as any other WS attribute update.
Thanks for any other advices how to send WS request to clear specific attribute, Lukas
03-19-2014 08:20 PM
It can be fixed with "ignoreEmptyElements="false" " XML attribute.
see "customer notes" of QCCR1E83886 "SM handles JournalUpdates incorrectly in an UpdateIncidentRequest Web services call when there is an empty line in JournalUpdates".
List the fields you want to celar in the XML request, with "ignoreEmptyElements="false" " XML attribute, then these fields will be cleared.
03-19-2014 09:16 PM
QCCR1E83886 is a defect found before product release and it has been fixed when product was released, so it's not customer visible. Other information in your reply is correct and it should have answered the question in this discussion.
Yan Tong (Serene), HP Software Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution; and give kudo if you like it :)