Navision acess problem through Web Service

liquid_dream
Member Posts: 8
Hi
I've built a solution that connects to an ODBC data source.
The data source is from a native Navision 4.0 database.
I've been able to do this through a Windows Application project.
The problem starts when i try to do the same through an ASP .NET Web Service.
When i invoke the method that connects to the data source Internet Explorer
tries to load the page and continues to load and load and load.
If I stop and run the project again an error appears:
"Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web browser
to retry your request.
Administrator Note: An error message detailing the cause of this specific
request failure can be found in the application event log of the web server.
Please review this log entry to discover what caused this error to occur. "
The error that appears in Event Viewer is
"aspnet_wp.exe (PID: 2024) stopped unexpectedly."
The Event ID is 1000.
If i try using an ODBC that connects to an Access database the Webservice
works fine, so believe it must be something about the time the Navision Data
source takes to open (Using Windows Aplication takes about 20 seconds).
The code is this
[WebMethod]
public string getName(){
string connstring = "DSN=navision";
OdbcConnection conn = null;
OdbcCommand cmd =null;
string val = null;
string query = "select N§,\"Alias Nome\" from Cliente where \"Alias
Nome\" like 'GDE%'";
OdbcDataReader read = null;
try
{
conn = new OdbcConnection(connstring);
conn.Open();
cmd = new OdbcCommand(query,conn);
read =cmd.ExecuteReader();
while(read.Read())
{
val="ID: " + read.GetString(0);
val= val + " Name: " + read.GetString(1) + "<->";
}
return val;
conn.Close();
}
catch(Exception ex)
{
conn.Close();
return ex.Message;
}
}
After using breakpoints i detected that the Web Service hangs on conn.Open().
Can someone shine some light?
I wonder if anyone has had this problem.
Thanks
I've built a solution that connects to an ODBC data source.
The data source is from a native Navision 4.0 database.
I've been able to do this through a Windows Application project.
The problem starts when i try to do the same through an ASP .NET Web Service.
When i invoke the method that connects to the data source Internet Explorer
tries to load the page and continues to load and load and load.
If I stop and run the project again an error appears:
"Server Application Unavailable
The web application you are attempting to access on this web server is
currently unavailable. Please hit the "Refresh" button in your web browser
to retry your request.
Administrator Note: An error message detailing the cause of this specific
request failure can be found in the application event log of the web server.
Please review this log entry to discover what caused this error to occur. "
The error that appears in Event Viewer is
"aspnet_wp.exe (PID: 2024) stopped unexpectedly."
The Event ID is 1000.
If i try using an ODBC that connects to an Access database the Webservice
works fine, so believe it must be something about the time the Navision Data
source takes to open (Using Windows Aplication takes about 20 seconds).
The code is this
[WebMethod]
public string getName(){
string connstring = "DSN=navision";
OdbcConnection conn = null;
OdbcCommand cmd =null;
string val = null;
string query = "select N§,\"Alias Nome\" from Cliente where \"Alias
Nome\" like 'GDE%'";
OdbcDataReader read = null;
try
{
conn = new OdbcConnection(connstring);
conn.Open();
cmd = new OdbcCommand(query,conn);
read =cmd.ExecuteReader();
while(read.Read())
{
val="ID: " + read.GetString(0);
val= val + " Name: " + read.GetString(1) + "<->";
}
return val;
conn.Close();
}
catch(Exception ex)
{
conn.Close();
return ex.Message;
}
}
After using breakpoints i detected that the Web Service hangs on conn.Open().
Can someone shine some light?
I wonder if anyone has had this problem.
Thanks
0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions