cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP TO RFC

Former Member
0 Kudos

Hi All,

I am working on HTTP to RFC scenario with this blog as reference, it works fine if am testing from the RWB-->integration engine.

/people/community.user/blog/2006/12/12/http-to-rfc--a-starter-kit

But when I want to test it via the http test tool it is not working. I took the html details from this blog and provided the necessary details and clicked the send button. It is not working and it shows the error at the status bar.

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

Regards,

Nithiyanandam

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

use and try http://www.codeplex.com/SapPiHttpClient

also what is the error that you are getting while testing?

Former Member
0 Kudos

Hi,

I am not getting any error message, but looks like when i click on the send button in the status bar of the browser I get as error.

I am not able to install the tool as i am working on a 64-bit processor.

Also the port I am using is 8003 as my system no is 03, is that correct.

I am working on HTTP as sender, So i dont think we require the sender agreement and the sender CC

Regards,

Nithiyanandam

Edited by: Nithiyanandam A.U. on Mar 18, 2009 10:37 AM

Shabarish_Nair
Active Contributor
0 Kudos

you can confirm on the port via

SMICM -> Menu GOTO ->Services

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>I am not getting any error message, but looks like when i click on the send button in the status bar of the browser I get as error.

try from different laptop the same html page

or different browser

you can also try to lower secutiry options on your browser

but did you check SXI_MONITOR ? nothing there?

you can also try quality of service - best effort - just to try if message

is reaching the XI and to see an error back - try it !

Regards,

Michal Krawczyk

former_member181985
Active Contributor
0 Kudos

scripts & activeX controls are not enabled in the browser.

Enable and then execute.

Edited by: Praveen Gujjeti on Mar 18, 2009 3:14 PM

Former Member
0 Kudos

Hi Michal,

I am not getting any error message in SXMB_MONI as the message as not been posted to SAP XI.

I tried with QOS as BE as well, but still I am getting the same error message at the status bar.

Regards,

Nithiyanandam

former_member181985
Active Contributor
0 Kudos

First of all the HTTP client in browser itself is not able to send the data as ActiveX controls and Java Scripts are not enabled.

Enable them and then try.

You can also write a sample HTTP Client in java and can test.

Former Member
0 Kudos

Hi Praveen,

You are right, when I open the saved HTML page in browser it shows "To protect your security, IE has restricted this file from showing active content that could access your computer" but I did enable to allow the blocked content and then sent the message, but still shows the same error.

Regards,

Nithiyanandam

former_member181985
Active Contributor
0 Kudos

This can happen if you dont have adminstration rights in your system. Even if you change the settings in browser it will revert back to old default configuration.

Test the scenario using this java client.............make changes to URL according to your scenario, Compile then run. While running provide the payload in the form of a file.

import java.net.*;
import java.io.*;
import java.util.*;

class HTTPToRFC 
{
public HTTPToRFC() { }

public byte[] read2array(String file) throws Exception 
{
	InputStream in = null;
	byte[] out = new byte[0]; 
	try{
	 in = new BufferedInputStream(new FileInputStream(file));
	 int bufLen = 20000*1024;
	 byte[] buf = new byte[bufLen];
	 byte[] tmp = null;
	 int len    = 0;
	 while((len = in.read(buf,0,bufLen)) != -1){
		tmp = new byte[out.length + len];

		System.arraycopy(out,0,tmp,0,out.length);
		System.arraycopy(buf,0,tmp,out.length,len);
		out = tmp;
		tmp = null;            
 }
}finally{
 if (in != null) try{ in.close();}catch (Exception e){}
}
return out;  
}

public static void main(String[] args) 
{
HTTPToRFC bfr = new HTTPToRFC();

try {

	byte[] b = bfr.read2array(args[0]);
	String data = new String(b);
	URL url = new URL("http://<XISERVERHOSTNAME>:<80XX>/sap/xi/adapter_plain?namespace=<SenderNameSpace>&interface=<SenderInterfaceName>&service=<SenderBusinessSystem>&party=&agency=&scheme=&QOS=BE&sap-user=<USERNAME>&sap-password=<PASSWORD>&sap-client=<CLIENTNUMBER>&sap-language=EN");
	URLConnection conn = url.openConnection();
	conn.setDoInput(true);
	conn.setDoOutput(true);
	
	OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
	wr.write(data);
	wr.flush();

	// Get the response
	BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));

	String line;
	while ((line = rd.readLine()) != null) 
	{
		System.out.println(line);
	}
	wr.close();
	rd.close();


} catch (Exception e) {
	System.out.println("Exception : " + e);
}
}
}

Former Member
0 Kudos

Hi,

I did compile the java code after making the changes, where should i provide the payload.

Regards,

Nithiyanandam

former_member181985
Active Contributor
0 Kudos

In the current directory where exactly your java CLASS file resides.

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

Could yo be more specific, what should I do after compiling the java file. Because I am not able to provide the payload and test the scenario.

Regards,

Nithiyanandam

former_member181985
Active Contributor
0 Kudos

assume that your java file reside in a directory say C:\TEST

Copy your payload into a notepad and save this file into the above directory say "payload.txt"

open command prompt, Change directory to C:\TEST

use these command:

1) javac *.java
2) java HTTPToRFC payload.txt

Former Member
0 Kudos

Hi Praveen,

Thanks a lot. It works. But what could be the problem when I run through that http test tool, do I need to make some settings in my local machine.

Regards,

Nithiyanandam

former_member181985
Active Contributor
0 Kudos

Your company network Administrator has blocked the scripts and activeX controls in browser for security reasons.

There is nothing wrong with standard HTTP client provided by SAP..............

Now can you please close this thread....

GabrielSagaya
Active Contributor
0 Kudos

Please look at these threads and see the reply from Sridhar Natarajan, Robin and stephen

/thread/26215 [original link is broken]

also please try with

http://www.robweb.de/wfetch.zip

former_member181985
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi,

Create Sender communication channel and Sender Agreement.It will work.

Regards,

Prakasu

MichalKrawczyk
Active Contributor
0 Kudos

Hi Prakasu,

>>>Create Sender communication channel and Sender Agreement.It will work.

there is no need for any of those in case of HTTP

Regards,

Michal Krawczyk

JoelTrinidade
Active Contributor
0 Kudos

Hi,

The parameters that you use in the test tool are the cause. please check them thoroughly.

Regards

joel

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

what kind of error ?

did you put correct port 80XX ?

Regards,

Michal Krawczyk