Passing null value to web service

Dedicated to DataStage and DataStage TX editions featuring IBM<sup>®</sup> Service-Oriented Architectures.

Moderators: chulett, rschirm

Post Reply
Nicole
Premium Member
Premium Member
Posts: 93
Joined: Mon Oct 22, 2007 12:55 pm
Location: Albany
Contact:

Passing null value to web service

Post by Nicole »

I am passing data to a web service.

The service has an array object called FormInfo and there are 2 strings that can be null or can have values.

From my understanding, the only values you can set in the WSDL are the elements that end with 'text()' the xpath for the string is below.

/ns1:saveForm/form/additionalInfo/FormInfo/ID1/text()
/ns1:saveForm/form/additionalInfo/FormInfo/ID2/text()

Besides passing null to the 2 strings fields, I need to also set the FormInfo Array to null if these values are not given. Is there a way to set the Array to null in the columns. As I said, I thought I would only set values in the columns with 'text()', but I also need to set this array object FormInfo to null. Sorry if this is confusing, but if anyone understands what i'm trying to do, please feel free to offer advice!

Thanks,

Nicole
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

...hmm.. Hard to say...you'd need to know exactly how the author of the service interprets nulls..... one "formal" way to do it is to put in the accepted standard null attribute, and see if the service accepts it.

What test tool are you using? Many of them will let you manually play with the payload before shipping it to the web service provider. In that case, add xsi:nil="true" as an attribute to the element in question and see if that helps <myelement xsi:nil="true"></myelement>. This assumes that xsi is already in the namespace up above (it may or may not be ---- that's a whole other level of complication).

If you are building the payload manually within DS, you'll need to construct the element in a Derivation separately, and then pass it into the xmlOutput Stage that you may be using to build the rest of your payload.

Find out EXACTLY what the author expects. Also --- insist that the author provide you with a sample SOAP envelope from their test environment that illustrates how nulls are delivered in this "expected" format. That will help immensely and keep you from just "trying things" till you get it right. Then all you have to worry about is how to construct the same looking envelope.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply