Almost a year ago, someone asked the question below and I am running
into the same problem:
I have two web services (code below). If I have only one webservice in
my disco file it works, it works fine. If I have multile web services
in the file, word "Soap" is appended to the classes.
What is the problem here?
Thanks
namespace WebService1 {
[WebService(Namespace="http://microsoft.com/webservices/serv1")]
public class Service1 : System.Web.Services.WebService {
public Service1() {
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
}
}
namespace WebService1 {
[WebService(Namespace="http://microsoft.com/webservices/serv2")]
public class Service2 : System.Web.Services.WebService {
public Service2() {
}
[WebMethod]
public string HelloWorld() {
return "Hello World";
}
}
}
When I add these to a project (using "Web References" from VS.NET) I get a
proxy class such as:
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Web.Services.WebServiceBindingAttribute(Nam e="Service1Soap",
Namespace="http://microsoft.com/webservices/serv1")]
public class Service1 :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {
/// <remarks/>
public Service1() {
this.Url = "http://localhost/WebService1/Service1.asmx";
}
...
}
The proxy class is named "Service1" which is what I want.
Now, if I add my two web services to a "disco" file such as:
<?xml version="1.0" encoding="utf-8" ?>
<discovery xmlns="http://schemas.xmlsoap.org/disco/">
<contractRef
ref="http://localhost/WebService1/Service1.asmx?wsdl"docRef="http://localhost/WebService1/Service1.asmx"
xmlns="http://schemas.xmlsoap.org/disco/scl/" />
<soap address="http://localhost/WebService1/Service1.asmx"
xmlns:q1="http://tempuri.org/" binding="q1:Service1Soap"
xmlns="http://schemas.xmlsoap.org/disco/soap/" />
<contractRef
ref="http://localhost/WebService1/Service2.asmx?wsdl"docRef="http://localhost/WebService1/Service2.asmx"
xmlns="http://schemas.xmlsoap.org/disco/scl/" />
<soap address="http://localhost/WebService1/Service2.asmx"
xmlns:q1="http://tempuri.org/" binding="q1:Service2Soap"
xmlns="http://schemas.xmlsoap.org/disco/soap/" />
</discovery>
Now, the proxy classes appends "Soap" to its class name as shown below:
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Web.Services.WebServiceBindingAttribute(Nam e="Service1Soap",
Namespace="http://microsoft.com/webservices/serv1")]
public class Service1Soap :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {
/// <remarks/>
public Service1Soap() {
this.Url = "http://localhost/WebService1/Service1.asmx";
}
...
}
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Web.Services.WebServiceBindingAttribute(Nam e="Service2Soap",
Namespace="http://microsoft.com/webservices/serv2")]
public class Service2Soap :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {
/// <remarks/>
public Service2Soap() {
this.Url = "http://localhost/WebService1/Service2.asmx";
}
...
}