Web Service - Publish Console Application as a Web Site

Ravi_ThakkarRavi_Thakkar Member Posts: 392
edited 2009-03-03 in NAV Three Tier
Hi all experts,

In NAV Help Material for Web-Services, one example for printing the Customer List is developed using the Console Application.
So, is it possible to publish that Web Project as a Web Site rather than a *.exe file?

If yes then how?
Please, suggest.

Thanks in Advance.
Ravi_Thakkar
Ahmedabad, Gujarat, India
E Mail : ravi.thakkar@hotmail.com

Answers

  • DenSterDenSter Member Posts: 8,307
    You can't publish a console app as a web site (at least not that I know of). BUT, when you create a new C# project in Visual Studio, you can select ASP.NET Web Application as a template, and you can write code in there that consumes the NAV web service just like you would in a console app.
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hi, Denster,

    Thanks for your reply.
    I got your point. But, by doing that way, if I have published a web service 'CustomerCard' through Navsion and after adding the refference in asp.net web application I do not get the intellisence for 'CustomerCard_Service', while it can be seen in asp.net console application.

    Please, suggest me.
    Thanks in Advance.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • DenSterDenSter Member Posts: 8,307
    That is an interesting issue. I've only worked with console apps so far, so I don't know if there is supposed to be a difference, but I have had problems with setting the wrong type of reference. Did you make sure it was a "web" reference in both projects?
  • freddy.dkfreddy.dk Member, Microsoft Employee Posts: 360
    DenSter is hitting the point here - it looks like you inserted a Service Reference and not a Web Reference.
    Web Reference can be found under Advanced when adding a service Reference in VS2008.
    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.
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hi All,

    Thanks for your replies.
    My problem related to CustomerCard_Service has been solved.
    Actually it was my mistake.

    Actually I had 2 Services References.
    1) System Service
    2) CustomerCard

    I just added this combination of both as a Service reference.
    While I needed to add the reference seperately, one by one.
    After doing so, it is showing me CustomerCard_Service in the intellisence.

    Sorry, for my misunderstandings and thanks to you all.

    Now, for publishing it as a Web Site, I will go in detail and then will revert back if any issue.
    Thanks.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Hi, all

    I created the demo web application successfully.
    But, after publishing that web site, when I host it on our Intranet server, on trying to access it I am geeting error as shown in attached image.
    While I have already added the user in NAV DB in Windows Logins.

    Please, suggest me whether I need to do any task which I forgot or any suggestion?

    Thanks in adv.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
  • Ravi_ThakkarRavi_Thakkar Member Posts: 392
    Related to this post query, My problem has been solved.

    Thanks for your help.
    Ravi_Thakkar
    Ahmedabad, Gujarat, India
    E Mail : ravi.thakkar@hotmail.com
Sign In or Register to comment.