Webservice error
nightrod
Member Posts: 68
Hi,
i have build a webapplication using nav webservices.
when i run the application with the visual studio 2010 debugger it works fine.
when i publish it to the web and run it i get this error:
The code using the webservice in VS looks like this:
why is it reffering to a file on the local disk of the Visual studio designer??
Who can help me :-k
i have build a webapplication using nav webservices.
when i run the application with the visual studio 2010 debugger it works fine.
when i publish it to the web and run it i get this error:
Server Error in '/' Application.
The request failed with HTTP status 403: Forbidden.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The request failed with HTTP status 403: Forbidden.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The request failed with HTTP status 403: Forbidden.]
System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) +1484609
System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +221
NavWeb.WS_SalesInv.WS_SalesInvoice_Service.ReadMultiple(WS_SalesInvoice_Filter[] filter, String bookmarkKey, Int32 setSize) in C:\Users\JR\Documents\Visual Studio 2010\Projects\NavWeb\NavWeb\Web References\WS_SalesInv\Reference.cs:195
NavWeb.WebForm1.LoadDataGrid() in C:\Users\JR\Documents\Visual Studio 2010\Projects\NavWeb\NavWeb\WebForm1.aspx.cs:20
NavWeb.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Users\JR\Documents\Visual Studio 2010\Projects\NavWeb\NavWeb\WebForm1.aspx.cs:39
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
The code using the webservice in VS looks like this:
private void LoadDataGrid()
{
// Initialize the Service
WS_Page_SalesInvHeader.WS_SalesInvoice_Service MySalesInvoicesService = new WS_Page_SalesInvHeader.WS_SalesInvoice_Service();
MySalesInvoicesService.UseDefaultCredentials = true;
//Read Records
WS_Page_SalesInvHeader.WS_SalesInvoice[] Invoices = MySalesInvoicesService.ReadMultiple(null, null, 0);
//Fill Grid
GridView1.DataSource = Invoices;
GridView1.DataBind();
if (GridView1.Columns.Count > 0)
GridView1.Columns[0].Visible = false; //Key
else
{
GridView1.HeaderRow.Cells[0].Visible = false;
foreach (GridViewRow gvr in GridView1.Rows)
{
gvr.Cells[0].Visible = false;
}
}
}
why is it reffering to a file on the local disk of the Visual studio designer??
Who can help me :-k
0
Comments
-
I think that it is referring the file because it is compiled with debug info.
Question is, why the request is "Forbidden". How looks your infrastructure? Where is the NST? Where SQL? Where is the Web application published? May be the problem is SPN and delegation...0 -
The navision server is on a small business server.
the .net website consuming the webservices is on an external hosted server.
Maybe its because the visual studio development machine is inside the domain it is working and the webserver is outside it doesnt work?
How can i configure it in the right way.
Thanx for your reply!0 -
You need to change your code
MySalesInvoicesService.UseDefaultCredentials
needs to be changedNetCredentials = new NetworkCredential(); NetCredentials.UserName = UserName; NetCredentials.Password = password; NetCredentials.Domain = domain; MySalesInvoicesService.Credentials = NetCredentials;
NetCredentials is System.net.NetWorkCredentials0 -
Hi Rashed,
Works great!!!!
=D> =D> =D>
your up for mvp2011.
Thanx,
Johan0 -
You are welcome.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 252 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions

