I've created a web service using Java (Netbeans IDE). The web service is a web service with MySQL database. and now I want to create a client application using C# Windows Form (Visual Studio IDE). I've added a web reference (wsdl link) on a client project. but I am confused about how to display the records from my database on my C# Windows Form.
Need help pleaseee,,, thx before...
You should add a service for get a value in your web service.for example GetData and in c# call the service.
Every service returns a specific type for example List<> or a class like Person.
Related
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.
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...
I am new to using web services. I am assigned a task in which I need to use a web service in my Windows app. This is the web service I would be using:
https://api.betfair.com/global/v3/BFGlobalService.wsdl
Now, I've learned how to add a web reference to this service, but I could not find a basic tutorial that could help me learn how to make an object of this web service and use the service as I want to.
Basicaly, what I need is to create an object from the above web service in my form, and to call it's methods. A C# code snippet would be great.
Can anyone give me some directions? I am working in Visual Studio 2008 and a C# Windows App.
Right click on References
select Add Service Reference
give the wsdl address in the address textbox
click Discover
Give a name for the namespace eg;- BFG
You can access the resources like BFG.MethodName() from you code
I want to realize an interface using HTML5 and bind it to an exisisting C# application. I saw that to realize this application i have to use a WebService , but I don't know how make comunication between the c# application and the page in HTML5. My questions are:
1) How create the webservice in Visual Studio 2010 Express Edition, and where it must be saved
2) How allow the comunication between application, web service and interface
I have already installed and running IIS.
Just make Restful services, whether in WCF or Asp.net MVC
Call those services using Ajax from jquery.
Actually you need to create the service and Access it with Ajax/jquery.
This Page will explain you step for step http://www.codeproject.com/Articles/37727/Prepare-a-JSON-Web-Service-and-access-it-with-JQue
I have a Windows Form Application connected to a database. It does some simple select operations and shows the result on the DataGridView.
I want to send that data on the grid to a web service. I did some research on the Internet about web services and found that I can easily creat a web service, define its methods and use these methods from my Windows Form Application by using Visual Studio 2010. Unfortunately, that is not what I want. I already have a Windows Form Application with some methods in it. All I want is to send the data (xml) to a web service that I created in Visual Studio. How can I do that?
Thanks in advance.
See "How to Consume a Web Service".