cancel
Showing results for 
Search instead for 
Did you mean: 

Using HTTP w/o the HTML test client

Former Member
0 Kudos

Hi Friends,

I am trying a scenario wherein I want to send HTML page form data to XI to RFC. Using HTML Test client I am able to acheive that. Now I wanted it to try it w/o using HTML test client.

I referred to the below URL for that purpose.

Link:[http://help.sap.com/saphelp_nw04/helpdata/en/43/64db4daf9f30b4e10000000a11466f/frameset.htm]

It states I need to specify the URL : http://<hostname:port>/<path>?<query-string>;

I need to know that where should I specify this.

Is it in the HTML page in the form action part?

If yes, I believe it would be hardcoded. Can I avoid hard coding?

What about the payload? Where are its details mentioned?

Please guide.

Regards,

Shiben

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Shiben,

You can do this.

I have send messages from Servlets to XI.

You can directly post it to the pipeline using the URL.

Dynamism of the URL can be acheived using

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(

“http://sap.com/xi/XI/System/HTTP”,

“TargetURL”);

you can use the above code either in mapping /modules

Thanks

Sebin

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello,

which HTML test client have you been using ? There exists a sample HTML page from J.Orb, which posts a message to XI. In this page source content, you can easily see how to post the data to XI. You find that here:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/66dadc6e-0a01-0010-9ea9-bb6d8ca4...

CSY

Former Member
0 Kudos

Hi CSY,

Thanks for your reply. I have already used this test client (the one you and Pradeep have given the link)and was successful in posting xml message from HTTP to RFC.Now I dont want to use this client and want to use direct link. Just like a real time scenario and no xml involvement.

Regards,

Shiben

Former Member
0 Kudos

Hello,

"direct link" ? What is that ? To send data to XI, you have to use an adaper type. You want to use the HTTP adapter, or not ? This is the nomrla choice when you want to send HTML page content to the server. You use HTTP Post. The payload for the HTTP message should be given in XML format, like the example. Why do want to do it other way ?

CSY

Former Member
0 Kudos

Hey

when u use the test client,it will generate a URL for you,give this URL to the sender system and ask them to post data to that URL.

Thanx

Aamir

Former Member
0 Kudos

Hi Aamir,

Thanks for your reply. I tried your way but now I get mapping execute error.

Is that because I am not giving any xml format ?

Regards,

Shiben

Former Member
0 Kudos

>>Is that because I am not giving any xml format ?

yeah,you need to give the correct payload and then give the correct values(interface name,namespace,etc)in the test client.

once all these values are given and the message sent to Integration server(XI),you will get the URL in the bottom.

Just give this URL to sender system and ask them to post to this URL

The role of test client is only to generate the correct URL and do the first time testing,in actual execution(in QA or in Prd) test client won't come into picture at all.

if you are still getting any error you can test the HTTP adapter via TCP Gateway and see if there are any connectivity issues.

/people/stefan.grube/blog/2007/03/29/troubleshooting-soap-http-and-mail-adapter-scenarios-with-tcpgateway

Thanx

Aamir

Former Member
0 Kudos

Hi,

I have specified the following details in HTML form action part :-

http://<xiServer>:<port>/sap/xi/adapter_plain?namespace=<namespace>&service=<service>&QOS=BE&sap-use...

Also the form method is Post.

When I click submit on the html form I get page cannot be displayed. And when I check

in sxmb_moni,I am getting mapping execute error from the sender side.

Mapping trace error shown is :

<Trace level="1" type="T">com.sap.aii.utilxi.misc.api.BaseRuntimeException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 4d, 65, 6d(:main:, row:1, col:3) at com.sap.aii.mappingtool.tf3.Transformer.checkParserException(Transformer.java:187) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:174) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute

-Shiben

Edited by: Shiben Naik on May 19, 2008 12:43 PM

Former Member
0 Kudos

Hello,

again, you NEED to give the payload in XML-format. Otherwise it will not work. Convert your html form values into XML in your JavaScript or back end code, then post it to XI.

Check in XI which XML-format exactly you need for your call (this depends on what you are sending, it is an IDoc, an RFC, a BAPI...)

CSY

Former Member
0 Kudos

I am not allowed to make any changes in the website apart from giving the web team the action link in the form part of the website.

-Shiben

Former Member
0 Kudos

Then you should write a new servlet class which handles the input of this HTML form, and sends it to XI in the input format which is needed from XI. It is probably not a good idea anyway to call XI directy from your Web Application HTML form. Better create a class in your business logic layer which does that.

This class could also handle errors in XI and present them in a way a user hopefully understands

Then enter the URL for you servlet class handler into the HTML form.

CSY

Former Member
0 Kudos
Former Member
0 Kudos

Hi Pradeep,

Thanks for your reply. But as I mentioned I dont require HTML test client.

I have already achieved message transfer using HTML test client. I want to do without it now.

To add, I am not using ant xml messages here. Direct data from html form fields.

Regards,

Shiben

Edited by: Shiben Naik on May 15, 2008 1:02 PM

Former Member
0 Kudos

Hi Cernum,

Thanks for your reply.

I am not configuring sender HTTP comm channel as it not required.

Even if I do, how would the website understand that the data (in the html form)

should be posted to XI?

Regards,

Shiben

Former Member
0 Kudos

Hi,

You need to specify this in your communication channel.

Another possibility is to use adapter specific message attributes. This way you can get the URL from your message payload. You need to enter the URL in the right field of the DynamicConfiguration in your message mapping.

Grtz

Former Member
0 Kudos

Hi,

To clarify further/

Mark the button Adapter specific message attributes in your comm channel, and also mark target URL.

In your mapping create the function:

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(

“http://sap.com/xi/XI/System/HTTP”,

“TargetURL”);

String url = <Target URL>;

conf.put(key, url);

Hope this helps

Former Member
0 Kudos

Thanks Cernum,

But I still feel that the XI details would be required in the website.

Regards,

Shiben