cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to Send HTTP Request to XI thru Java Script from EP iView

Former Member
0 Kudos

Hi All,

We have been trying to send HTTP request to XI through JavaScipt from EP iView by using following code (code snippet):

1 var reqString = "a Valid URL";

2 var xhttp = new ActiveXObject("msxml2.xmlhttp");

3 var xhttp = new ActiveXObject("microsoft.xmlhttp");

4 xhttp.open('POST', reqString, false);

5 payload = document.MessageParameters.xmlData.value;

6 xhttp.send(payload);

7 xhttp.close;

When I run the Javascript, I get error at Line 4

stating as " Unspecified Error".

Note: The above file is a simple HTML code being run on EP.

Request to give a suitable solution for the above issue, as we have trying to sort out the same for quite sometime now.

With regards,

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi parag

Try putting the line which throws the error within a try..catch block in your javascript.

cheers

Sameer

Did it help ??

Former Member
0 Kudos

Parag-

I don't think line no. 3 is needed. Can you check?

Also, in your URL specified, you have the password!!. Hope you cleansed it. This is a public forum.

KK

Former Member
0 Kudos

If the error is in line 4, I would suspect the url you are using. Did you correctly encode the request parameters in the url? You need to use %3A for : ,%2F for / and %2E for . when you specify the namespace in the url. You can refer to help.sap.com for further details on encoding:

http://help.sap.com/saphelp_nw04/helpdata/en/82/f4993c03e0cd37e10000000a11405a/frameset.htm

It would be helpful if you give me the exact url that you are using. Also, try using a tool like wfetch with the same post data to debug the problem.

Regards,

Suresh.

Former Member
0 Kudos

Hi Suresh,

Thanks for your response.

We have already used the method that you have mentioned, by refering to the link that you have provided.

Following is the URL:

http://tclecc.ecc.com:8001/sap/xi/adapter_plain?namespace=urn%3Atatachemicals.com%3AKPISYNC&interfac...

Meanwhile, let us know if you have any other solution in mind.

Thank you,

Former Member
0 Kudos

Hi Deepak,

Is 8001 your HTTP service port? Please check your HTTP service port in the ICM monitor. (Transaction smicm and then Go To --> Services) By default, it is 8000.

Regards,

Suresh

Former Member
0 Kudos

Hi Suresh,

Is 8001 your HTTP service port?

Yes, this is our HTTP Sevice port.

Is there any other solution for the issue?

Thanking you in anticipation.

Deepak

Former Member
0 Kudos

You have not encoded a period in the namespace. Try encoding that too -

http://tclecc.ecc.com:8001/sap/xi/adapter_plain?namespace=urn%3Atatachemicals%2Ecom%3AKPISYNC&interf...

Regards,

Suresh.