We have a third party application that provied its web services to us by ASMX and it is created at the time of .NET 1.1
in the old days we were using VB 6.0 and connected to it by a PocketSOAP, etc...
bt now we want to replace the VB 6.0 with C# 3.5 WinApps and still use that third party web services.
so I wish to know what are my options for doing this? which one do you recommend and which one has a faster learning curve?
Thanks All.
From what I understand, you want to use consume the old web service only and want to replace your client application which was done using VB6.0. You dont have to use WCF here, you can create your client application using Win Forms/WPF. WCF is for providing service and in your case you want a client application.
My opinion will be to use WPF or .net winforms.
I'm not sure what you mean by "which one", what is the other option you're referring to?
But yes, you can use WCF as a client to an .asmx web service.
Just add a service reference like you would to a WCF service. It will use the WSDL to generate a client proxy.
You can use the BasicHttpBinding in WCF to interoperate with legacy services.
Related
I have to develop a Windows Service in .NET/C#. The service must be accessible from a VB6 application.
My first idea was to host a WCF service in a Windows Service, but the VB6 application needs a wrapper for the service to be able to consume it. This is not an option.
Now I'm thinking of using sockets, but is this the best approach? If not, what would be the best design?
I would like to know what my options are, and what are the pros and cons for these options?
Any advice is much appreciated
You can host your WCF services as COM+ applications.
Once you have a WCF service hosted in COM+, you can generate a type library from the COM+ application and then reference that in your VB6 code.
Note that you'll have to have the .NET runtime installed on the machine that the WCF service is hosted on (but not on the machines that you install a COM+ proxy on if using distributed calls).
The WCF service is still an option, but you would have to ensure the WCF configured binding is interoperable (choose BasicHttpBinding for example as seen here: WCF Bindings In Depth).
On the VB6 side, you can call an existing SOAP endpoint, as described here for example: How to Consume a SOAP Web Service in VB6?
I am developing a smart device application, which is going to communicate with a wcf service over wi-fi. As there is no option to add a service reference into a smart device project I decided to use the NetCFSvcUtil.exe. Everything works great!
But...
In the end I understood that the application must interact with the service in the background.
Having read this article Microsoft .NET Compact Framework Background Processing Techniques. I decided to use the Asynchronous Web Service Call. There http://msdn.microsoft.com/ru-ru/library/aa347733.aspx I found the /async parameter, but it appeared to not work for the NetCFSvcUtil.exe.
What can I do to get the async proxy for my smart device application? Is there a way to generate it or I'm expected to add async methods to the interface with my own hands? Maybe it would be suitable for .Net CF to use SvcUtil.exe to generate the async proxy in my case?
A further more information like which platform you are using to build your Smart phone application would be helpful.
I have done Blackberry development and consumed web services. There are two ways you could build your web services
RestFul Service - Consumption of web services would be pretty easy. Posting data could be a little pain as multipart form data is posted as stream in Wcf - Rest Starter Kit
Soap Service - If you decide to use SOAP, then for blackberry and Android you have to use preverified KSOAP -2 to send and receive soap messages between your app and the web service. If you decide to use KSOAP -2 , go back ASMX services. Somehow WCF services does not communicate with KSOAP -2 (due to change in SOAP version or something) where as a simple ASMX service works pretty smoothly. There are dozens of article which you could use to learn how to use KSOAP
he original idea was to host it in a windows service...
Windows Services could never be web facing. If you want any thing to be web facing, you need a Web Server !
In the end it worked. The "Add web reference" tool created a proxy with Begin/End async methods and the proxy interacted with the wcf service hosted by a simple console application (later a windows service) through the URL property of the proxy.
The scenario is like this:
I have a .NET 4.0 client-Server application that works fine.
I need to create a UserControl that can access the Server, but it needs to be created in .NET 2.0 (because customer application is .NET 2.0)
Does it exist a way to access .NET 4.0 WCF service from a 2.0 client?
NOTE:
it is not a Web service, but a standalone .exe server
No autentication used
Data transfered are almost basic (class with arrays and basic types within)
it uses client callbacks so protocol il net.tcp
optionally I can change protocol if I can still be able to use callbacks
You need to expose the WCF as a Web Service:
How to: Expose WCF service also as ASMX web-service
Expose WCF Service as Traditional Style Web Service .asmx
The you work as if it was a good old .asmx service (add reference and so on).
It doesn't matter if your WCF service is hosted in a .exe, a web app, a windows service...
Supporting callbacks is not possible in .NET 2.0 with .asmx services, so that you have to simulate a callbak using something like TcpListener and TcpClient.
Unfortunately this has to de done from scratch, but you can use the logic in the WCF implementation.
If your WCF 4.0 service is using basic http binding, you can use it in .NET 2.0 or in any other language.
Just use WSDL.exe to generate the proxy and use it in .NET or in any other language.
Yes you can use the WCF service in .net 2.0 client by adding the reference of the .cs file (proxy class) in your client project.
Question solved a while ago.
Well, not really solved...
After looking at an article about performance on .NET WCF, I decided to use .NET remoting.
It is faster, compatible native .NET 2.0 and it works.
I'm planning a project which will consist of a Windows Server Application programmed in .Net/C# and Clients programmed in Silverlight/C#, Windows Forms/C# and a MacClient programmed in Cocoa. My Question is, which Webservice technology will be the best for the communication between the Clients and the Server and is the easiest to program in all of those technologies? I've no experience in Webservices and since Time is running short I hope to get some opinions of developers who worked in such a kind of heterogeneous project.
On the back end, you will definitely want to run Windows Communication Foundation, using the WSHttpBinding or the BasicHttpBinding depending on your needs.
This will make it easier to have Windows Forms and Silverlight clients.
Also, because using WCF with those bindings conforms to established standards, you should be able to access the services from almost any other environment - there should be tools that you can just point it to your metadata endpoint and it will generate proxies for you.
Another option is to use WCF to create a REST service (with JSON encoding most likely). WCF does help you a little bit here, but if this is the design you want to use, then you will want to look at ASP.NET MVC on the back end as well, as it makes creating these kind of services very, very easy.
However, when using REST services, there isn't a service description through something like WSDL, so you will have to generate the proxies to call your services by hand (at least, in environments outside of .NET).
The current technology used to develop web services on .NET is WCF. For interoperability with non .NET clients you should consider using basicHttpBinding endpoint. You could even expose multiple endpoints with different bindings, for example expose interoperable endpoint for non .NET clients and some fast binding for .NET clients. Here's a nice article on MSDN covering the performance of the different bindings. Given those keywords you might checkout the tutorials.
I created a service that is hosted on a server that has .Net 3.5 installed and I need to call this service from a client that only has .Net 2.0 installed.
Is there a way I can do this?
If your WCF service exposes an endpoint using basicHttpBinding, then it should be possible for the .NET 2.0 client to consume it. As Marc said, "no problem".
Yes you can do it. There are some caveats, however:
You have to use protocols that match. The standard .NET 2.0 libraries don't support many secure web service features; in fact, you're pretty much stuck with using only basicHttpBinding on the WCF service if you want to be consumed by a default install of .NET 2.0. That is a severe limitation in many enterprise scenarios. However, it may be all you need.
If you need more security but are still using .NET 2.0, there are alternatives. Again, your WCF service must accommodate your .NET 2.0 client, but your .NET 2.0 client will also need to take advantage of an external library. Specifically, you'll need the Web Service Enhancements put out by Microsoft. Keep in mind, however, that these libraries implement a beta version of some SOAP protocols, while WCF (the successor to WSE in many ways) implements the standards by default. Since there were some breaking changes in the protocols (particularly WS-Addressing), you'll have to offer a customBinding endpoint on your WCF service to accommodate.
Unfortunately, I can't tell you which you'll use, as it'll depend on which protocol you want to accommodate on the service, but most of your problems will be solved by changing the messageVersion of the textMessageEncoding for the custom binding. This is not the best scenario, but it could buy you something if you're trying to integrate a client.
Bottom line, there's a lot of work to get a .NET 2.0 client to talk to a WCF service for anything other than basicHttpBinding. In many cases, basicHttpBinding may be enough. For many enterprise scenarios, it will not. I can't speak as to which will help you or not, but it is possible to get it to work -- I've done it successfully.
But it's a big pain. Look for an alternative if you can.
Yes of course - the service being hosted on .NET 3.5 doesn't require the same version of the .NET framework on the client. Heck - you can even call such a service from Java or PHP! That's the whole POINT of Service Oriented Architecture! :-)
You need to define your service contract (what's the service called; what methods are available to be called on it) and you need to decide how to host it, e.g. at what address can you call this service, and what parameters are required (e.g. HTTP vs. TCP, secured or not secured etc.) - that's a lot of work, even in WCF.
Here are three introductory articles for WCF - check them out!
MSDN
CodeProject
Dennis van der Stelt's Blog
But calling that service from a .NET 2.0 client is ABSOLUTELY no problem!
Marc