cancel
Showing results for 
Search instead for 
Did you mean: 

Namespace issue in Sender JDBC message

Former Member
0 Kudos

Hi All,

My scenario is pulling data from Oracle DB(3rd party) and pushing it to SAP ECC system. Here I am using the table metadata in the form of an External Definition.I am directly using this ED in my message mapping and service interface. I am able to test the mapping locally, when I run the scenario the target message type is generated but the main element node inside is automatically suppressed. The structure examples are given as below(been taken from message mapping test tab):

Source

<?xml version="1.0" encoding="UTF-8"?>
<ns0:TABLE_NAME.resultSet xmlns:ns0="urn:sap.com:jdbcAdapter">
   <row>
      <A/>
      <BV/>
    </row>
</ns0:TABLE_NAME.resultSet>

Target:

<?xml version="1.0" encoding="UTF-8"?>
<MT_Inbound>
   <Main_Node>
      <X/>
      <Y/>
   </Main_Node>
</MT_Inbound>

I guess the problem is with the namespace and prefix which is coming along with the table metadata(ns0). I tried removing it by XML AnonymizerBean module in my sender JDBC channel but this did not solve the purpose.

Request you all to help in solving this.

Thanks in Advance

Lalitkumar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Lalitkumar,

Remove the XML Namespace in the source message type. Even though it is removed, the mapping will work. No need to worry about it.

Thanks,

Edited by: Hareenkumar on Feb 10, 2011 11:33 AM

Former Member
0 Kudos

Hi Hareenkumar,

Thanks for replying so soon.

As u can see in my target example i have already removed the XML namespace in the target message type.

Now i am trying to remove the namespace from the source ED(table metadata) by using XML AnonymizerBean in Sender JDBC channel.

i have configured the module by following a few popular blogs on SDN but still at runtime complete target structure is not getting generated. Under the request message mapping of SXMB_MONI.

even when i have the source payload from SXMB_MONI and try to test the message mapping manually it behaves in the similar i.e., the target is not completed generated.

<row>(0...unbound)------------(mapped)--------------- <Main_Node>(0...unbound)

the mapping display queue shows <row> as null and <Main_Node> as suppress

thanks,

Lalit

aashish_sinha
Active Contributor
0 Kudos

Hi ,

Please remove to namespace from Source Message Type. It will start working.

Thanks

Aashish Sinha

Former Member
0 Kudos

Hi Aashish,

As we have imported the tabe definition from the oracle DB, which is in the form External defintion in ESR there is no message type created for the source. Now we used the XML AnonymizerBean to remove the namespace from the same. But this didn't work. kindly let me know how to remove the namespace of the source.

Thanks,

Lalitkumar.

aashish_sinha
Active Contributor
0 Kudos

Hi,

Open table definition in any XML editor (I hope it is XSD or DTD), and there try to remove xmlns:xs = "Value" to xmlns:xs = "".

and then reimport this to SAP PI ESR. Then create SI and Mapping.

Thanks

Aashish Sinha

stefan_grube
Active Contributor
0 Kudos

> As we have imported the tabe definition from the oracle DB, which is in the form External defintion in ESR there is no message type created for the source.

This message type is intented to be used for receiver JDBC adapter. You cannot use it for sender JDBC adapter.

Create the message structure in ESR as data type directly.

Use a sample message from JDBC adapter test for creating it.

Former Member
0 Kudos

Dear Stefan,

This message type is intented to be used for receiver JDBC adapter. You cannot use it for sender JDBC adapter.
Create the message structure in ESR as data type directly.

Can you please help in understanding as to why we cannot use the ED of table metadata in Sender JDBC adpater..?

Use a sample message from JDBC adapter test for creating it

.

Can you please explain more on this...

Thanks for helping,

Lalitkumar.

former_member200962
Active Contributor
0 Kudos
Can you please help in understanding as to why we cannot use the ED of table metadata in Sender JDBC adpater..?

the structure imported using the Import function is used in the sender channel.....for receiver we still follow the good old procedure of creating it in ESR.

Former Member
0 Kudos

Dear Stefan,

Please find the below link whcih says that the ED(the table metadata) can be used in sender JDBC adpater.

[ External definition of type "dbtab" and jdbc sender/receiver scenarios|;

Looking forward for your comments.

thanks,

Lalitkumar

stefan_grube
Active Contributor
0 Kudos

> Can you please help in understanding as to why we cannot use the ED of table metadata in Sender JDBC adpater..?

As you should have already noticed, the structure of sender JDBC adapter does not match the meta data.

> >Use a sample message from JDBC adapter test for creating it

> Can you please explain more on this...

Just let the JDBC adapter poll once and look how the structure looks like.

aashish_sinha
Active Contributor
0 Kudos

Hi Abhishek,

I am lost now with your statement. can you please explain?

thanks

Aashish Sinha

stefan_grube
Active Contributor
0 Kudos

> Please find the below link whcih says that the ED(the table metadata) can be used in sender JDBC adpater.

> [ External definition of type "dbtab" and jdbc sender/receiver scenarios|;

>

> Looking forward for your comments.

It seems that Shabarish gave the wrong answer.

aashish_sinha
Active Contributor
0 Kudos

Do one thing :

Go to message mapping and go to test tab -> click on SRC and get the xml for source. and just compare that if it is similar to the xml you want. Also test you Message Mapping.

Regards

Aashish Sinha

former_member200962
Active Contributor
0 Kudos
I am lost now with your statement. can you please explain?

my bad if it was confusing.....the ED that is created out of the imported SQL structure is used in the source message interface and source tab of message mapping.....anything else that you are looking from me?

aashish_sinha
Active Contributor
0 Kudos

LOL.. can't see Sabarbish messages ..

former_member200962
Active Contributor
0 Kudos

Now I seem to be lost

/people/william.li/blog/2008/01/02/sap-pi-71-mapping-enhancements-series-import-sql-tables-metadata

Yes, the imported schema does match the result of a select statement of the JDBC sender comm chan.

Right now, there is no option to generate a schema that can be used by the JDBC receiver comm chan. This might be a little difficult due to the different actions, and columns to be included in the where clause.

aashish_sinha
Active Contributor
0 Kudos

Hi Abhishek,

I was talking about below statement. Anyways no offences.

>>>>>>the structure imported using the Import function is used in the sender channel.

Since last few posts, this thread is now became intresting ).

Aashish

Former Member
0 Kudos
As you should have already noticed, the structure of sender JDBC adapter does not match the meta data.

The structure of the ED imported is :

TABLE_NAME.resultSet
      TABLE_NAME.resultSet
            row
                A
                BV

The structure getting generated after polling the JDBC adapter is as given below(structure from moni inbound payload):

<?xml version="1.0" encoding="utf-8" ?> 
- <TABLE_NAME.resultSet>
- <row>
  <A>20110206</A> 
  <BV>06:38:56</BV> 
  </row>

I am not able to make out the difference here. I am able to also see the namespace when i check the same in the message mapping test tab.

I am also a little lost now as abhishek is on a different track.

Please comment.

aashish_sinha
Active Contributor
0 Kudos

end tag missing for <TABLE_NAME.resultSet>..

Thanks

Aashish

stefan_grube
Active Contributor
0 Kudos

OK, let us start from the beginning.

The external definition based in db table was originally intruduced to do database lookup in mapping. So the structure represents the response message from database in a sync call.

When you for example do an RFC -> JDBC call, you can create the JDBC->RFC response mapping based on that structure.

The structure does nether fit to sender JDBC structure nor to JDBC receiver request structure.

Is it clearer now?

Former Member
0 Kudos

It was a typo:

<?xml version="1.0" encoding="utf-8" ?> 
- <TABLE_NAME.resultSet>
- <row>
  <A>20110206</A> 
  <BV>06:38:56</BV> 
  </row>
  </TABLE_NAME.resultSet>

Warm Regards,

Lalit

stefan_grube
Active Contributor
0 Kudos

wrong input

Edited by: Stefan Grube on Feb 10, 2011 2:09 PM

Former Member
0 Kudos

So Stefan if i am getting you right, we can only use this table defination in a JDBC lookup? This should only be used as a reference to create respective DT's for such requirments and should not be directly used?

Warm Regards,

Anshul

stefan_grube
Active Contributor
0 Kudos

wrong input

Edited by: Stefan Grube on Feb 10, 2011 2:09 PM

Former Member
0 Kudos

Thanks Stefan, in helping us to understand this particular feature.

Thanks to all for participating in this discussion.

Warm Regards,

Lalit

stefan_grube
Active Contributor
0 Kudos

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

> - <TABLE_NAME.resultSet>

> - <row>

> <A>20110206</A>

> <BV>06:38:56</BV>

> </row>

Now I see the issue. In sender adapter parameters you have to set "Document Namespace" as "urn:sap.com:jdbcAdapter"

That should help.

Former Member
0 Kudos

BINGO! The scenario worked.

Thanks Stefan!!

Hence we can use DB table metadata directly in the form of an ED in such scenarios. The only mandate is to specify the "Document Namespace" as "urn:sap.com:jdbcAdapter" in the JDBC sender adapter.

Warm Regards,

Lalit

stefan_grube
Active Contributor
0 Kudos

So I was wrong.

The imported definition can be used in sender JDBC adapter, but not in receiver adapter.

Shabarish was right.

Answers (1)

Answers (1)

former_member472138
Active Contributor
0 Kudos

>>>>>>>>>> I guess the problem is with the namespace and prefix

Yes, you are true. This happens if you don't give namespace in the sender (JDBC) channel. Generally people use to ignore it since it is not mandt.

So, namespace must be provided for the Document(Message type) in channel.

Note:This was the case for me.

Regards

Pothana