472,328 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

Windows Client for XML Web Service

I have developed my web service with a domain name of my computer name and
wwwroot directory. I also developed a client of windows form application. It
works locally (i.e. in the same machine).

When I copy my client application to another machine and start it, I got an
error about initialized problem.

Note that I can browser my web service .asmx file from the second machine.

The sample client source code:
-----
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Web.Services;
using System.Web.Services.Protocols;
namespace WindowsApplicationWebServices
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Label lbHello;
private System.Windows.Forms.Button btnHello;
private System.Windows.Forms.Button BtnAdd;
private System.Windows.Forms.TextBox txtA;
private System.Windows.Forms.TextBox txtB;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox txtResult;
//Dabin
private WindowsApplicationWebServices.TestWebServiceRef.Te stWebService
ProxyTestWebService;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//

//Dabin
ProxyTestWebService = new
WindowsApplicationWebServices.TestWebServiceRef.Te stWebService();

}

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

#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lbHello = new System.Windows.Forms.Label();
this.btnHello = new System.Windows.Forms.Button();
this.BtnAdd = new System.Windows.Forms.Button();
this.txtA = new System.Windows.Forms.TextBox();
this.txtB = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.txtResult = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// lbHello
//
this.lbHello.Location = new System.Drawing.Point(168, 32);
this.lbHello.Name = "lbHello";
this.lbHello.TabIndex = 0;
//
// btnHello
//
this.btnHello.Location = new System.Drawing.Point(48, 32);
this.btnHello.Name = "btnHello";
this.btnHello.TabIndex = 1;
this.btnHello.Text = "ShowHello";
this.btnHello.Click += new System.EventHandler(this.btnHello_Click);
//
// BtnAdd
//
this.BtnAdd.Location = new System.Drawing.Point(48, 72);
this.BtnAdd.Name = "BtnAdd";
this.BtnAdd.TabIndex = 2;
this.BtnAdd.Text = "Add";
this.BtnAdd.Click += new System.EventHandler(this.BtnAdd_Click);
//
// txtA
//
this.txtA.Location = new System.Drawing.Point(184, 72);
this.txtA.Name = "txtA";
this.txtA.Size = new System.Drawing.Size(56, 20);
this.txtA.TabIndex = 3;
this.txtA.Text = "";
//
// txtB
//
this.txtB.Location = new System.Drawing.Point(264, 72);
this.txtB.Name = "txtB";
this.txtB.Size = new System.Drawing.Size(56, 20);
this.txtB.TabIndex = 4;
this.txtB.Text = "";
//
// label2
//
this.label2.Location = new System.Drawing.Point(248, 72);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(8, 16);
this.label2.TabIndex = 5;
this.label2.Text = "+";
//
// label3
//
this.label3.Location = new System.Drawing.Point(328, 72);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(24, 23);
this.label3.TabIndex = 6;
this.label3.Text = "=";
//
// txtResult
//
this.txtResult.Location = new System.Drawing.Point(352, 72);
this.txtResult.Name = "txtResult";
this.txtResult.Size = new System.Drawing.Size(56, 20);
this.txtResult.TabIndex = 7;
this.txtResult.Text = "";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(512, 250);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.txtResult,
this.label3,
this.label2,
this.txtB,
this.txtA,
this.BtnAdd,
this.btnHello,
this.lbHello});
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void btnHello_Click(object sender, System.EventArgs e)
{
lbHello.Text = ProxyTestWebService.HelloWorld();
}

private void BtnAdd_Click(object sender, System.EventArgs e)
{
txtResult.Text =
System.Convert.ToString(ProxyTestWebService.Add(Sy stem.Convert.ToInt32(txtA.Text.ToString()), System.Convert.ToInt32(txtB.Text.ToString())));
}
}
}
---------

Anyone could give me a help?

Thank you.

David
Nov 19 '05 #1
5 1710
david <da***@discussions.microsoft.com> ha scritto:
When I copy my client application to another machine and start it, I
got an
error about initialized problem.


Firewall? Uri incorrect in the proxy application?

--
AZ [Microsoft - .NET MVP]
Mia Home page: http://ciclismo.sitiasp.it
Asp.Net community: http://www.aspitalia.com
Il mio blog: http://blogs.aspitalia.com/az
Nov 19 '05 #2
No, there is no firewall.

Do I need deploy the client application and install it in the client computer?
Does the client computer need the .NET framework installed?

David

"Andrea Zani" wrote:
david <da***@discussions.microsoft.com> ha scritto:
When I copy my client application to another machine and start it, I
got an
error about initialized problem.


Firewall? Uri incorrect in the proxy application?

--
AZ [Microsoft - .NET MVP]
Mia Home page: http://ciclismo.sitiasp.it
Asp.Net community: http://www.aspitalia.com
Il mio blog: http://blogs.aspitalia.com/az

Nov 19 '05 #3
david <da***@discussions.microsoft.com> ha scritto:
Do I need deploy the client application and install it in the client
computer?
If the URI for the web services is absolute, no.
Does the client computer need the .NET framework installed?
For the windows application is necessary.

David


--
AZ [Microsoft - .NET MVP]
Mia Home page: http://ciclismo.sitiasp.it
Asp.Net community: http://www.aspitalia.com
Il mio blog: http://blogs.aspitalia.com/az
Nov 19 '05 #4
Thanks.
I will try.
You mean that I only need to copy the client .exe file to client machine and
run it, is that right?

"Andrea Zani" wrote:
david <da***@discussions.microsoft.com> ha scritto:
Do I need deploy the client application and install it in the client
computer?


If the URI for the web services is absolute, no.
Does the client computer need the .NET framework installed?


For the windows application is necessary.

David


--
AZ [Microsoft - .NET MVP]
Mia Home page: http://ciclismo.sitiasp.it
Asp.Net community: http://www.aspitalia.com
Il mio blog: http://blogs.aspitalia.com/az

Nov 19 '05 #5
david <da***@discussions.microsoft.com> ha scritto:
Thanks.
I will try.
You mean that I only need to copy the client .exe file to client
machine and run it, is that right?


Yes.

When you create the proxy class, declare the abolsute URI for the web
services.

--
AZ [Microsoft - .NET MVP]
Mia Home page: http://ciclismo.sitiasp.it
Asp.Net community: http://www.aspitalia.com
Il mio blog: http://blogs.aspitalia.com/az
Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dennis Stew | last post by:
How do I access Public variables within a Windows Service? I can, and have, created installed and executed a basic Service. From my client App I...
2
by: Fadi | last post by:
Backround: I am trying to figure out how to do the equivalant of a classic COM Local Server Singleton in .NET/C#. I created a coupld of simple...
2
by: Mark | last post by:
I created an extremely simple windows service that only writes to the EventLogs on Stop and Pause. I installed it using the InstallUtil.exe...
5
by: vinoth | last post by:
Hi, I have created WindowsService Project.In that Project OnStart Method i have written the following Code. In this code the Server is waiting...
1
by: Hank | last post by:
I am writing a windows service in C#.NET which will manage image capturing devices, when client connects to the service, at some point the service...
7
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> ...
4
by: WinDev | last post by:
We are trying to build a system where we have a Windows Service do some manipulation of data, and then sending the data to a Windows App. I had...
0
by: =?Utf-8?B?QWRyaWFuIENvbGU=?= | last post by:
I have written a simple WCF service hosted in a Windows console application and a simple WCF client console application that connects successfully...
3
by: Sylvie | last post by:
My Windows Application has two forms, one form contains a grid (lets say Stock Listing), and the other is a form of one stock, contains some edit...
5
by: Max2006 | last post by:
Hi, I am trying to limit my wcf service endpoint to response to only given windows user or group. How can I do that? Is there any way to...
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.