I need to comunicate with a Server that give me async answers (streamer connection).
I find this:
http://msdn.microsoft.com/en-en/library/ms144211%28v=VS.80%29.aspx
that generate this event:
http://msdn.microsoft.com/en-en/library/system.net.webclient.openreadcompleted%28v=VS.80%29.aspx
I think this is what i need, but i don't have the WebClient class in my System.Net of CompactFramework 3.5.
How can i do?
Thanks.
EDIT: I've done a more clear question:
httpRequest, httpResponse, send GET through Stream and Receive the Result in C#
What you are looking at is .NET desktop framework, and you need .NET CF. It's not clear (for me) what kind of streaming you need. Is it regular HTTP / HTTPS protocol or something more custom? If it's HTTP, you can use HTTP client component of our SecureBlackbox for your needs.
Related
I have a qooxdoo web application which should be able to request data from a WCF web service. The WCF service uses SOAP. I'm currently looking for a way to set up the communication between my qooxdoo application and the WCF web service.
Is there a way to get this done? I saw that qooxdoo is supporting REST and I'm looking for something like a SOAP module in qooxdoo.
Thanks in advance!
There's an ancient contrib, probably unmaintained, at http://svn.code.sf.net/p/qooxdoo-contrib/code/trunk/qooxdoo-contrib/Soap/0.5.1/. You might not be able to use it right away, but I think the source code there will need just a few changes to become usable.
I have been evaluating and working on a prototype where I have exposed couple of API using WCF web service. My service is working as expected with managed client in windows platform. My service client can be on any platform. I dont know how to approach for other platform (UNIX). Couple of options I have considered so far -
GSOAP
MONO dotnet
I could not use any one of these due to some constraints. Now the only option I left out to implement my own client which can send soap request and get soap response. My preferred technology is C/C++. I am using wsHttpBinding in my server and will be working on http protocol only.
I am not sure about the following points-
Do I need to implement my own WSDL parser?
Do I need my own serializer?
How could I make my client more flexible so that any changes in my WSDL make minimal code changes on client side?
I am looking for help from the experts who could guide me with a proper approach with a basic client sample.
My experience is in WCF interoperability with Java clients. You can use Java SOAP libraries like metro http://metro.java.net/ or axis http://axis.apache.org/axis2/java/core/index.html . There is even a C library for axis. http://axis.apache.org/axis2/c/core/
I am sure other languages like Ruby/Python etc has similar libraries as well.
The other option is to use a REST based interface and then you can use any language/platform that has HTTP support or even a tool like curl and libcurl http://curl.haxx.se/.
I have a server/client application developed in Delphi 2006. The client is Win32 and the Server is a .net 1.1 webservice.
We are in the process of updateing this project, but it has to be done in small steps. I started with the server and created a WCF project in VS2010(C# .net 4.0). The first step is to get the server running in WCF without changing the client. So I used the facade pattern, created a similar interface to the old delphi Webservice added a reference to the old .net 1.1 dll and in my implementation I just called the old .net 1.1 code.
Next step updating the proxy class on the client. This failed. The WSDL importer didn't understand the basicHttpBinding correctly, so the proxy class that was genereated couldn't replace the existing proxy.
After a bit of research I found this blog post.
http://kjellsj.blogspot.com/2006/12/how-to-expose-wcf-service-also-as-asmx.html
This worked, the ASMX WSDL was no different than the old .net 1.1 so everything appered ok.
But it wasn't. When testing the new service I discovered that all my parameters was blank/null on the server. I tried with Fiddler on the client and the parameters is present in the XML that is sent to the server.
So I'm stuck. Any thoughts on how to solve this would be much appreciated. Is there any code that could be interresting to see then let me know.
I ran into a similar problem with a web service asmx... certain data was losing their values. If you are using hierarchical data, you may need to declare the internal or inherited objects using an XmlInclude attribute. For example, if you have a User class that is used in your service and a Customer sub class, you may need to declare the Customer class to the service if it is not used directly in a web method. You would do this as follows.
[XmlInclude(typeof(Customer))]
public class Service : WebService
Of course, it may be nothing to do with this, so good luck if that's the case. :)
Confirm that the parameter names in the new service match the names in the old service. If you have changed the parameter names, they will not map from the XML so will be null in the executing code.
Add KnownType attribute to the sub classes
I would like to add an interceptor layer to my WCF service to send the Device ID to authenticate the device.
I am very very new to WCF Interceptors. Before I take all the time to figure them out, I would like to know if they even work with the Compact Framework.
So, do WCF Interceptors work with the Compact Framework and if so are there any special considerations I need to keep in mind as I research them. (Any C# examples of how to do this would be AWESOME!)
I am using Visual Studio 2008 SP1.
I haven't used WCF myself, but a quick glance at this article shows me you need the IChannelFactory and/or IChannelListener classes which are supported on .NET CF 3.5.
The article also has a downloadable sample app, which you probably can modify to run on .NET CF.
So I can't give you any considerations or gotchas, but it looks to me you won't be on a dead end road here.
Interceptors cannot be created on WCF for Compact Framework (NETCF). The IClientMessageInspector and similar constructs needed for interceptors are not present in NETCF.
You can add custom soap headers though. You just have to add them to each WCF Service Call.
I have wirtten a RESTful WCF Service. Incorporating E-Tags, expires headers.
The caching works great when using it from a browser. However how does the caching work when calling it from a WCF Channel Factory or .NET Web Request Objects?
So in the scenario where I have my website calling the WCF restful service when a 304 not modified response is returned to me. How do I handle this. The browser detects this fine and returns the unmodified version from its cache.
However when the client is not the browser do I need to write my own version of the cache similiar to the way the browser caches?
Any help or insight would be much appreciated.
Yes, you're going to have to handle that yourself, same as that you're responsbile for sending the datetime in the request, so the server can determine if there was a change. I would look at the RSS Bandit source for a sample implementation.
We have a sample that illustrates how to do this (using .NET 4) http://code.msdn.microsoft.com/cannonicalRESTEntity