cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic URL for SOAP receiver adapter

Former Member
0 Kudos

Hey!

I've been looking all over the forum for this issue. What I have seen is many good suggestions, but no one seems to have made this work.

I have tried with message mapping and TServerLocation, but when the scenario is executed, Target URL in the communication channel always overrides the suggested URL from the mapping.

Is is possible to do this dynamic configuration? Do I have to use HTTP adapter and create envelope with mapping instead? Anyone in here actually got this dynamic URL working?

Thanks a bunch!

regards Ole

Accepted Solutions (0)

Answers (6)

Answers (6)

simon_bredel
Explorer
0 Kudos

Hi,

if you use dynamic url with https, the target url in cc has to be set to "https://".

Dear SAP:

Why is this not documented? Had to waste a whole day to find out about this issue/bug.

Former Member
0 Kudos

Thank you for the hint Simon. I was about to waste a lot of time on this too. It's a shame that there is no official SAP documentation.

regards,

Hari

Former Member
0 Kudos

Hello Yugapreetha,

How did you do the mapping?

And did you put in CC Target Url: "http://"? (without the quote's) See my reply couple messages above.

Former Member
0 Kudos

Hello Cengiz,

That issue has been solved..Now I was able to see the dynamic URL in MONI.

But now the error is different Now i'm getting "HTTP 400 request not found".I have raised the thread for the same see the below link:

"

If possible please help me to solve this error.

Thanks & Regards,

yuga

Former Member
0 Kudos

Issue solved!!!

It worked for me by filling "http://" for Target URL in CC.

Tested on:

PI 7.1 SOAP 7.1

XI 3.0 SOAP 6.40

XI 3.0 SOAP 7.00

Here is the code I've used and the CC settings:

//code #############################################

//Get the dynamic configuration from the container

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/SOAP", "TServerLocation");

//Put the url value from the input in the configuration under the specified key

conf.put(key,varURL);

//return the data for mapping to the output

return varURL;

//code #############################################

Connection parameters:

Target URL: http://

[\/] Use Adapter-Specific Mesage Attributes

[\/] Variable Transport Binding

For SOAP adapter above 6.40

Variable Header (XHeaderX): Leave this empty

Former Member
0 Kudos

Hey

Thanks for checking in so late..:) I have resolved the issue you are talking about here, but the problem goes further. I need there to be >10 possible dynamic receivers, but the adapter does initially only give me 10 possible Authorization Keys. I have tried to duplicate the adapter metadata and create my own adapter with >10 Authorization Keys, but that only create problems when activating - probably some cache stuff but don't know (works now and then but not everytime ). Have you had any problems with that as well? I thing it is strange when they give you the opportunity to have only 10 dynamic user-password with no simple way to extend this functionality...

I'll give you the points anyway, nice of you to drop an answer after 3 weeks and I should of course have set the message to answered...

Ole

Former Member
0 Kudos

First of all thanks for the points.

We will be also using more then 10 receivers, but we will do this with cros-component certificates, in this case there will be no user/pw.

Is this an option?

Former Member
0 Kudos

Hi Ole,

My Requirement is like this: Target URL in the communication channel should be overriden by the suggested URL from the mapping.

1. Here is the dynamic URL configuration code:

"

DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey parmValue=DynamicConfigurationKey.create("http:""/""/sap.com/xi/XI/System/SOAP", "TServerLocation");

conf.put(parmValue, SessionUrl);

return "";"

2. In CC -> Adapter Specific message attributes and Variable transport binding fields are checked.

Still I was not able to see the dyanamic cofiguration prameters in moni.

Please help me in that.I think this issue has been solved for you...

Regards,

Yuga

Former Member
0 Kudos

Hey

First thing I notice is this:

You have written : ("http:""/""/sap.com/xi/XI/System/SOAP", "TServerLocation")

Instead of: ("http:/"+"/sap.com/xi/XI/System/SOAP","TServerLocation"). -> Don't think this matters but you can check it out.

In my case I have also used: conf.put(parmValue, targetUrl);

You are using conf.put(parmValue, SessionUrl);

Check these out first. If not, maybe it could be something in the configuration. Tell me if that does not work.

Regards Ole

Former Member
0 Kudos

Hi Ole,

Now also its not working...I was not able to see the Dynamic configuration parameters for the URL in the header.

Yuga

former_member55105
Participant
0 Kudos

Hello Cengiz Aytemir,

I am stuck with a similar issue that you faced earlier. I've configured the scenario as you have suggested (Both the UDF and the CC settings). I've hard coded the Target URL as http://

I can see the dynamic URL set correctly in the MONI but the request that I am sending is not reaching the web service.

Below is the error that I am getting:


<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP:Body>
      <SOAP:Fault>
         <faultcode>SOAP:Server</faultcode>
         <faultstring>Server Error</faultstring>
         <detail>
            <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
               <context>XIAdapter</context>
               <code>RecoverableException</code>
               <text>com.sap.aii.af.ra.ms.api.DeliveryException: XIAdapterFramework:GENERAL:com.sap.aii.af.ra.ms.api.DeliveryException: invalid content type for SOAP: TEXT/HTML
	at com.sap.aii.adapter.xi.ms.XIEventHandler.onTransmit(XIEventHandler.java:453)
	at com.sap.aii.af.ra.ms.impl.core.queue.CallConsumer.onMessage(CallConsumer.java:131)
	at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:834)
	at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)
	at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
	at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)</text>
            </s:SystemError>
         </detail>
      </SOAP:Fault>
   </SOAP:Body>
</SOAP:Envelope>

When I hard code the Target URL as Test, the error that I get is different. (Detailed error shown below)


<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP:Body>
      <SOAP:Fault>
         <faultcode>SOAP:Server</faultcode>
         <faultstring>Server Error</faultstring>
         <detail>
            <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">
               <context>XIAdapter</context>
               <code>RecoverableException</code>
               <text>com.sap.aii.af.ra.ms.api.DeliveryException: XIAdapterFramework:GENERAL:com.sap.aii.af.ra.ms.api.DeliveryException: no scheme
	at com.sap.aii.adapter.xi.ms.XIEventHandler.onTransmit(XIEventHandler.java:453)
	at com.sap.aii.af.ra.ms.impl.core.queue.CallConsumer.onMessage(CallConsumer.java:131)
	at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:834)
	at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)
	at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
	at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)</text>
            </s:SystemError>
         </detail>
      </SOAP:Fault>
   </SOAP:Body>
</SOAP:Envelope>

I am on PI 7.0.

Any help in this regard is highly appreciated.

Best Regards,

Vijay

Former Member
0 Kudos

Hello Ole,

Have you got this working? I've the same problem aswel, also tried it on PI 7.1 without success.

stefan_grube
Active Contributor
0 Kudos

Make sure that you check both attributes in the channel:

- Use Adapter-Specific Mesage Attributes

- Variable Transport Binding

Former Member
0 Kudos

Hey

Jepp that is done. Have you managed to get this working? I've tried with different static URL's just to have something in the mandatory field and the response is always related to the static URL.

I can see in the monitoring that the TServerLocation is set with the correct dynamic URL, but it still does not work..

Ole

stefan_grube
Active Contributor
0 Kudos

Have you checked in SXMB_MONI if there is a dynamit configuration header in the message after the mapping?

It shoul look like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
 <!--  Response  --> 
 <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
  <SAP:Record namespace="http://sap.com/xi/XI/System/SOAP" name="TServerLocation">URL</SAP:Record> 
  </SAP:DynamicConfiguration>

Check for correct spelling.

Regards

Stefan

Former Member
0 Kudos

Hey

Jepp, all of this is in the SOAP header after the mapping. Everything is exactly the same as in your screenshot, except for the URL of course...I cannot see any spelling errors either, as I have copied the url from the browser... Do you have any other suggestions?

regards Ole

Former Member
0 Kudos

Hi Ole,

Why not leaving this field empty if you set it dynamically (I know, this could be a stupid question) ? Do you want to use this adapter in a static and dynamic way ?

Rgds

Chris

Former Member
0 Kudos

Hey!

Thanks for answering. It is not possible to leave this field empty -> cannot save CC. I found a post where it was suggested to have only "http://" in the TargetURL field, but this does not work either...

I want to use this adapter in a dynamic way as there can be up to 400 different endpoints and avoiding all these scenarios would be nice..

Is it maybe possible to set the URL dynamically by writing an adapter module enhancement?

Ole