473,574 Members | 3,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Collecti ons;
using System.Componen tModel;
using System.Windows. Forms;
using System.Data;
using System.Web.Serv ices;
using System.Web.Serv ices.Protocols;
namespace WindowsApplicat ionWebServices
{
/// <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 WindowsApplicat ionWebServices. TestWebServiceR ef.TestWebServi ce
ProxyTestWebSer vice;
/// <summary>
/// Required designer variable.
/// </summary>
private System.Componen tModel.Containe r components = null;

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

//
// TODO: Add any constructor code after InitializeCompo nent call
//

//Dabin
ProxyTestWebSer vice = new
WindowsApplicat ionWebServices. TestWebServiceR ef.TestWebServi ce();

}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Disp ose();
}
}
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 InitializeCompo nent()
{
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.SuspendLay out();
//
// lbHello
//
this.lbHello.Lo cation = new System.Drawing. Point(168, 32);
this.lbHello.Na me = "lbHello";
this.lbHello.Ta bIndex = 0;
//
// btnHello
//
this.btnHello.L ocation = new System.Drawing. Point(48, 32);
this.btnHello.N ame = "btnHello";
this.btnHello.T abIndex = 1;
this.btnHello.T ext = "ShowHello" ;
this.btnHello.C lick += new System.EventHan dler(this.btnHe llo_Click);
//
// BtnAdd
//
this.BtnAdd.Loc ation = new System.Drawing. Point(48, 72);
this.BtnAdd.Nam e = "BtnAdd";
this.BtnAdd.Tab Index = 2;
this.BtnAdd.Tex t = "Add";
this.BtnAdd.Cli ck += new System.EventHan dler(this.BtnAd d_Click);
//
// txtA
//
this.txtA.Locat ion = new System.Drawing. Point(184, 72);
this.txtA.Name = "txtA";
this.txtA.Size = new System.Drawing. Size(56, 20);
this.txtA.TabIn dex = 3;
this.txtA.Text = "";
//
// txtB
//
this.txtB.Locat ion = new System.Drawing. Point(264, 72);
this.txtB.Name = "txtB";
this.txtB.Size = new System.Drawing. Size(56, 20);
this.txtB.TabIn dex = 4;
this.txtB.Text = "";
//
// label2
//
this.label2.Loc ation = new System.Drawing. Point(248, 72);
this.label2.Nam e = "label2";
this.label2.Siz e = new System.Drawing. Size(8, 16);
this.label2.Tab Index = 5;
this.label2.Tex t = "+";
//
// label3
//
this.label3.Loc ation = new System.Drawing. Point(328, 72);
this.label3.Nam e = "label3";
this.label3.Siz e = new System.Drawing. Size(24, 23);
this.label3.Tab Index = 6;
this.label3.Tex t = "=";
//
// 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.AutoScaleB aseSize = new System.Drawing. Size(5, 13);
this.ClientSize = new System.Drawing. Size(512, 250);
this.Controls.A ddRange(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.ResumeLayo ut(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.EventArg s e)
{
lbHello.Text = ProxyTestWebSer vice.HelloWorld ();
}

private void BtnAdd_Click(ob ject sender, System.EventArg s e)
{
txtResult.Text =
System.Convert. ToString(ProxyT estWebService.A dd(System.Conve rt.ToInt32(txtA .Text.ToString( )), System.Convert. ToInt32(txtB.Te xt.ToString())) );
}
}
}
---------

Anyone could give me a help?

Thank you.

David
Nov 19 '05 #1
5 1806
david <da***@discussi ons.microsoft.c om> 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***@discussi ons.microsoft.c om> 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***@discussi ons.microsoft.c om> 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***@discussi ons.microsoft.c om> 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***@discussi ons.microsoft.c om> 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
2290
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 can Start, Stop...etc the service.... What I want to do is to read properties that are in the service. for instance if the service had a Propertie or Public variable like Public Int Myint =...
2
7269
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 Class Libs that exposes public interfaces and hosted them in a Windows Forms EXE. Create a Windows Forms client and both the Client and the Host EXEs configure the remoting protocols through...
2
21873
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 program, the output of which is below. It appears to be successful. I'm now ready to start my service (I think) but the NET START command does not appear to indicate that the service is available to be...
5
4260
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 for the connection from client. When the Client connects to the Server, the server will process and send result to the client.(This is Client Server Application. The Server side Code is implementd...
1
2420
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 need to expose a device dialog to the client for setting some device specific parameters. According to MSDN docs, classes within the Windows Forms namespace are not supported for use within a...
7
3201
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> How can I get the users (client) IP-Address ? I think the username can be read with user.identity.name.
4
3987
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 posted a question of how we should do this and was told remoting was the way to go. So I got a client and a server program up and going and from the client I can call a routine in the server...
0
8261
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 to that service and retrieves data. I then ported the console application to WinForms and also got that to work properly. My next move was to host the WCF service in a Windows service application....
3
7041
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 boxes for one stock's fields.. Is it possible to run application remotely and retrieve grid and form data in some way without accessing directly to database server? Web Services is being used...
5
9138
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 configure that in the .config file? Thank you, Max
0
7842
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7764
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8110
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8273
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8138
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5658
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5336
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1375
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.