cancel
Showing results for 
Search instead for 
Did you mean: 

Namespace Problem using JDBC Adapter

Former Member
0 Kudos

Hi everybody!

I have the following Problem:

I am sending a "SELECT" message to a JDBC receiver adapter. The result should be mapped to a predefined XML structure. The target structure looks like this (I omitted some details for clarity):


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

<ns0:getnew_TABLE_response xmlns:ns0="http://www.mycompany.com">
   <ns0:select_TABLE_response>
      <ns0:row>
         <ns0:PKEY/>         
      </ns0:row>
   </ns0:select_TABLE_response>
</ns0:getnew_TABLE_response>

The result of my query, however is generated by the JDBC adapter like this:


<?xml version="1.0" encoding="utf-8"?>
<ns0:getnew_TABLE_response xmlns:ns0="http://www.mycompany.com">
	<select_TABLE_response>
		<row>
			<PKEY>1000002187</PKEY>
		</row>
		<row>
			<PKEY>1000002188</PKEY>
		</row>
	</select_TABLE_response>
</ns0:getnew_TABLE_response>

Strangely, the resulting XML could not be mapped to my target structure... It took me a while to spot the difference between the two structures, but as I examined it closely I noticed that the namespace declarations are missing from the JDBC adapter's elements below the root element (<b><select_TABLE_response></b>, <b><row></b> and <b><PKEY></b>). I assume that the problem lies here.

Unfortunately I have found no way of setting the namespace of those elements - since they are generated by the codiung of the JDBC adapter.

Also, I have found no way of changing the namespaces of my target structure - the namespace is declared globally and cannot be changed for elements blow the root element.

So I really don't know how to solve this puzzle - do you have any suggestions?

Thanks in advance,

Joerg

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

you can delete the namespace

(by removing it from the message type)

did you try that?

question:

12. I have a problem with namespaces in XI - Is there a way to remove them?

on the XI FAQ page

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

Former Member
0 Kudos

Hi everyone!

Thanks for the quick reply!

Removing all namespaces from all the XML documents involved solved the problem.

I do not really like this solution (I definetely prefer declarations <i>with</i> namespaces). But then again, I like a hack as much as the next person

Regards, Joerg

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Joerg,

the reponse message type of a JDBC is always similar to the request!

You can not define your own name for the response message type.

E.g.

Message-type JDBC- Request: MYJDBCREQUEST

than the reponse has to be named:

MYJDBCREQUEST_Response

Regards Mario