cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP-Adapter: can't cast moduleData.getPrincipalData() to XIMessage

Former Member
0 Kudos

Hi,

I've develop an adapter module to change message payload following this article:

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81">Create Modules for the J2EE Adapter Engine</a>

Everything works fine if I use this module only for file-adapter, but I have to use it for SOAP-Adapter too.

The problem is, when I cast the module data to XIMessage:

msg = (Message) inputModuleData.getPrincipalData();

I get a class cast error.

I notice that the message type for file-adapters is:

com.sap.aii.adapter.xi.ms.XIMessage

When using SOAP-adapter it is:

com.sap.aii.messaging.mo.MessageContext

I do not have any information about this class (no documentation, no jar containing this class). Where can I get this information?

Thanks & regards,

Simon

Accepted Solutions (0)

Answers (1)

Answers (1)

henrique_pinto
Active Contributor
0 Kudos

you're trying to use this module in sender or receiver soap?

Please note that soap sender adapter won't accept modules.

Regards,

Henrique.

Former Member
0 Kudos

Indeed, I try to use this module in a sender soap-adapter.

But why should the soap-sender reject to work with modules?

I have to change the incoming data and I have to save the incoming data separately, so what can I do instead using a module. I have to mention, that the incoming data isn't xml-data and I have to transform it before it can be processed by the XI.

Regards,

Simon

stefan_grube
Active Contributor
0 Kudos

When the incoming data are not XML, use the plain HTTP adapter and do the conversion of the data in a Java mapping.

Regards

Stefan

Former Member
0 Kudos

Hi Henrique,

thank you for your answer.

I wonder why the soap-adapter won't accept modules. Do you know any papers from sap which explain this problem or do you know a paper from sap where I can find which adapters will allow module and which won't accept adapters?

Former Member
0 Kudos

Hi Stefan,

I will test java mappings, maybe it can solve my problem.

Thank you for your answer.

Regards

Simon

bhavesh_kantilal
Active Contributor
0 Kudos

Simon,

Stefan's answer in this thread gives an idea why Sender SOAP adapters do not support modules or rather what needs to be done in case you want to use a Module in a Sender SOAP adapter,

<i>

If you want to use adapter modules for the sender SOAP adapter, you have to consider, that the XI message is created after your self-defined adapter module. So you cannot use standard modules like PayloadSwapBean.</i>

Regards

Bhavesh

stefan_grube
Active Contributor
0 Kudos

Here:

http://help.sap.com/saphelp_nw04/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/frameset.htm

"SOAP Adapter In the sender adapter, you cannot add your own modules."

Regards

Stefan

henrique_pinto
Active Contributor
0 Kudos

> Hi Henrique,

>

> thank you for your answer.

> I wonder why the soap-adapter won't accept modules.

> Do you know any papers from sap which explain this

> problem or do you know a paper from sap where I can

> find which adapters will allow module and which won't

> accept adapters?

Hey Simon, as Stefan has mentioned, you can find that information in help.sap.com's documentation on sender soap adapter.

I'm not sure myself, but from what I understanded of Stefan's comment on the other thread, you could even use module in sender soap, given that you won't use XIMessage object. You could try it, getting Message generic interface, instead of XIMessage interface.

But since it is undocumented, probably you won't get any support from SAP on that (probably the reason why in documentation it simply says "you cant use modules in soap sender").

Regards,

Henrique.

Former Member
0 Kudos

Hi Stefan, Henrique and Bhavesh ,

thanks for your answers. I will try to use Java-Mappings, maybe this can solve my problem.

Regards,

Simon

henrique_pinto
Active Contributor
0 Kudos

Hey Simon,

please close thread if you are satisfied with the answers.

Regards,

Henrique.