wsdl.exe / proxy class (help!)

B

Benne Smith

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
 
M

[MVP] SmileSeo

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("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="Service1Soap",
Namespace="http://tempuri.org/")]
public class Service1 : System.Web.Services.Protocols.SoapHttpClientProtocol
{

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

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("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.SoapParameterStyle.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]));
}
}
 
A

Ashwin Kambli

It may be because you have not marked your class myString as "serializable".
[Serializable]
public class myString{
....
}
 
V

Val Savvateev

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.
 

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

Top