I have these two web services:
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";
}
...
}
How do I avoid this? If I have only one reference in my disco file it works
(i.e. doesn't append "Soap") so it seems to be caused by having multiple web
services in the file.
--
Rgd,
Peter Theill