[.NET] Access WebService

kizin
Member Posts: 18
Hello,
I'm trying to connect a Nav 2009 Web services.
I've found some code example on the Internet :
on the line :
if I uncomment the line :
So I try :
Which company name have I to put? It is the French version of Navision.
Thanks,
Yann
I'm trying to connect a Nav 2009 Web services.
I've found some code example on the Internet :
private void button1_Click(object sender, EventArgs e) { NavWSAchat.WSAchat_Service service = new NavWSAchat.WSAchat_Service(); service.UseDefaultCredentials = true; //service.Url = "http://localhost:7047/DynamicsNAV/WS/Page/WSAchat"; NavWSAchat.WSAchat achat = new NavWSAchat.WSAchat(); //creation du filtre List<NavWSAchat.WSAchat_Filter> filterList = new List<NavWSAchat.WSAchat_Filter>(); NavWSAchat.WSAchat_Filter noFilter = new NavWSAchat.WSAchat_Filter(); noFilter.Field = NavWSAchat.WSAchat_Fields.No; noFilter.Criteria = RechercheTextBox.Text; filterList.Add(noFilter); NavWSAchat.WSAchat[] AchatList = service.ReadMultiple(filterList.ToArray(), null, 100); DataTable dt = CreateAchatTable(); DataRow row; foreach (NavWSAchat.WSAchat achatItem in AchatList) { //Création de DataTable et DataRow row = dt.NewRow(); row["No"] = achatItem.No; row["Status"] = achatItem.Status; row["Responsibility_Center"] = achatItem.Responsibility_Center; dt.Rows.Add(row); }
on the line :
NavWSAchat.WSAchat[] AchatList = service.ReadMultiple(filterList.ToArray(), null, 100);I got an error : You must define Path Property before calling Send Method
if I uncomment the line :
service.Url = "http://localhost:7047/DynamicsNAV/WS/Page/WSAchat";I got an error : The supplied Company Name is not valid
So I try :
service.Url = "http://localhost:7047/DynamicsNAV/WS/CRONUS_FRANCE_S_A/Page/WSAchat";I got an error : The supplied Company Name is not valid
Which company name have I to put? It is the French version of Navision.
Thanks,
Yann
0
Answers
-
What is the company name in France (without name mangling)?
(then I can mangle the name for you)
Else there is a function called Companies which can found in the SystemService:
http://localhost:7047/DynamicsNAV/WS/SystemService
In that one you should get a list of the companies using the following code:SystemService svc = new SystemService(); svc.UseDefaultCredentials = true; foreach (string company in svc.Companies()) { MessageBox.Show(company); }
But.... - I just found out that you need to have the company in the path to call that function too - I see that as a bug.
So - what is the name of french Cronus?Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
The name is "Cronus France S.A."
I'll try your piece of code tomorrow.
thx for the reply.
Yann0 -
Your name mangling looks correct - but it is Case Sensitive.
Cronus_France_S_A
should be right - if CRONUS indeed isn't capitalized.Freddy Kristiansen
Group Program Manager, Client
Microsoft Dynamics NAV
http://blogs.msdn.com/freddyk
The information in this post is provided "AS IS" with no warranties, and confers no rights. This post does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion.0 -
I tried this morning.
Effectively, it is case sensitive... and it was my problem.
thanks a lot
Yann0 -
Hello,
I have exactly the same problem as you with the company "CRONUS France S.A.". Did you find the correct writing for the URL ?
I'm trying to add web reference in visual studio 2008 but i can't.
Thank you for your help.0
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