External Secure Web Service Access

ajayjain
Member Posts: 119
Hi,
I am trying to use Centric software web service to get data into nav
web services are secured, user need to login first and should have the session to access various data
I am able to connect but I cannot read various data like customers etc.
Can you please help me, how can I keep connection active between multiple requests
This is on NAV 2009 classic
//THIS IS WORKING FINE
WebURL := 'https://myurl/session';
LoginDetails := //'{""username"": ""Administrator"",""password"": ""abcxyz123""}';
XMLHttp2.open('POST', WebURL, FALSE);
XMLHttp2.setRequestHeader('Content-type','application/json');
XMLHttp2.setRequestHeader('Accept','application/xml');
XMLHttp2.send(LoginDetails);
//NOT WORKING
CatUrl := 'https://myurl/customers';
XMLHttp2.open('GET', CatUrl, FALSE)
XMLHttp2.setRequestHeader('Content-type','application/xml');
XMLHttp2.setRequestHeader('Accept','application/xml');
XMLHttp2.send; //THIS IS GIVING ERROR FOR LOGIN/SESSION
Thanks
I am trying to use Centric software web service to get data into nav
web services are secured, user need to login first and should have the session to access various data
I am able to connect but I cannot read various data like customers etc.
Can you please help me, how can I keep connection active between multiple requests
This is on NAV 2009 classic
//THIS IS WORKING FINE
WebURL := 'https://myurl/session';
LoginDetails := //'{""username"": ""Administrator"",""password"": ""abcxyz123""}';
XMLHttp2.open('POST', WebURL, FALSE);
XMLHttp2.setRequestHeader('Content-type','application/json');
XMLHttp2.setRequestHeader('Accept','application/xml');
XMLHttp2.send(LoginDetails);
//NOT WORKING
CatUrl := 'https://myurl/customers';
XMLHttp2.open('GET', CatUrl, FALSE)
XMLHttp2.setRequestHeader('Content-type','application/xml');
XMLHttp2.setRequestHeader('Accept','application/xml');
XMLHttp2.send; //THIS IS GIVING ERROR FOR LOGIN/SESSION
Thanks
Ajay Jain
UK
UK
0
Answers
-
Try to change the CatUrl:
CatUrl := 'https://myurl/customers?username=Administrator&password=abcxyz123';0 -
this does not work
it returns the seesion id and token id after POS
looks like I have to use this somehow in all my GET requests
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<session><session>centric://SESSION/7950ceb40aa47c946675d2df507a5</session>
<token>centric://_CS_SecurityToken/7950ceb40aa47c9424532xxbe00265695</token></session>Ajay Jain
UK0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions