Question
Coforge DPA private limited
AU
Last activity: 1 Jul 2016 11:57 EDT
How to parse pySOAPFaultReason Property?
Hi,
Can anyone please tell me how to parse the xml comes in pySOAPFaultReason which comes in case of connect-soap fails.
This is required as we need to show error description in front end.
Thanks,
Madhusudan
Message was edited by: Lochan to add Category
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
CA
Create a simple Parse XML rule to match the SOAP fault structure. Map ErrorDescription element to a property of your choice in the Parse XML rule. Once you have the fault XML in pySOAPFaultDetail property, call Apply-Parse-XML method in an activity.
Coforge DPA private limited
AU
Hi, Actually I am getting below error on connect-soap failure which is in pySOAPFaultDetail property
"
<detail><em:ErrorMessages xmlns:em="urn:ford/errormessage/v1.0"><em:ErrorMessage><em:ErrorCode>E002</em:ErrorCode> <em:ErrorDescription>INVALID DATE FORMAT. THE DATE FORMAT SHOULD BE YYYY-MM-DD</em:ErrorDescription><em:ErrorTime>2016-06-30T11:49:02</em:ErrorTime> </em:ErrorMessage></em:ErrorMessages></detail> |
"
Now, I want to parse it and fetch only Error Description element values. Can it be done? Is it possible?
Thanks,
Madhusudan
Coforge DPA private limited
AU
Can anyone help me on this please.
Coforge DPA private limited
AU
Hi Praneeth,
Thanks. That was helpful. its working now.
Thanks,
Madhusudan
Accepted Solution
Pegasystems Inc.
CA
Create a simple Parse XML rule to match the SOAP fault structure. Map ErrorDescription element to a property of your choice in the Parse XML rule. Once you have the fault XML in pySOAPFaultDetail property, call Apply-Parse-XML method in an activity.
Coforge DPA private limited
AU
Anyone pls?
Pegasystems Inc.
GB
Hi Madhusudan,
I can only provide a few high level ideas on this (I don't have the time to try these at the moment in detail to see if they are feasible).
1. Can you use a PARSE-RULE on the Property - to map the bits of the XML you need to another Property ?
2. Are able to create a simple XSLT file that extract the textnode of the XML you need ? If so - PRPC has some built-in Activities that allow you run an XSLT over an XML document - you will need to search PRPC for the Activity names (search XSLT) - I can't remember them off the top of my head I'm afraid.
3. Maybe you can just treat the XML as 'text' : as search for a specific string (using PRPC Libraries - use the 'Expression Builder' (etc) to browse through them) - rather than extract a particular string ?
4. You might also be able to use a REGEX to extract the string you need from the XML if you are reasonably sure of the variability of the format of the XML ?
As I say : I haven't tried any of these - they may or not be viable - just wanted to give you some ideas...
Cheers
John
Virtusa IT Consulting
AE