Web references and AppVerifier

K

Kevin

Hello,

I'm preparing to submit a .Net 1.1 application for a Platform test that
uses a web service. The first time the app creates the proxy object
AppVerifier reports an invalid handle exception. In WinDbg the error
appears to be within the .Net framework code while it is loading the
System.Web.Services.dll.

I've reproduced this behavior with a simple C# test app that has nothing but
a button that constructs the proxy object. The web service I'm referencing
in the test app is the template ASP.Net web service with the sample
"HelloWorld" function uncommented.

Is there any fix or work around for this problem? Is VeriTest going to fail
the app because of it?

Kevin
 
P

Pandurang Nayak

Are you using Windows XP AppVerifier?

Can you paste the sample code?

Pandurang
 
K

Kevin

Pandurang,

I'm using AppVerifier 3.0.0026 which is the version currently available in
the Microsoft Download Center. It is lists Windows XP and Windows Server
2003 as supported platforms. I'm running my test on Windows XP SP2.

As far as sample code goes I created a C# ASP.Net web service and a C#
Windows Application in Visual Studio.Net 2003. In the web service's
Service1.asmx file I uncommented the sample HelloWorld function so the
service1.asmx looks like this:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;

namespace WebService2
{
/// <summary>
/// Summary description for Service1.
/// </summary>
public class Service1 : System.Web.Services.WebService
{
public Service1()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}

#region Component Designer generated code

//Required by the Web Services Designer
private IContainer components = null;

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}

#endregion

// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the
project
// To test this web service, press F5

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}

The Windows application I just added the web reference and added a button to
the form named buttonTest with the following code:
private void buttonTest_Click(object sender, System.EventArgs e)
{
Service1.Service1 test = new Service1.Service1();
MessageBox.Show(test.HelloWorld());
}

Running the test app in WinDbg hits the invalid handle exception before the
message box is displayed.

I've tried this test in Visual Studio 2005 and it works there without any
AppVerifier errors or warnings but moving the actual application will
require significant effort so I don't want to jump to that solution yet.

Kevin
 
P

Pandurang Nayak

Just a hunch - do you connect to the server via a proxy server? VS uses IE
settings, but when you run it from an OS process - such as WinDbg, it is a
different story.

I have never used AppVerifier, but from the download page, I saw this -
"Application Verifier is a runtime verification tool for unmanaged code that
assists in quickly finding subtle programming errors that can be extremely
difficult to identify with normal application testing. "

It clearly says UNMANAGED - and hence should logically not be able to load
..NET Assemblies.

Regards
Pandurang


--
blog: www.thinkingMS.com/pandurang


Kevin said:
Pandurang,

I'm using AppVerifier 3.0.0026 which is the version currently available in
the Microsoft Download Center. It is lists Windows XP and Windows Server
2003 as supported platforms. I'm running my test on Windows XP SP2.

As far as sample code goes I created a C# ASP.Net web service and a C#
Windows Application in Visual Studio.Net 2003. In the web service's
Service1.asmx file I uncommented the sample HelloWorld function so the
service1.asmx looks like this:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;

namespace WebService2
{
/// <summary>
/// Summary description for Service1.
/// </summary>
public class Service1 : System.Web.Services.WebService
{
public Service1()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}

#region Component Designer generated code

//Required by the Web Services Designer
private IContainer components = null;

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}

#endregion

// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the
project
// To test this web service, press F5

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
}
}

The Windows application I just added the web reference and added a button to
the form named buttonTest with the following code:
private void buttonTest_Click(object sender, System.EventArgs e)
{
Service1.Service1 test = new Service1.Service1();
MessageBox.Show(test.HelloWorld());
}

Running the test app in WinDbg hits the invalid handle exception before the
message box is displayed.

I've tried this test in Visual Studio 2005 and it works there without any
AppVerifier errors or warnings but moving the actual application will
require significant effort so I don't want to jump to that solution yet.

Kevin
 
K

Kevin

No proxy servers involved. I don't use one for IE normally and in this case
everythings on the same box. The exception actually occurs before any
connection to the web service is made.

I'm going through the tests described in the March 2006 revision of the
"Microsoft Platform Test for ISV Solutions Application Test Specification"
(http://www.veritest.com/downloads/certification/platform_app_spec.pdf). In
item 2 of the fundamental requirements, "Use Windows resources
appropriately", it says VeriTest uses AppVerifier for the test. AppVerifier
runs with any executable, but in this case its catching issues within the
..Net runtime environment as well as within the managed code. It did flag
several issues I was able to fix.

Since this is now the only resource issue I'm finding I'll try checking with
someone at VeriTest to see if its a known issue there.

Thanks for looking into it,
Kevin.
 
M

mroker

Hi Kevin!

Have you found any solution?

Maybe you know already how VeriTest treats this error?

I cannot go over the same problem :(

Greetings!
 
M

mroker

Hi Kevin!

Have you found any solution?

Maybe you know already how VeriTest treats this error?

I cannot go over the same problem :(

Greetings!
 
M

mr

Hi Kevin!

Have you found any solution?

Maybe you know already how VeriTest treats this error?

I cannot go over the same problem :(

Greetings!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top