Calling a C# web service from another C# web service - c#

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.

Related

Is it possible to call windows service or process from Web Application?

I want to call my custom windows service running on particular client machine from my Web application on button click. How can I do this?
I got the solution and it works. Please find below steps.
Created Self-Hosted WCF service that call window services/processes
Call this WCF service from your web application
Please find below link for more details:
https://techinqueincsharp.blogspot.com/2019/05/open-clients-machine-local-file-from.html

Consume SOAP Webservice in UWP

I'm trying to consume SOAP Web Service information added in "Services References" and in Java or in a type Forms project, it works perfectly.
I tried to do the same in UWP, but the web methods are all asynchronous and I am not realize the call of the same.
The customer was created in WSO2 studio using JDBC.
Can anyone give help on how to consume a SOAP service in the WSDL address was added to the "Service References"?
Thank you

Creating and consuming a web service to call a method with Visual Studio 2015 and c#

I am new to web service developing. I am experimenting on creating a backend for an app (which by the way is a Windows 10 Universal App). What I am trying to do is very simple: I want my app to ask the service to do something, after which the service runs some code and returns something. In other words I want to call a method defined in the service, from my app.
I have found tons of guides on this but they all date back to the early 2000's and use technologies that are now deemed obsolete.
What I managed to do so far
I created a new Web Site (File->New->New Web Site) using the WCF service template (Visual C#, .Net framework 4), added a Web service ASMX to it (right click on project->Add->Add New Item->Web Service (ASMX) ), then I added some webmethods to the .cs file associated to the webservice.
[WebMethod]
public void MyVoidFunction() { //Do something }
Then, in my app, I added a service reference to the webservice (right click on references -> Add service reference -> insert the localhost address up to .asmx -> click Go -> assign a namespace -> click ok). Now I can do something in my app with my webservice:
ServiceReference1.WebServiceSoapClient obj = new ServiceReference1.WebServiceSoapClient();
await obj.MyVoidFunctionAsync();
Notice that ServiceReference1 is the namespace I assigned to the webservice when I added the reference in my app.
This actually runs MyVoidFunction(). However I cannot directly call the method obj.MyVoidFunction() and I cannot call non void functions and get their return values.
The questions
How should have I created the web service? Is asmx the right template for what I need to do? If not, can someone provide some documentation on how to do this, because everything I found refers to asmx and dates back to before 2010.
Is there any way to directly call the methods defined in my webservice without using await and the autogenerated FunctionNameAsync() method?
You are finding so old documentation because web services implementations are really old and there's no news on this.
If you are making a Windows 10 app, you should stick with newer technologies and it should be an JSON API.
Try to find documentation about how to create an API with WebApi, Azure has an product for that (http://azure.microsoft.com/en-us/services/api-management/).
In your Windows 10 app use HttpClient to consume this API with NewtonSoft.Json to serialize and deserialize your objects.

No discovery information when use php webservice with C#

I got some critical problem when I just try to use php web service with C# windows form application..
My Problem is that Normally when I want to add web reference in my local pc and the web service is running in asp.net
I can add the web reference and work with It but when I try to add a web reference whic is build in php I got thid error....
Add reference button is inactive and...
Show the message....
The HTML document does not contain Web service discovery information.
It shows all methods of my php webservice ...
But what can I do now...
Please Help any One...

Can I generate proxy objects for WCF service library using scriptmanager?

I have used the AJAX Enabled WCF Service template from within a web application. By adding a Service reference to the scriptmanager, some client objects are generated allowing me to easily consume the service. My question is can I do anything like that when I use a WCF Service Library? I added the project to my solution and in my web app I added a service reference to the service. This is where I get a bit stuck. What do I do now to allow consuming the service from the client.
So, just to consume wcf service, you have to use "svcutil" app from VS pack to generate o proxy class, which is very simple in usage.

Categories