cancel
Showing results for 
Search instead for 
Did you mean: 

Wrap IDoc into Envelope or dismiss Envelope

JaySchwendemann
Active Contributor
0 Kudos

Dear all,

I have the following scenario: SOAP --> PI --> IDoc.

The entry payload in RXMB_MONI looks like this at the moment


<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
	<SOAP-ENV:Header/>
	<SOAP-ENV:Body>
		<YP4TENCO>
			<IDOC BEGIN="1">
				<EDI_DC40 SEGMENT='1'>
					<TABNAM>EDI_DC40</TABNAM>
					<DOCNUM>XXX</DOCNUM>
					<DIRECT>2</DIRECT>
					<IDOCTYP>YP4TENCO</IDOCTYP>
					<MESTYP>YP4TENCOINPUT</MESTYP>

					<STDMES>YP4TENCOINPUT</STDMES>
					<SNDPOR>XXX</SNDPOR>
					<SNDPRT>XXX</SNDPRT>
					<SNDPRN>XXX</SNDPRN>
					<RCVPOR>XXX</RCVPOR>
					<RCVPRT>XXX</RCVPRT>
					<RCVPRN>XXX</RCVPRN>
					<CREDAT>20120305</CREDAT>
					<CRETIM>083702</CRETIM>
					<SERIAL>XXX</SERIAL>
				</EDI_DC40>

				<YP4TENCOINPUT SEGMENT="1">
					<JOBID>XXX</JOBID>
					<DATUM>20120305</DATUM>
					<UZEIT>083702</UZEIT>
					<UNAME>XXX</UNAME>
					<NAME1>XXX</NAME1>
				</YP4TENCOINPUT>
			</IDOC>
		</YP4TENCO>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I get the following error in Message Mapping in SXMB_MONI:

com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_YP4TENCO_TO_Yp4tencoinput_: RuntimeException in Message-Mapping transformatio~

In trace I can further track down the error to not being able to create the BEGIN structure of the IDoc:

com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /YP4TENCO/IDOC/BEGIN. Queue does not have enougth values in context. Target xsd requires a value for this element but target field mapping does not produce one. XML instance is not invalid for source xsd, or the target field mapping does not fulfill the requirement of the target xsd.

If I test the message mapping in IR withouth the SOAP envelope everything is working fine.

My questions are:

1. At the moment the sender soap communication channel has "do not use soap-envelope" checked. Would it suffice to uncheck "do not use soap-envelope" to make this working?

2. If not, how would I set up Mapping in IR the most efficient way? I have the Idoc already imported and now would need to sort of wrap the SOAP-Envelope around this IDoc structure. Is there an efficient way to do this (maybe with data type enhancement or external definition)

Thanks and kind regards

Jens

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>1. At the moment the sender soap communication channel has "do not use soap-envelope" checked. Would it suffice to uncheck "do not use soap-envelope" to make this working?

yes it should

Regards,

Michal Krawczyk

Answers (4)

Answers (4)

JaySchwendemann
Active Contributor
0 Kudos

"&nosoap=true" in addition to "do not use soap-envelope=unchecked" did confuse PI. Getting rid of "&nosoap=true" while "do not use soap-envelope=unchecked" did the trick

JaySchwendemann
Active Contributor
0 Kudos

Dear all,

thanks for participation and pushing me to the right direction. What caused the last two errors was: the "&nosoap=true" parameter in the URL the sender calls was set, but in GUI of IR the check on "do not use soap-envelope" was not set. So PI got two opposing commands and did produce the error.

After eleminating "&nosoap=true" from the URL things worked out fine without interface mapping in interface determination.

Thanks all for sharing

Kind regards

Jens

JaySchwendemann
Active Contributor
0 Kudos

Hi all,

ok, I did the following:

First I removed the interface (operation) mapping from the interface determination. At that stage the sender soap communication channel did not have the "do not user soap-envelope" checked. At this time I could not see payload in the entry message in SXMB_MONI. There is header and body but no payload.

The resulting error message then was:

Message 355F1797678D11E1CF710000007558D2 does not contain an IDoc as its payload and therefore cannot be processed

Then, second, I did check the "do not user soap-header" again (this was the very initial setting of the CC). After doing this I got the following error message stating that the now delivered SOAP header does not resemble an IDoc.

The resulting error message then was:

Error: MSGGUID FA607498679111E1CF9C0000007558D2: Tag HEADER found instead of tag IDOC BEGIN

So it seems for me that without "do not use soap-header" the payload is not being sent to mapping engine. If "do not use soap-header" is checked, payload is being sent, but with the SOAP envelope which will give me mapping errors when having no mapping in place like Grzegorz suggested.

My SOAP sender communication channel has XI Default Parameters urn:sap-com:document:sap:idoc:messages YP4TENCOINPUT.YP4TENCO and und tab "module" the module name "sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean" and module type "Local enterprise bean" with module key "soap" as one and only entry.

5. What could cause the behavior that checking / unchecking the "do not use soap-envelope" resulting in seemingly dropped payload

6. Where could I, assuming that the sender is sending steadily with soap envelope see the payload if "do not use soap-envelope" is unchecked in sender communication channel.

Thanks a lot all

Kind regards

Jens

JaySchwendemann
Active Contributor
0 Kudos

Thanks for the super fast response.

I unchecked the option "Do not use soap-envelope" and activated the communication channel.

Unfortunatelly now I get an error that the root is empty. I also do not see any payload on the entry message in SXMB_MONI

com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_YP4TENCO_TO_Yp4tencoinput_: Parsing an empty source. Root element expected!

Mapping in IR looks like this

YP4TENCO --> (not mapped)

IDOC --> (not mapped)

BEGIN --> BEGIN

EDI_DC40 --> (not mapped)

SEGMENT --> SEGMENT

... the rest is mapped 1 to 1

My questions are:

3. Would unchecking "do not use soap-envelope" need a CFA refresh?

4. Could the missing (not mapped) mappings be the reason why now I get an empty source?

Sorry to ask kind of silly questions. I took over this scenario from a colleague that left us and am not confident enough already to tell which constellation would matter / possible result in an error and which could be left out.

Thanks and kind regards

Jens

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

the entry message has to be there (it always is case of error in mapping)

so find it in SXMB_MONI in any step before the mapping and then you can use the payload in the TEST tab in mapping itself

Regards,

Michal Krawczyk

former_member184681
Active Contributor
0 Kudos

Hi Jens,

It looks like I haven't read the question carefully enough...

The empty source might be caused by the sender system using wrong namespace or no namespace at all.

Anyway, if you really use no more mapping logic then 1:1 mappings, then removing the Operation Mapping from your Interface Determination in Integration Directory seems to be the best idea. It would also be better in terms of performance, as no unnecessary step will be executed.

Hope this helps,

Greg

Edited by: Grzegorz Glowacki on Mar 6, 2012 12:15 PM