cancel
Showing results for 
Search instead for 
Did you mean: 

http_rfc

Former Member
0 Kudos

Hi experts,

I am getting below error when i am doing http-rfc. I tried out all the means like RBW test mesg through IE and aslo through http client in this in status bar i am getting error on page. Even i checked all other forms but i didnt find correct answer to my probs

HTTP 401 - Unauthorized</br><p> Ihr SAP Internet Communication Framework Team</p></td></tr></table></body></html>

please help me .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

give the userid the role SAP_XI_APPL_SERV_USER and then rerun your scenario.....moreover userid and password should be correct and the user should not be locked......so ask your basis guys to check it for you.

Regards,

Rajeev Gupta

Former Member
0 Kudos

thank for reply but where to run that role.

Former Member
0 Kudos

Hi,

ask your basis guy to give the above role in XI system where you are testing your scenario.

Regards,

Rajeev Gupta

Former Member
0 Kudos

Hello Rajesh,

As u said yesterday to assign the role, the role is already assigned and the user is not locked but still i am facing the same error since yesterday.

plz help me out.

former_member181985
Active Contributor
0 Kudos

First execute the BAPI from SE37 and what you are getting in response.

check the user name and password in the RFC channel.

Former Member
0 Kudos

Hi,

by giving the above role, you should be able to send a HTTP req msg to XI.......so are you getting a msg in SXMB_MONI for your this HTTP req msg in XI or not?..........i think you will be getting a msg in SXMB_MONI with no error..........now in RWB in component monitoring in adapter engine in comm channel monitoring, are you getting this 401 unauthorized error in your reciver RFC comm channel - if this is the case, then check the user used in the reciver RFC comm channel, this user should be defined in your R/3 system having the roles required for executing RFCs which you can ask your basis guys to do it for you...........

Regards,

Rajeev Gupta

Former Member
0 Kudos

Hi,

i am getting below error when i checked in communication channel monitor.

Receiver channel u2018cc_ariu2019 for party, service u2018arlsapariu2019(internal name u2018RfcClient[cc_ari]u2019)

Client data: {jco.client.lang = EN,jco.client.snc_mode =0,jco.cleint.client=800,

Jco.client.passwd=*****,jco.webas.ignore_jdsr_error_1,jco.client.user=SAPATL2,

JCO.CLIENT.SYSNR=00,JCO.CLIENT.ASHOST=ATLSAPARI}

Respository data: : {jco.client.lang = EN,jco.client.snc_mode =0,jco.cleint.client=800,

Jco.client.passwd=*****,jco.webas.ignore_jdsr_error_1,jco.client.user=SAPATL2,

JCO.CLIENT.SYSNR=00,JCO.CLIENT.ASHOST=ATLSAPARI}

Current pool size:0, maximum poolsize: 1

Former Member
0 Kudos

Hi,

in your reciver RFC channel, you have used user SAPATL2............just change the maximum connections to 5 or 10 or 15................

ask your basis guys to check in SAP ECC R/3 system that user SAPATL2 exists in R/3 system, it should not be locked and it should have the roles required for RFC invokation which they can easily check as there should be some service users in R/3 system which are being used in RFC connection...so ask your basis guys to assign these roles to SAPATL2 user also......

then re-run your scenario..........

Regards,

Rajeev Gupta

Edited by: RAJEEV GUPTA on Apr 8, 2009 10:17 AM

Former Member
0 Kudos

Hi,

Sorry to ask this question once again because I am not getting solution as u said earlier i am getting below error in sxmb_moni after trying all the ways u said moreover i did file to rfc it is working but when http to rfc (BAPI_COMPANYCODE_GETDETAILS) i am getting this error.

HTTP response contains status code 401 with the description Unauthorized Authorization error while sending by HTTP (error code: 401, error text: Unauthorized

XI server is installed for the first time in our company so for basis people aslo it is new.

can u help me out.

former_member181985
Active Contributor
0 Kudos

I think may you dont have permissions to send a message to the inbound plain HTTP adatper.

Can you post the entire error message that you are getting back to HTTP client.

Regds,

- Gujjeti.

Former Member
0 Kudos

hi ,

chk the below thread

[;

Siddhesh

Former Member
0 Kudos

Hi,

Below is the error in sxmb_moni

<SAP:Code area="INTERNAL">HTTP_RESP_STATUS_CODE_NOT_OK</SAP:Code>

<SAP:P1>401</SAP:P1>

<SAP:P2>Unauthorized</SAP:P2>

in sxmb_moni it is displaying two times first time with sender service next time with receiver service but actually both should display at once if i am not wrong.

former_member181985
Active Contributor
0 Kudos

Can you do the following by putting your scenario a side............to investigate the actual issue

create a temporary mapping in IR in between any two message types. create a UDF with the following code. While creating UDF give java.io.;com.sap.aii.mapping.lookup.; in the imports text box.

In below code change this statement "Channel channel = LookupService.getChannel("YourRFCBusinessSyste>" , "YourRFCChannel");" according to your RFC business system and RFC channel.

UDF Code:

String content = "";
MappingTrace importanttrace;
importanttrace = container.getTrace() ;
//Filling the string with our RFC-XML (With Values)
String m = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:BAPI_BANK_GETDETAIL xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"><BANKCOUNTRY>IND</BANKCOUNTRY><BANKKEY>999</BANKKEY></ns0:BAPI_BANK_GETDETAIL>";
 
RfcAccessor accessor = null;
ByteArrayOutputStream out = null;
try
{
//1. Determine a channel (Business System, Communication channel)
Channel channel = LookupService.getChannel("YourRFCBusinessSyste>" , "YourRFCChannel");
 
//2. Get a RFC accesor for a channel.
accessor = LookupService.getRfcAccessor(channel);
 
//3. Create a xml input stream representing the FM request message.
InputStream inputstream = new ByteArrayInputStream(m.getBytes());
 
//4. Create xml Payload
XmlPayload payload = LookupService.getXmlPayload(inputstream);
 
//5. Execute Lookup
Payload result = accessor.call(payload);
InputStream in = result.getContent();
out = new ByteArrayOutputStream(1024);
byte[] buffer = new byte[1024];
for (int read = in.read(buffer); read > 0; read = in.read(buffer)) {
out.write(buffer, 0, read);
}
content = out.toString();
}
catch(LookupException e)
{
importanttrace.addWarning("Error while lookup " + e.getMessage() );
}
catch(IOException e)
{
importanttrace.addWarning("Error " + e.getMessage() );
}
finally
{
if (out!=null) {
try {
out.close();
} catch (IOException e) {
importanttrace.addWarning("Error while closing stream " + e.getMessage() );
}
}
// 7. close the accessor in order to free resources.
if (accessor!=null) {
try {
accessor.close();
} catch (LookupException e) {
importanttrace.addWarning("Error while closing accessor " + e.getMessage() );
}
}
}
//returning the result u2013 RFC-XML.response
return content;

Use the UDF in between one of the source and target fields. Go to Message Mapping Test Tab and click test. Lets know what kind of response you are getting.

Regds,

- Gujjeti.

Former Member
0 Kudos

Hi,

Sorry for deley to give response as our xi server was done. After creating the UDF and testing i am getting this below error

Source code has syntax error: D:/usr/sap/PI7/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapab258c2124ec11de98ec001ec9546bab/source/com/sap/xi/tf/_mm1_.java:3: <identifier> expected import com.sap.aii.mappingtool.tf3.;import com.sap.aii.mappingtool.tf3.rt.;import java.util.;import java.io.; import java.lang.reflect.;import java.io.;import com.sap.aii.mapping.lookup.; ^ D:/usr/sap/PI7/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapab258c2124ec11de98ec001ec9546bab/source/com/sap/xi/tf/_mm1_.java:3: <identifier> expected import com.sap.aii.mappingtool.tf3.;import com.sap.aii.mappingtool.tf3.rt.;import java.util.;import java.io.; import java.lang.reflect.;import java.io.;import com.sap.aii.mapping.lookup.; ^ 2 errors

former_member181985
Active Contributor
0 Kudos

Formatting problem with the post on SDN

Use the following for imports text box:

java.io.*;com.sap.aii.mapping.lookup.*;

Former Member
0 Kudos

after chaning i am getting mapping executed properly

former_member181985
Active Contributor
0 Kudos

paste the entire response payload here.............

former_member181985
Active Contributor
0 Kudos

can you lets know if your issue is resolved and How?

It will help other members who might face the same issue.

Regds,

- Gujjeti.

Answers (0)