Wednesday, October 23, 2013

Fetching value of variable not defined in Proxy WSDL


At times we get XML response in a format not defined in the proxy WSDL, common scenario is when a application returns a error response in a different format than response.

A simple way for fetching that value would be :
1. Add/define namespace in assign .
Prefix = saperrorns
URI = http://mysapaaplication/purchaseorder/error/v1

2. Use the namespace to fetch the value from response, i used below wild pattern
$body//saperrorns:ErrorMessage/text()

This is pretty simple but effective.

Cheers !!

No comments:

Post a Comment