Written by: 17 January 2012 14:22
DotNetNuke and web services, they were simple back in the day but things have changed in the .NET framework.
For Web Services mostly you will be told to modify the web.config which for me is a not very nice and another thing to manage when you are deploying your module. With a few lines this can be done in code and is my preferred solution.
One thing to remember is that when you add a Web Reference to your project the IDE will add a web.config file for you. It is not needed for this type of solution and can be deleted.
VB (because it is not dead)
Dim binding As New System.ServiceModel.BasicHttpBinding
Dim endpoint As New System.ServiceModel.EndpointAddress("http://URLTo/TheWebService.asmx")
Dim AliasAdmin As New svcAliasAdminSoapClient(binding, endpoint)
C#
BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
EndpointAddress endpoint = new System.ServiceModel.EndpointAddress("http://URLTo/TheWebService.asmx");
svcAliasAdminSoapClient AliasAdmin = new svcAliasAdminSoapClient(binding, endpoint);
Note: this is just your basic start point but will get you up and running.
0 comment(s) so far...