cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic URL creation in Adapter Module

Former Member
0 Kudos

I have a situation in which I need to create a dynamic URL to send data using an HTTP POST ( using HTTPS).

I created an UDF to use Dynamic Configuration, this works fine for the UrlParam in the HTTP CC and the TServerLocation in the SOAP CC.

My issue is that both variables have the same limitation of 200 chars max, and sometimes the URL is longer than 200 chars (I have to pass more than 20 parameters in the URL). The message mapping with the UDF fails whenever I try to put more than 200 chars in the Dynamic Configuration Variables. Therefore I cannot use Dynamic Configuration.

I'm now thinking of creating an Adapter Module which creates an URL out of the XML message passed to the adapter, and use this value to overrule the URL defined in the Communication Channel. The URL field in the Communication Channel does not have a 200 chars limitation.

Does anybody know how to do this? Is it possible to replace the value of the URL field in the Communication Channel with another value in an Adapter Module?

I have to pass the data as parameters in the URL, not as Header fields in the message.

Thanks,

Andre

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Andre,

I was not aware of this length restriction for this dynamic variable ! What kind of exception is raised when passing string > 200 chars ?

Rgds

Chris

Former Member
0 Kudos

Hello Chris,

The error is:

RuntimeException during appliction Java mapping com/sap/xi/tf/_mm_paymentClusterCreate_ Thrown: com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping /ns0:mt_newPaymentClusterData/merchant_name; root message: Exception:[java.lang.IllegalArgumentException: Value is too long (471/200):

It's even in the SAP Help:

http://help.sap.com/saphelp_nwpi711/helpdata/en/48/ce299c3a8e5430e10000000a42189b/frameset.htm

The length of the attribute value is defined by the XI message protocol. Values can be a maximum of 200 characters long. If, for example, you assign longer values in the mapping or adapter modules then this can lead to processing errors at runtime or the values are shortened to 200 characters. This shortening can also lead to a processing error. The processing error that occurs depends on the components that access the attributes.

Former Member
0 Kudos

Right ! I've never seen this statement in the NW'04 online help (*) ... So as you suggested, you may have to write a custom AFW module to bypass this restriction if APIs are available for such purpose ...

What kind of adapter are you using ? SOAP ? Maybe it could be worth check AXIS framework to see if it is possible to implement your need this way (if native module APIs do not allow it)

Chris

(*) : SAP does not specify this length limitation in the corresponding NW 04 online help page (maybe they forgot to, or maybe it does not exist in this release)

Edited by: Christophe PFERTZEL on Nov 26, 2009 11:12 AM

Former Member
0 Kudos

There are old posts on SDN referring to the 200 char limitation, so the documentation must have been updated.

I'm not sure about AXIS or Adapter Modules, I don't have experience with both. But it's worth investigating.

Because I don't have to send a payload it doesn't matter which adapter I use. I can use either the HTTP or the SOAP adapter, as long as it's possible to use a HTTP POST over HTTPS.

Former Member
0 Kudos

I'll have to remember this length restriction, worth knowing it anyway !

Regarding the AFW module, one needs to know if this limitation also exists within the CallAdapter bean ... Because if you write a custom module, but the last one (the one which sends the msg) also has this limitation, it'll be useless So far, I haven't seen any API allowing you to dynamically change the URL attribute of a channel (or any properties) ...

Chris

PS : just found this OSS note : 1039369, contains a lot of Q&A for AXIS framework, especially how to use its own transport handler !

Edited by: Christophe PFERTZEL on Nov 26, 2009 4:15 PM