Need to call asmx service from one of my get methods in web api .How can we do that ? Can we add a config entry in appsettings to the asmx service url and call it from the web api get mehod?
web config app settings entry:
key="myOldWebservice" value = "http://testAPI/webservice/client.asmx"/>
Add the asmx service as a Service Reference to your project in VS and call asmx methods from that reference. Just like invoking methods in dlls.
Related
I have to develop a component in .NET to call asmx service(which has user name and password) to send sms. How can i call web service ?
You have to add web reference into your application. Also add a key config for the webservice url and call the same in reference.cs of web proxy class. It will be helpful whenever url of webservice gets change.
Simply add a service reference of the asmx web service you want to call to your project and create an object out of the service and call the method.
I have created a web service as asmx which is running properly. Now I want the service binary in DLL format. How can I generate it?
How can I generate it?
You can't do that. The code behind of the service could be in a separate assembly but the .asmx file itself need to be part of an ASP.NET application which is hosting this service.
I am working on a project where I have a a program or web page which calls a C# Soap Web Service. I need this web service to then call another Web Service. However, I have a problem that when the second soap web service is added to the first web service I get an error 500 page appear saying none of the supported bindings were found.
The second WebService is called Web Reference and I am calling it by using WebReference.BasicHttpBinding_ServiceName.
Thanks for any help you can provide
-> Please Ensure correct binding is used.
-> Add service reference of first service in second service.
-> Ensure the services are up and running.
It should work fine.
How do I extract/get the URL name that is consuming my web service?
For say, i have a .asmx web service, consumed by .aspx web app, in my .asmx code, i need to get that web app's url? Is that any way doable?
You just need to inspect the HTTP request.
HttpContext.Current.Request.UrlReferrer
I have some knowledge about web services and how to add web preferences in the project.
In my project there is a same web services will run on more than two server.
All web services are same just their servers are different.
So is there a way to add web services dynamically? and i can call web services from the server which user specify if there is no web services available then it will return false.
I need to call server dynamically as user specify server name.
Use web service proxy's Url property to set the new url dynamically. Store URL of the web service in your application's parameter table / config file. At runtime always get the web service's Url from that parameter and set it to your web service's Url as destination.
Ok, I'll give an example how to use it. For example let's say we have to add this web service to your project :
http://server1/service1/service.asmx
And then we specify MyService as proxy name to your web service. Then while we use this web service set the Url property like that to specify your proxy's destination :
MyService myService = new MyService();
myService.Url = "http://server2/service1/service.asmx";
myService.GetOrders(customerNo);