471,089 Members | 1,094 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 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 8791
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Paul Hastings | last post: by
1 post views Thread by gerom | last post: by

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.