Navision and .net Integration

anshpat2826
Member Posts: 44
Hello,
I worked on navision and net c#.
I already make project which is working fine on the same computer where navision is installed but while accessing
web service over network it shows error while Invoking method.
and error type is Inner Exception : 401 Not Authorized.
Any one can help me on this?
did i missed some thing about security ?
I worked on navision and net c#.
I already make project which is working fine on the same computer where navision is installed but while accessing
web service over network it shows error while Invoking method.
and error type is Inner Exception : 401 Not Authorized.
Any one can help me on this?
did i missed some thing about security ?
Himanshu Patel
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com
0
Comments
-
Have you checked the firewall settings? You might need to add NAV (fin.exe) in the firewall._____________________
NAV Freelance Consultant0 -
I checked firewall setting but still the same error..Himanshu Patel
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com0 -
It seems like you're missing to authenticate yourself, this is usaually done in the soap header._____________________
NAV Freelance Consultant0 -
You are asking about crenditial.Himanshu Patel
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com0 -
Hi,
I am a bit confused: Someone recommended to add fin.exe (Client of the old stack) to the firewall, while the topic opener referred to Web Services, a functionality of the new 3 tier architecture. (Service executable is Microsoft.Dynamics.Nav.Server.exe - service name MicrosoftDynamicsNavWS by default). So if the root cause is some firewall rule then you should check the later has enough right.
If the problem is in the .NET client (which I do not think so since on the same machine it worked fine) then byws.UseDefaultCredentials = true;
you can get it to forward the current credentials to the service.
Where I would look for the issue is verifying whether there is some difference between the identity of the client running on the Local Machine or in the remote configuartion. Is it really the same user who tries to connect in the two case?
Finally there might be some problem related to delegation settings: http://msdn.microsoft.com/en-us/library/ee414212.aspxRegards,
Gabor Pesti
“This posting is provided "AS IS" with no warranties, and confers no rights.”
Software Developer Engineer in Test
MSFT
Dynamics NAV0 -
No both are different user ...
public NAVPageServiceHelper Get_Cust()
{
Assembly PageRef;
PageRef = NAVPageDynamicWebReference.BuildAssemblyFromWSDL(new Uri("http://anshu-pc:7047/DynamicsNAV/WS/CRONUS_India_Ltd/Page/Customer"), 200000);
serviceHelper = new NAVPageServiceHelper(PageRef, "Customer");
return serviceHelper;
}
this is uri when i am using my own computer and see this one
public NAVPageServiceHelper Get_Cust()
{
Assembly PageRef;
PageRef = NAVPageDynamicWebReference.BuildAssemblyFromWSDL(new Uri("http://IPon SERVER:7047/DynamicsNAV/WS/CRONUS_India_Ltd/Page/Customer"), 200000);
serviceHelper = new NAVPageServiceHelper(PageRef, "Customer");
return serviceHelper;
}Himanshu Patel
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com0 -
I can see you have a space in the server name in
http://IPon SERVER:7047/DynamicsNAV/WS/CRONUS_India_Ltd/Page/Customer
Could that be the problem?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 -
This is just test name
actuallly there is no space .
See i am explaining my problem ..
Assembly PageRef;
PageRef = NAVPageDynamicWebReference.BuildAssemblyFromWSDL(new Uri
("http://anshu-pc:7047/DynamicsNAV/WS/CRONUS_India_Ltd/Page/Customer"), 200000);
serviceHelper = new NAVPageServiceHelper(PageRef, "Customer");
return serviceHelper;
I modified the dynamicpagewebreferance:
public static Assembly BuildAssemblyFromWSDL(Uri webServiceUri, int timeout)
{
ICredentials _Credntial = new System.Net.NetworkCredential("test", "xxxxx", "");
//server credintial
//ICredentials _Credntial = new System.Net.NetworkCredential("anshu", "anshu", "");
if (String.IsNullOrEmpty(webServiceUri.ToString()))
throw new Exception("Web Service Not Found");
WebRequest request = WebRequest.Create(webServiceUri.ToString());
request.Method = "GET";
request.ContentType = "text/xml";
request.Timeout = timeout;
// request.UseDefaultCredentials = false;
request.Credentials = _Credntial;
WebResponse response = request.GetResponse();
XmlTextReader xmlreader = new XmlTextReader(response.GetResponseStream());
ServiceDescriptionImporter descriptionImporter = BuildServiceDescriptionImporter(xmlreader);
return CompileAssembly(descriptionImporter);
}
I set credintial according to my computer now i changed :
PageRef = NAVPageDynamicWebReference.BuildAssemblyFromWSDL(new Uri
("http://servername:7047/DynamicsNAV/WS/CRONUS_India_Ltd/Page/Customer"), 200000);
Case 1.> still i did not changed my ID and Password so it will give error at (this is b cos i still did not set credintial as server PC)
WebResponse response = request.GetResponse();
Case 2 .> Now i change credintial as server ID and password then error occured while reading data from NAV. so from this i got my credintial are verified.
public object[] ReadMultiple(ArrayList filterArrayList)
{
return (object[])this.readMultipleMethod.Invoke(this.service, new object[] { filterArrayList == null ? null : filterArrayList.ToArray(this.filterType), null, 100 });
}
Sir I dont have domain on my computer is it problem.
I am daily accessing your blog its awesome thanks for helping...Himanshu Patel
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com0 -
The server is NOT part of a domain?
ANS : Yes, Both Machine are working in separate work group, no domain
You are trying to connect to a web service listener on that machine?
ANS : YES
Both SQL Server AND middle tier is on that server?
ANS : YES
You can see http://server:7047/DynamicsNAV/WS/SystemService on the server?
ANS : YES, This services are visible but it requires windows authentication of machine where services are available.
You are running 2009 RTM (NOT SP1)?
ANS : YES, WE ARE WORKING ON 2009 RTM
Have you tried specifying the server name as domain in new
NetWorkCredential(user, pwd, domain)?
ANS : WE ARE PASSING USER NAME AND PASSWORD, NOT DOMAINHimanshu Patel
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com0 -
I also tried SERVER Computer name as domain parameter but i got same errorHimanshu Patel
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com0 -
I can post my project zip file on mibuso if any one want send me message i will send link to download the project.Himanshu Patel
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com0 -
Ok done
Problem i am facing is solved.
Thanks all who has posted reply and also those who visit the post.
Any one need any kind of information i will provide.
you can also pm to me regarding web service integration to java and c#.Himanshu Patel
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com0
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