Hi All,
Having listened the following great materials:
http://community.dynamics.com/nav/b/nav ... -2013.aspxhttp://community.dynamics.com/nav/b/nav ... -2013.aspx
I have been trying to apply either approach to a Windows Phone (OS 7.1) application. Unfortunately to no avail.
There is no 'Transport' in Security class.
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
I changed the code of my application to use async data access but it fails on above mentioned line.
private void CreateCustomer()
{
var binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
var orderpc = new SalesOrderService_PortClient(
binding,
new EndpointAddress("
http://localhost:8067/DynamicsNAV70/WS/CRONUS UK Ltd/Codeunit/SalesOrderService"));
orderpc.ClientCredentials.UserName.UserName = "user";
orderpc.ClientCredentials.UserName.Password = "password";
orderpc.ReadSalesOrdersCompleted +=
new EventHandler<ReadSalesOrdersCompletedEventArgs>(orderpc_ReadSalesOrdersCompleted);
orderpc.ReadSalesOrdersAsync(sales);
MessageBox.Show(sales.Order[0].Customer);
}
It works very well in Windows Forms application but unfortunately fails in Windows Phone/Silverlight one.
Please, help ](*,)
Cheers,
Igor
Comments
I have not done this for Windows Phone, but have you tried to use Web Reference instead of Service Reference ?
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com
WebReferences are disabled in Windows Phone due to asynchronous processing.
Cheers,
Igor
Cheers,
Igor.
We have a client that has a Nav 2009 R2 implementation and we have published a number of web services which they connect to using some tablet PC's. However, the tablets are used in a warehouse environment and are getting damaged. The client would like to replace these with some Windows Phone 8.1 handheld devices with built in scanners.
Microsoft have given us 2 routes here in terms of development. WinRT and Windows Phone (Silverlight). Neither of these allow us to simply add a web reference to the web services and we must use a service reference. The WinRT route does not even allow us to simply add a service reference either. However, I found a great article by Freddy on how to connect to Navision Web Services using Silverlight 3 at the link below. Unfortunately, this falls short in that it does not cover authenticating with the web service at run time, by setting the credentials for the web service. I suspect that Silverlight 3 and either the current version of Silverlight or the Windows Phone version are a little different.
http://blogs.msdn.com/b/freddyk/archive ... ght-3.aspx
I also found a YouTube video on how to asynchronously call Navision web services but the .Net Framework options in this video don't appear to be included in the Windows Phone (Silverlight) solutions I can build. I suppose it's worth mentioning here that I am building my Windows phone application using Visual Studio 2013.
Using Freddy's blog, I was able to get to the point where my application gave me a 401 error which makes me think that once I get the authentication part sorted out, I might be well on my way to getting past this hurdle.
I would like to know if anyone else has Web Services working with a Windows Phone 8.1 (Silverlight) application and if they could assist me.
Thanks,
Karl