01-30-2024 12:35 PM - edited 01-30-2024 12:38 PM
Hello everybody,
We are trying to develop a react native application that will use SAP Business one service layer in order to perform some tasks. When i use the https://<ServerIP>:50000 for login i get a general network error. When i use the http://<ServerIP>:50001 i get successful login. Please see below a sample from my login to service layer function. Any idea what could be the issue? Please note we are using self signed certificate.
Thank you in advance.
const sapServiceLayerEndpoint = 'https://<server IP>:50000/b1s/v1';
const LoginServiceLayer = async (companyDB, userName, password) => {
try {
const response = await fetch(`${sapServiceLayerEndpoint}/Login`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
CompanyDB: companyDB,
UserName: userName,
Password: password,
}),
});
// Check for a successful response
if (response.status === 200) {
return true;
} else {
console.error('Login failed. Unexpected response:', response.statusText);
return false;
}
} catch (error) {
return false;
}
};
export default LoginServiceLayer;
I think you can get the error message from the development console of your browser by pressing F12.
BTW, you deploy your code onto a static server and visit your server to run your code?
If so, is your server a http server or https server?
And you also enabled the CORS in Service Layer?
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
9 | |
8 | |
7 | |
6 | |
3 | |
3 | |
3 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.