cancel
Showing results for 
Search instead for 
Did you mean: 

[Error] - Service Layer access in WCF

Former Member
0 Kudos

Hi experts,

     Just want to ask what is the error for this.


{ "error" : { "code" : -1001, "message" : { "lang" : "en-us", "value" : "Invalid session." } } }

Here's my Service Layer: https://192.168.0.30:50000/b1s/v1/$metadata

See image below:

Here's my setting in my ServiceLayer/conf "b1s.conf"

See image below:

I've already restarted my Service Layer. But still the same.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Although it is a relatively old thread and most likely Bryan found the answer since the time he posted this question, I think that it's worth to post my findings for anyone else who may encounter this type of error.

  1. Check this document by b1dev/BypassBroswerWarning.pdf at master · Ralphive/b1dev · GitHub
  2. Check this document about CORS by

       

Actually I decided to create my own self-signed certificate which required me to issue several commands on the HANA server. I used a guide available here:

Creating a Self-Signed SSL Certificate | Heroku Dev Center

When you decide to create a certificate by yourself you most likely would also like to adjust information about the server and its certificates in the Service Layer config files:

"/usr/sap/SAPBusinessOne/ServiceLayer/conf/httpd-b1s-lb.conf"

"/usr/sap/SAPBusinessOne/ServiceLayer/conf/httpd-b1s-lb-member-50001.conf"

"/usr/sap/SAPBusinessOne/ServiceLayer/conf/httpd-b1s-lb-member-common.conf"

Also increasing the log level might be helpful for tracking the error issue - in configs above.

Check also settings in:

"/usr/sap/SAPBusinessOne/ServiceLayer/lib/Conf/b1-local-machine.xml"

For the CORS issue I decided to use most generic option: "*" for allowed hosts although I think that since SL uses port number 8000 it should be enough to allow only http://<hanaservername>:8000/

In case there is a problem with your username and password I'd suggest using:

"/usr/sap/SAPBusinessOne/ServiceLayer/bin/set-hana-credential"

Good luck!

Kind regards,

Radek

Former Member
0 Kudos

Any help with this and

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Bryan,

Can you please verify the type of reference you are trying to add to your project?

In our example we use "Add Service Reference" but in your screen capture I can see "Add Web Reference"...

Hope this helps,

Trinidad.

Former Member
0 Kudos

Hi ,

     See image below.

Also error in POSTMAN

What do I need to check?

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Brian,

Are you able to access the documentation at:

https://hana_server:50000?

Just to see if Service Layer is really running or not.

You need to be able to see the documentation page + login with Advanced Rest Client or Postman + see the metadata details in Postman/ARC or in the browser before being able to add the reference in .NET.

Regards,

Trinidad.

pedro_magueija
Active Contributor
0 Kudos

Hi Bryan,

Long time ago, Trinidad pointed out that you must login a browser and then you can access the service discovery, and some options must be active.

You can find more here:

Good luck.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Hi ,

     I've already check that blog. But the problem is I cannot access the Service Layer. Is there any thing that I can do?

Regards,

Bry

pedro_magueija
Active Contributor
0 Kudos

Hi Bryan,

IIRC what we were told was that a login needs to be performed with the Service Layer before you can discover the services.

Since you don't have the sample HTML5 app we had, you can try sending a POST request to the login service using something like POSTMAN. This will get you a success token when you login successfully.

After that try again in Visual Studio.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

pedro_magueija
Active Contributor
0 Kudos

Here is an excerpt from the linked pdf. Original here: SAP PartnerEdge


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Hi

     Thanks for this. I've already tried in POSTMAN it is successfully login, but still can't discover in visual studio. The weird part is that, when I directly access the Service Layer in POSTMAN without login in. It can show the result.

Regards,

pedro_magueija
Active Contributor
0 Kudos

Hi Bryan,

Are these properties correctly set in HANA:


Service Layer server needs to be configured with the following properties in the file b1s.conf (located in the Service Layer installation folder ServiceLayer/conf):

  1. "MetadataWithoutSession": true
  2. "WCFCompatible":true


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Yes indeed. Please check this image.

pedro_magueija
Active Contributor
0 Kudos

Hmm.... weird. Did you restart the service layer after changing the options?


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Yes, I've restarted it after the changes. Any other options? Or should we tag Trinidad or Yatsea here?

pedro_magueija
Active Contributor
0 Kudos

Well I'm all out of ideas, so if they can help out it would be great

I'm pretty curious now...

Sorry I couldn't help you further. Good luck.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn