cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Call: Missing namespace declaration

Former Member
0 Kudos

Dear experts,

I have a file to RFC scenario. I imported the RFC and create files exactly according to the RFC structure, so I don't use a mapping. When I create a file, it provides the following error in the adapter log:

<i>Exception caught by adapter framework: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not get functionname from XML requst: com.sap.aii.af.rfc.RfcAdapterException: failed to read funtionname from XML document: missing namespace declaration(2)</i>

What do I need to do to fix this.

Thanks in advance!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Schotanus,

first of all check whether you RFC is reachable or not from the T-Code SM49>ping>provide host mane in additional parameters (as said by Sai).

If the problem is not solved ,then to get the namespace declaration to appear in the XML string, You need to add,

root.setAttribute("xmlns:ns2", "http://www.foo.com");

or may be:

root.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:ns2",

"http://www.foo.com");

where ns2 will be the prefix for your namespace declaration.

Hope this helps.

Regards,

Shibani

*Reward with points if helpful*

Former Member
0 Kudos

Hi.

Thanks for your responses.

But the systems seem connected and available.

And where do you wnat me to set this root.setAttirbute? In the input file?

Cheers.

Former Member
0 Kudos

Hi,

use that root.setAttirbute in your input file.

Regards,

Shibani

Former Member
0 Kudos

So then we get:

root.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:ns2",

"urn:sap-com:document:sap:rfc:functions");

?

Former Member
0 Kudos

Ok, this is my header:

<?xml version="1.0" ?>

<ZWM_TO_CREATE XMLNS="urn:sap-com:document:sap:rfc:functions">

How to adjust?

Thanks in advacne,

Will award points for helpful answers.

henrique_pinto
Active Contributor
0 Kudos

please post your whole message.

And use "xmlns" in lowercase.

Best regards,

Henrique.

Former Member
0 Kudos

This is the whole message:

I created my own interface and mapped it to the RFC:

This is the message. Now it successfully pass XI and the adapter sais it is delivered.

BUT nothing is seen in the target system... how is that possible???

<?xml version="1.0" ?>

<ns:MT_TO_CREATE xmlns:ns="urn://cchbc/w2/xi/mes/warehousetransfer">

<LGNUM></LGNUM>

<TIMEST>20071207094550.0000000</TIMEST>

<WERKS>4510</WERKS>

<ZLAST>0</ZLAST>

<ZSCID>SCANPRD4</ZSCID>

<I_LTAP>

<item>

<EAN11>5449000003096</EAN11>

<LETYP>E2</LETYP>

<VSOLM>48.000</VSOLM>

<LENUM>00345101239500010930</LENUM>

<VFDAT>2008-12-11T00:00:00</VFDAT>

<WDATU>2007-12-07</WDATU>

<ZLINE>830</ZLINE>

<ZTIME>09:43:32</ZTIME>

<BRGEW/>

</item><item>

<EAN11>2229000058744</EAN11>

<LETYP>E2</LETYP>

<VSOLM>48</VSOLM>

<LENUM>00000000003000002961</LENUM>

<VFDAT>2008-12-11T00:00:00</VFDAT>

<WDATU>2007-12-07</WDATU>

<ZLINE>830</ZLINE>

<ZTIME>09:44:01</ZTIME>

<BRGEW/></item><item>

<EAN11>2229000058744</EAN11>

<LETYP>E2</LETYP>

<VSOLM>48.000</VSOLM>

<LENUM>00000000003000002978</LENUM>

<VFDAT>2008-12-11T00:00:00</VFDAT>

<WDATU>2007-12-07</WDATU>

<ZLINE>830</ZLINE>

<ZTIME>09:44:32</ZTIME>

<BRGEW/></item></I_LTAP></ns:MT_TO_CREATE>

And the output is:

<?xml version="1.0" encoding="UTF-8" ?>

- <ns1:ZWM_TO_CREATE xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

<LGNUM />

<TIMEST>20071207094550.0000000</TIMEST>

<WERKS>4510</WERKS>

<ZLAST>0</ZLAST>

<ZSCID>SCANPRD4</ZSCID>

- <I_LTAP>

- <item>

<EAN11>5449000003096</EAN11>

<LETYP>E2</LETYP>

<VSOLM>48.000</VSOLM>

<LENUM>00345101239500010930</LENUM>

<VFDAT>2008-12-11T00:00:00</VFDAT>

<WDATU>2007-12-07</WDATU>

<ZLINE>830</ZLINE>

<ZTIME>09:43:32</ZTIME>

<BRGEW />

</item>

- <item>

<EAN11>2229000058744</EAN11>

<LETYP>E2</LETYP>

<VSOLM>48</VSOLM>

<LENUM>00000000003000002961</LENUM>

<VFDAT>2008-12-11T00:00:00</VFDAT>

<WDATU>2007-12-07</WDATU>

<ZLINE>830</ZLINE>

<ZTIME>09:44:01</ZTIME>

<BRGEW />

</item>

- <item>

<EAN11>2229000058744</EAN11>

<LETYP>E2</LETYP>

<VSOLM>48.000</VSOLM>

<LENUM>00000000003000002978</LENUM>

<VFDAT>2008-12-11T00:00:00</VFDAT>

<WDATU>2007-12-07</WDATU>

<ZLINE>830</ZLINE>

<ZTIME>09:44:32</ZTIME>

<BRGEW />

</item>

</I_LTAP>

</ns1:ZWM_TO_CREATE>

Former Member
0 Kudos

Hi,

could you explain what you mean by

"creating a file"?

Regards Mario

Former Member
0 Kudos

By creating a file I mean putting an XML file in the FTP directory which XI picks up and sends to the R/3 system as a RFC call.

This file has the structure of the RFC.

Former Member
0 Kudos

Hi,

Try to check the RFC destination .............In TC "SM59" you can test the RFc destination...........may be there is a problem with RFc destination.......

And also see if the host is reachable in TC "SM49"--


>PING--


> Additional Parameters(provide the host name here)

Reward wuth points if helpful

Regards

Sai ganesh

Former Member
0 Kudos

Hi,

I'm not using a RFC destination. Just filled out the parameters in the RFC communication channel:

Server, System number, user, password, client....

Or do I need to approach this differently?

Former Member
0 Kudos

Hi,

I think error lies in u r payload ........may be u didnt sepcify the namespace in xml header ..i think that is missing ........So check the payload (header)......check if the namespace if specified over there............

Regards

Sai

Former Member
0 Kudos

Hi,

This is the header of my input file:

<?xml version="1.0" ?>

<ZWM_TO_CREATE XMLNS="urn:sap-com:document:sap:rfc:functions">

Any suggestions?