on 12-05-2016 12:54 AM
Hi
I have installed B1 HANA Platform and SAP B1 version for HANA PL05, everything went well. I started to test the service layer writing a simple Python application to consume its REST service. In the first tests it was working fine, the Service Layer returned the B1SESSION and ROUTEID, but after a while it stopped to work, the same code that was working before now it is not anymore. I tried to consume the service using Advanced Client Rest (plugin for Chrome) and I got the same result as the Python code.
I tried to restart the Service Layer service, it didn`t work. I also restarted all the SuSE OS but it didn`t work too.
My doubt now is if the Service Layer got some trouble with session management and after I connected several times it didn't manage to sort out the session for the requester anymore.
Request (python)
import requests
import ssl
task = {"CompanyDB": "SBOBRGT", "UserName": "i000001", "Password": "erp@123"}
resp = requests.post('https://xxx.xxx.xx.x:50000/b1s/v1/Login', json=task, verify=False)
print(resp.status_code)
print(resp.content)
Response
Status
500 Internal Server Error Loading time: 2215
Request headers
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
Origin: chrome-extension://bljmokabgbdkoefbmccaeficehkmlnao
Content-Type: application/x-www-form-urlencoded
Accept: */*
Accept-Encoding: gzip, deflate, br
Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: ROUTEID=.node3
Response headers
Date: Mon, 05 Dec 2016 00:38:49 GMT
Server: Apache/2.4.7 (Unix)
DataServiceVersion: 3.0
Content-Type: application/json;odata=minimalmetadata;charset=utf-8
Vary: Accept-Encoding
Content-Encoding: gzip
Connection: close
Transfer-Encoding: chunked
Response Body
{
error: {
code: -1000
message: {
lang: "en-us"
value: "Internal server error."
}
-
}
-
}
import requests
import urllib3import jsonimport configparserYou must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My sample code as below, it works fine to me
Code:
import requests
url = 'https://xxxxx:50000/b1s/v1/Login'headObj = {
"Content-Type":"application/json",
"Connection" : "keep-alive"}
myObj ={
"CompanyDB": "DBName",
"Password": "paxxword",
"UserName": "accountname" }
r = requests .post(url, headers = headObj,verify=False, json=myObj)
print(r.text)
Result:
{ "odata.metadata" : "https://xxxxx:50000/b1s/v1/$metadata#B1Sessions/@Element", "SessionId" : "xxxxxxxxx123456468797978975464", "Version" : "1000130", "SessionTimeout" : 30 }
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A restart of the service layer has fortunately solved the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are currently having this issue after the SAP user (domain user) changed his password:
The login via HTTPS URL fails from the C # application while it works from the Chrome extension "Y.A.R.C".
The login via HTTP-URL and the try of the worker-ports (50001, 500002, 500003 and 500004) showed that only at the last login (with port 500004) works, in the first three we get the error message "-1000" / "Internal server error."
We try it first with a restart of the service layer and will post the result here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have uninstalled Service Layer and installed it again and now it is working.
If someone else have faced this problem and solved in anther way, please share it here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
7 | |
7 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.