Options

Calling Web Service from Windows Phone 7

PureHeartPureHeart Member Posts: 190
edited 2011-03-02 in NAV Three Tier
Hi All,

I'm trying to call a NAV web service from Windows Phone 7 with no success ](*,) ](*,) ](*,) ](*,) ](*,) ](*,) ](*,)
I added the Service Reference but then I don't know how to pass the windows credential???
I read alredy Freddy's blog but I cannot understand what I'm missing....
Is anyone able to give me a tip/help???

Please??

Thanks
Why don't you try my compare tool?
http://www.mibuso.com/dlinfo.asp?FileID=1123

Comments

  • Options
    vedant18vedant18 Member Posts: 22
    Hi

    Create 1 files: Login.aspx. it can be accessed without any credentials. You can allow only anonymous access .
    Add To login control in Login.aspx.

    The following code
    Web_Ser.UseDefaultCredentials = False;
    Web_Ser.Credentials = New System.Net.NetworkCredential(Login1.UserName.ToString(), Login1.Password.ToString());
    _________________
    Senior NAV Developer
    Microsoft Dynamics NAV
  • Options
    PureHeartPureHeart Member Posts: 190
    vedant18 that is if you want to call it from a web page...not from Windows Phone 7...in this case it's different....Anyone any help??? Please???? ](*,) :whistle: ](*,) ](*,) ](*,) ](*,)
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • Options
    mikmik Member Posts: 79
    hi,

    for me its working with the information from freddy. But I only did this for testing. NAV is installed on my developer machine. I have no possibility to build a real scenario for this.

    Please read this or better follow the instruction in the video.
    http://blogs.msdn.com/b/freddyk/archive/2010/01/30/web-services-infrastructure-and-how-to-create-an-internal-proxy.aspx

    If your service is running try the following code in WP7.
    You need to add your service reference first.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Microsoft.Phone.Controls;
    using WindowsPhoneApplication5.MyInternalProxyRef;
    
    namespace WindowsPhoneApplication5
    {
        public partial class MainPage : PhoneApplicationPage
        {
            // Konstruktor
            public MainPage()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, RoutedEventArgs e)
            {
                MyInternalProxyClient client = new MyInternalProxyClient();
                client.GetCustomerNameCompleted += new EventHandler<GetCustomerNameCompletedEventArgs>(client_GetCustomerNameCompleted);
                client.GetCustomerNameAsync("10000");
                           
    
            }
    
            void client_GetCustomerNameCompleted(object sender, GetCustomerNameCompletedEventArgs e)
            {
                MessageBox.Show(e.Result);
            }
        }
    }
    

    I have also a question. How can we serve our customers with Windows Phone 7 apps? You can't download the app and think this will work. There much more work to do.

    Please let me know if it this is working for you.

    greetings
    mik

    With kind regards
    mik
  • Options
    PureHeartPureHeart Member Posts: 190
    Yes using the proxy it's the only way to make it work...that's because at this stage windows phone 7 don't support windows authentication...

    What do you mean exactly how to install the app?
    You would have to publish it to the marketplace and let your client download it...
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • Options
    mikmik Member Posts: 79
    Hi,

    yeah I mean that if we publish a WP7 app we will also have to do some modifications in NAV. If I publish my app the client will have to download the Service/Proxy and maybe the modified NAV objects which will be published as webservice.

    But how will Microsoft proof our app? Is the certification process only a codecheck?

    With kind regards
    mik
  • Options
    PureHeartPureHeart Member Posts: 190
    Well,

    If you publish it and you want to address generic customers and not the one you already have then you'll have to specify to contact your company to complete the setup or you would have to have a web site with the rest of the objects needed to make it work...
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
  • Options
    PureHeartPureHeart Member Posts: 190
    Ainsley wrote:
    Maybe you can try to search online I think you can found there some info. But one of my friends tells me about this, if you publish the address into generic customer you need to specify the contact in the company. However, you can set up in some ways that have a web site with some rest of the object that need some work.
    I already said that...
    Why don't you try my compare tool?
    http://www.mibuso.com/dlinfo.asp?FileID=1123
Sign In or Register to comment.