cancel
Showing results for 
Search instead for 
Did you mean: 

Problem accessing Odata from PB, not from Browser

Former Member
0 Kudos

Hi, I need to access some information from MS Navision using Odata. I have created a DB Profile but test returns an authorization error (401)

I works fine from my computer on Google Chrome, also works from IE but including the domain in the user info.

But does not works from PB with or without the domain.

Please find attached image with browser response and PB error.

Regards

Alfredo Santibáñez

Accepted Solutions (0)

Answers (1)

Answers (1)

CobyKako
Advisor
Advisor
0 Kudos

Hello,

Please read this helpful link: PowerBuilder 15 - OData Support! | SCN

HTH

Jacob

Former Member
0 Kudos

Thanks Jabob, your link was the one I used to make my intital test.

Plesse find next an image of  an outside test for odata without authentication, it works to

http://services.odata.org/V3/Northwind/Northwind.svc/

But with authentication suppling the userid and password, does not.  Please remember that this web service works fine from my browsers.

Is there any way to trace the comunications when I type test Connection on the PB profile setup?

I also made a test using an ODBC driver for odata, from my computer, it works.  There should be no errors on access or firewall

Thanks for your help, Regards, Alfredo

CobyKako
Advisor
Advisor
0 Kudos

Hello Alfredo,

You can use HTTP sniffers such as Fiddler2 or Wireshark to trace the HTTP traffic.

Is asantibanez a Windows user or a user of the data service?

I'm asking this because I'm wondering if you did not make an error choosing option Supply user ID and password instead of Integrated Windows authentication.

I don't think the ODBC connection you made corresponds exactly to the settings issued with the ODT driver, especially for the user and password settings.

Anyway, it is worth trying to see if the below links help to configure a secured Windows authentication with ODATA:

http://blogs.msdn.com/b/odatateam/archive/2010/05/10/odata-and-authentication-part-2-windows-authent...

http://blogs.msdn.com/b/odatateam/archive/2010/05/10/odata-and-authentication-part-1.aspx

Another thing to try with the Windows authentication is to force your IIS box hosting the data service to use the NTLM security scheme:

1. Open iis and select the website that is causing the 401

2. Open the “Authentication” property under the “IIS” header

3. Click the “Windows Authentication” item and click “Providers”

4. Move NTLM at top

Hope this helps,

Jacob

Former Member
0 Kudos

Thanks, it worked with windows authentication.

Now I have a different problem, PB can not read table structure or data.  I reads correctly the list of tables but not the data or the structure if I try to create a DW all fields are varchar(255) not the correct data type.

Any ideas?

Thanks for your help.

CobyKako
Advisor
Advisor
0 Kudos

Glad to read that you have progressed on the issue .

Something to try for this new problem:

a) Obtain the service metadata (EDMX) document of your MS Navision OData web service

http://<Server>:<WebServicePort>/<ServerInstance>/OData/$metadata


How to: Use OData to Return/Obtain a Service Metadata (EDMX) Document

b) Verify that the EntityContainer’s name is not the same as the EntitySet’s name (if those properties exist in the document)

HTH,

Jacob