L
Luis Arvayo
Hi,
My app is a general purposes app and not a specific one.
This means that customer who bought the application can have a web service
placed on the server on any given URL.
I use the wsdl tool to create the service class, but the reference to the
url is hard coded inside the class.
What is the correct way to implement the web service with a parameterized
URL address in such a way that end user of the app can define it?
Example of my class where you can see the hard coded url:
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="SolverServiceSoap",
Namespace="http://localhost/SolverService/")]
public class SolverService :
System.Web.Services.Protocols.SoapHttpClientProtocol {
/// <remarks/>
public SolverService() {
this.Url = http://localhost/SolverService/SolverService.asmx;
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost/SolverService/Close,
RequestNamespace="http://localhost/SolverService/",
ResponseNamespace="http://localhost/SolverService/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void Close() {
this.Invoke("Close", new object[0]);
}
.....
Thanks in advance.
My app is a general purposes app and not a specific one.
This means that customer who bought the application can have a web service
placed on the server on any given URL.
I use the wsdl tool to create the service class, but the reference to the
url is hard coded inside the class.
What is the correct way to implement the web service with a parameterized
URL address in such a way that end user of the app can define it?
Example of my class where you can see the hard coded url:
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="SolverServiceSoap",
Namespace="http://localhost/SolverService/")]
public class SolverService :
System.Web.Services.Protocols.SoapHttpClientProtocol {
/// <remarks/>
public SolverService() {
this.Url = http://localhost/SolverService/SolverService.asmx;
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://localhost/SolverService/Close,
RequestNamespace="http://localhost/SolverService/",
ResponseNamespace="http://localhost/SolverService/",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void Close() {
this.Invoke("Close", new object[0]);
}
.....
Thanks in advance.