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 ?
Himanshu PatelNavision Consultant(Technical and Functional)Phone No: 09979876474Email : anshpat2826@gmail.com 0
Comments
NAV Freelance Consultant
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com
NAV Freelance Consultant
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com
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 by 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.aspx
Gabor Pesti
“This posting is provided "AS IS" with no warranties, and confers no rights.”
Software Developer Engineer in Test
MSFT
Dynamics NAV
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;
}
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com
http://IPon SERVER:7047/DynamicsNAV/WS/CRONUS_India_Ltd/Page/Customer
Could that be the problem?
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.
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...
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com
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 DOMAIN
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com
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#.
Navision Consultant(Technical and Functional)
Phone No: 09979876474
Email : anshpat2826@gmail.com