cancel
Showing results for 
Search instead for 
Did you mean: 

XSD nillable element

Tomasz_Sawczuk
Explorer
0 Kudos

Hi All

Yesterday i found out some restrictions about nillable elements is XSD definition.

Is it really impossible to have nil="true" values in messages?

Some ideas?

Accepted Solutions (0)

Answers (2)

Answers (2)

Tomasz_Sawczuk
Explorer
0 Kudos

Hi,

I have some services on Oracle Application Server. All element contain nillable="true".

With string there is no problem, we can send and empty element in SOAP message. Problems occurs with all numeric types (int, float...) and dates.

Best Regards,

Tomek

stefan_grube
Active Contributor
0 Kudos

When you really need the xsi:nil="true" attribute, you can create a sample SOAP request message without SOAP envelope and upload this to your graphical mapping tool as target message.

Here an example xml:

<ns0:BookingOrders xmlns:ns0="http://sap.com/xi/rkt/CaseStudy/group99"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Order>
		<BookingCode>2KY34R</BookingCode>
		<Passenger>
			<Name xsi:nil="true"></Name>
			<Address>123 Main St.</Address>
		</Passenger>
	</Order>
</ns0:BookingOrders>

Check out if it would be sufficient just to omit the elemts which have no values or provide initial values like 0 for float and int.

Regards

Stefan

Tomasz_Sawczuk
Explorer
0 Kudos

if i receive message from system A with <NETTO /> it should be send to system B with <NETTO xsi:nil="true"></NETTO>

If i receive message from system A with <NETTO>100.4563</NETTO> it should be send to system B with <NETTO>100.4563</NETTO>

How I can do it with graphical mapping tool (set tag attributes conditionally..)

JAVA/ABAP coding in mapping is not an solution it is work around...

stefan_grube
Active Contributor
0 Kudos

> How I can do it with graphical mapping tool (set tag

> attributes conditionally..)

Do it like I told you, upload a sample xml as target.

The attributes appear as individual entries below the corresponding elements. You can use the ifWithoutElse function. Map the constant true.

Regards

Stefan

stefan_grube
Active Contributor
0 Kudos

> if i receive message from system A with <NETTO /> it

> should be send to system B with <NETTO

> xsi:nil="true"></NETTO>

You said with string it works with an empty element, so why you cannot send <NETTO>0</NETTO> ?

Tomasz_Sawczuk
Explorer
0 Kudos

0 is not NULL

For example ROI, IRR, etc..

Thanx for advice.

stefan_grube
Active Contributor
0 Kudos

> For example ROI, IRR, etc..

What's IRR?

Tomasz_Sawczuk
Explorer
stefan_grube
Active Contributor
0 Kudos

I hope you do not expect me to understand that

http://en.wikipedia.org/wiki/Internal_rate_of_return

stefan_grube
Active Contributor
0 Kudos

Hi Tomasz,

For which scenario do you need a nil element?

Regards

Stefan