I wrote an asmx webSerivce on srv1.
I wrote a bll project of an asp.net (original text: an asp.net) project on srv2.
Both are hosted under the same web domain
I want to call the asmx from the bll project of the asp.net (original text: asp.net(c#) code behind).
1) I added a web reference, but couldn't find any tutorial how to really call the referenced service.
I have tried:
private void GetTemplateComponentsData()
{
var service = new ServiceReference.GetTemplateParamSoapClient();
TemplateParamsKeyValue[] responsArray = service.GetTemplatesParamsPerId(id);
foreach (var pair in responsArray)
{
TemplateComponentsData.Add(pair.Key, pair.Value);
}
}
but get the following error when executing the first line:
Could not find default endpoint element that references contract 'ServiceReference.GetTemplateParamSoap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.
What am I missing?
2) I plane to migrate the asp.net proj and asmx together from one domain to another.
Is there any way to reference this webservice relatively ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…