cancel
Showing results for 
Search instead for 
Did you mean: 

String value null in the XI mapping

Former Member
0 Kudos

Hi folks,

is it possible to create in the XI mapping for a string the value <b>null</b> and not an empty string like "". It is necessarily for the Webservice over the soap adapter.

Thanks for answers

Johann

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Simple, just do not map the target node.

Regards,

Jai Shankar

Former Member
0 Kudos

Hi Jai,

when I try your suggestion I get an error in the mapping: mapping isn't completely . Frequency for ths element is 0..1

Shabarish_Nair
Active Contributor
0 Kudos

you will require that element.

As i mentioned earlier, use the constant with the value <b>null </b> and then map it to the field.

Former Member
0 Kudos

Johann,

Make sure the min. occurance of the target node is 0. If you do not map the field it will not throw an error. It will throw an error only if the min occurance is equal to or greater than 1.

@Shabz,

I guess Mapping to a string constant "null" is not the same as null. Pls correct me if I am wrong.

Regards,

Jai Shankr

Former Member
0 Kudos

Johann,

Another option is to map the target node to a souuce node (say src1) whose occurance is 0..1. Just make sure the source node (src1) is not populated.

This will for sure produce a null object in the target node.

Regards,

Jai Shankar

Shabarish_Nair
Active Contributor
0 Kudos

well in case the WS at his receiving end expects <b>null</b> string, i guess the constant will work !!!

Former Member
0 Kudos

Hi Jai,

the problem is the structure should be dynamically. when i get no value for this elem I send <b>NULL</b> not "NULL" (you said ist correct) to the WS over XI. But when I get an value for this elem i will send the value to the Webservice.

So i can't take the frequency 0 only 0..1 but it throw an error in this composition.

Regards Johann

Former Member
0 Kudos

>>the problem is the structure should be dynamically. when i get no value for this elem

Here all you have to do is change the occurance of elem to 0..1.

Regards,

Jai Shankar

Former Member
0 Kudos

Hi Jai,

thx <b>you solved</b> the probelm it is working now.

for the others:

to map the constant with null creates an string="NULL" and not NULL.

thx for all the helping hands

Regards Johann

Former Member
0 Kudos

Johann,

Glad it worked for you.

Regards,

Jai Shankar

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You have to map the target element, otherwise it will give you an error.

You can map the target element with the constant(null). So it will give you the value null irrespective of your input. The 'null' value you get as the output is the String null. Its not the actual null.

Regards,

Sudheer.

Shabarish_Nair
Active Contributor
0 Kudos

if i understood you correctly, then you can map a constant with the value <b>null</b> to the required field.

Former Member
0 Kudos

Hi Shabarish,

I will map a string with null (string=null) and not an empty string(string="")

Johann

Former Member
0 Kudos

Hi,

Even though you map it with null, i think it will not solve your purpose because it will return you a atring with value "null" but not the actual null object. I am not sure with this plz check and let me know.

Regards,

sudheer.