473,394 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

wsdl.exe / proxy class (help!)

hi all,

i have a webservice with some public classes in it. These classes are
visible from my proxy class, generated from wsdl.exe. The problem is, that
when i look in the generated proxy class, my classes are reduced to
properties only (like "public string myString;"). But the code, functions,
are not transferred into the proxy class, which means i have to copy/paste
the code, everytime i update the proxy class (again, using wsdl.exe).

there must be a better way, and i'm sure you know about it ;-)

thanks,

Benne
Nov 15 '05 #1
3 8868
Did you insert "[WebMethod]" in front of method?

for example,

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

following is proxy class that I made.

using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Web.Services.WebServiceBindingAttribute(Nam e="Service1Soap",
Namespace="http://tempuri.org/")]
public class Service1 : System.Web.Services.Protocols.SoapHttpClientProtoc ol
{

/// <remarks/>
public Service1() {
this.Url = "http://localhost/WebService1/Service1.asmx";
}

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://tempuri.o
rg/HelloWorld", RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
public string HelloWorld() {
object[] results = this.Invoke("HelloWorld", new object[0]);
return ((string)(results[0]));
}

/// <remarks/>
public System.IAsyncResult BeginHelloWorld(System.AsyncCallback
callback, object asyncState) {
return this.BeginInvoke("HelloWorld", new object[0], callback,
asyncState);
}

/// <remarks/>
public string EndHelloWorld(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
}

--
--------------

Microsoft .NET MVP from KOREA
"Benne Smith" <do**@write.to.me.directly.com> wrote in message
news:3f**********************@news.dk.uu.net...
hi all,

i have a webservice with some public classes in it. These classes are
visible from my proxy class, generated from wsdl.exe. The problem is, that
when i look in the generated proxy class, my classes are reduced to
properties only (like "public string myString;"). But the code, functions,
are not transferred into the proxy class, which means i have to copy/paste
the code, everytime i update the proxy class (again, using wsdl.exe).

there must be a better way, and i'm sure you know about it ;-)

thanks,

Benne

Nov 15 '05 #2
It may be because you have not marked your class myString as "serializable".
[Serializable]
public class myString{
....
}
"Benne Smith" <do**@write.to.me.directly.com> wrote in message
news:3f**********************@news.dk.uu.net...
hi all,

i have a webservice with some public classes in it. These classes are
visible from my proxy class, generated from wsdl.exe. The problem is, that
when i look in the generated proxy class, my classes are reduced to
properties only (like "public string myString;"). But the code, functions,
are not transferred into the proxy class, which means i have to copy/paste
the code, everytime i update the proxy class (again, using wsdl.exe).

there must be a better way, and i'm sure you know about it ;-)

thanks,

Benne

Nov 15 '05 #3
This is by design. Get your classes into a separate assembly; use it in
both - the web service and the client; remove redefinition of the classes
from the proxy file.

Val.

"Benne Smith" <do**@write.to.me.directly.com> wrote in message
news:3f**********************@news.dk.uu.net...
hi all,

i have a webservice with some public classes in it. These classes are
visible from my proxy class, generated from wsdl.exe. The problem is, that
when i look in the generated proxy class, my classes are reduced to
properties only (like "public string myString;"). But the code, functions,
are not transferred into the proxy class, which means i have to copy/paste
the code, everytime i update the proxy class (again, using wsdl.exe).

there must be a better way, and i'm sure you know about it ;-)

thanks,

Benne

Nov 15 '05 #4

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

Similar topics

3
by: amine | last post by:
Hi, I have created a proxy class from a wsdl document and I want to add it to my project. but the generated proxy class contains packages like system.web that are not supported by the .NET...
1
by: ffhansix | last post by:
Hi, I am having problems with generating a c# proxy class from a IBM websphere WSDL file, when running the wsdl.exe to create the c# proxy file command i recieve an error: Warning: one or...
0
by: amine | last post by:
Hi, I have created a proxy class from a wsdl document and I want to add it to my project. but the generated proxy class contains packages like system.web that are not supported by the .NET...
0
by: Paul Hastings | last post by:
Hi All - I am trying to build a Web Service that can be accessed using an Excel spreadsheet. I have been able to do this for relatively simple access to the Web Service. But now I need to...
1
by: Chenzo | last post by:
I have an issue where the provided .wsdl file is being generated incorrectly with the WSDL.exe tool. I have to use digital client certificates for authentication and it has been determined...by...
4
by: Fabio | last post by:
An ASP.NET 2.0 web site contains a web form and a web service. The web form consumes the web service. There is a Book class in the App_Code folder. The web service exposes a method that returns a...
0
by: jackfrancy | last post by:
Hi , When I tried to create web reference (Proxy Class) from WSDL.EXE or Visual Studio 2003 web Reference Tool Following error has occurred . “The error message from each known type may help...
1
by: ahsan19 | last post by:
Our company is doing a project for the City of Chicago and we are trying to communicate with their servers using web services. Their environment is java based but we are using .NET on our end. The...
1
by: gerom | last post by:
I have created my proxy class from a wsdl file using wsdl /out:myproxy.cs c:\barcodework.wsdl I have imported it into my windows service application written in c# .net and I want to call a...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.