Search Results

Search found 22762 results on 911 pages for 'wcf client'.

Page 27/911 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • HttpClient 4 SSL and client side certificates

    - by Luke
    Hi All, I am having trouble working out how I can get get HttpClient 4 to use SSL in the way I need. I have X https servers that I send requests to. One requires a client side certificate while the others have trusted certificates and therefore require no client side certificate. I have no issue connecting to the server requiring the client side certificate (its in my keystore), however every time I try to connect to the servers with trusted certificates, my client side certificate is offered by HttpClient and therefore fails authentication. My question is this: is there a way for HttpClient to offer the client side certificate only to the server requiring it and not to the others? Thanks in advance, Luke

    Read the article

  • Getting error detail from WCF REST

    - by Keith
    I have a REST service consumed by a .Net WCF client. When an error is encountered the REST service returns an HTTP 400 Bad Request with the response body containing JSON serialised details. If I execute the request using Fiddler, Javascript or directly from C# I can easily access the response body when an error occurs. However, I'm using a WCF ChannelFactory with 6 quite complex interfaces. The exception thrown by this proxy is always a ProtocolException, with no useful details. Is there any way to get the response body when I get this error? Update I realise that there are a load of different ways to do this using .Net and that there are other ways to get the error response. They're useful to know but don't answer this question. The REST services we're using will change and when they do the complex interfaces get updated. Using the ChannelFactory with the new interfaces means that we'll get compile time (rather than run time) exceptions and make these a lot easier to maintain and update the code. Is there any way to get the response body for an error HTTP status when using WCF Channels?

    Read the article

  • Forms authentication, ASP.NET MVC and WCF RESTful service

    - by J F
    One test webserver, with the following applications service.ganymedes.com:8008 - WCF RESTful service, basically the FormsAuth sample from WCF Starter Kit Preview 2 mvc.ganymedes.com:8008 - ASP.NET MVC 2.0 application web.config for service.ganymedes.com: <authentication mode="Forms"> <forms loginUrl="~/login.aspx" timeout="2880" domain="ganymedes.com" name="GANYMEDES_COOKIE" path="/" /> </authentication> web.config for mvc.ganymedes.com: <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" domain="ganymedes.com" name="GANYMEDES_COOKIE" path="/" /> </authentication> Trying my darndest, a GET (or POST for that matter) via jQuery's $.ajax or getJson does not send my cookie (according to Firebug), so I get HTTP 302 returned from the WCF service: Request Headers Host service.ganymedes.com:8008 User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729) Accept application/json, text/javascript, */* Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive Referer http://mvc.ganymedes.com:8008/Test Origin http://mvc.ganymedes.com:8008 It's sent when mucking about on the MVC site though: Request Headers Host mvc.ganymedes.com:8008 User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.8) Gecko/20100202 Firefox/3.5.8 (.NET CLR 3.5.30729) Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language en-us,en;q=0.5 Accept-Encoding gzip,deflate Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive 300 Connection keep-alive Referer http://mvc.ganymedes.com:8008/Test Cookie GANYMEDES_COOKIE=0106A4A666C8C615FBFA9811E9A6C5219C277D625C04E54122D881A601CD0E00C10AF481CB21FAED544FAF4E9B50C59CDE2385644BBF01DDD4F211FE7EE8FAC2; GANYMEDES_COOKIE=D6569887B7C5B67EFE09079DD59A07A98311D7879817C382D79947AE62B5508008C2B2D2112DCFCE5B8D4C61D45A109E61BBA637FD30315C2D8353E8DDFD4309 I also put the exact same settings in both applications' web.config files (self-generated validationKey and decryptionKey).

    Read the article

  • Project setup for an ADO.NET/WCF DataService

    - by Slauma
    I'd like to implement a ADO.NET/WCF DataService and I am wondering what's the best way to setup a project in VS2008 SP1 for this purpose. Currently I have an ASP.NET web application project (not of "WebSite" project type). The data access layer is an Entity model (EF version 1) with SQL Server database. I have the Entity Model in a separate DLL project and the web application project references to this assembly for all data accesses. The ADO.NET/WCF DataService needs to communicate with the Entity model/database as well. It has to be hosted on the same web server (IIS 7.5) together with the web application. Since the DataService is not directly related to that specific web application (though it will provide and modify data from/in the same database the web application uses as well) my basic idea was to separate the DataService in its own new project (which also references the Entity Model DLL). Now I have seen that there is no project type "ADO.NET/WCF DataService" in VS2008 SP1. It seems only possible to add a DataService as an element to other existing projects, for instance Web Application projects. Why isn't there a separate DataService project type? Does this mean now that I have to add the DataService as an element to my Web Application project? Or shall I create a new Web Application project and add a DataService to it? (I could delete the pregenerated default.aspx since I do not need any web pages in this project.) What's the best way? Thank you for suggestions in advance!

    Read the article

  • Informational messages returned with WCF involved

    - by DT
    This question is about “informational messages” and having them flow from a “back end” to a “front end” in a consistent manner. The quick question is “how do you do it”? Background: Web application using WCF to call back end services. In the back end service a “message” may occur. Now, the reason for this “message” may be a number of reasons, but for this discussion let’s assume that a piece of data was looked at and it was determined that the caller should be given back some information regarding it. This “informational” message may occur during a save and also may occur during retrieval of information. Again, the message is not what is important here, but the fact that there is some informational messages to give back under a number of different scenarios. From a team perspective we all want to return these “messages” in a standard way all of the time. Now, in the past this “standard way” has been done different ways by different people. Here are some possibilities: 1) Every operation has a “ref” parameter at the end that contains these messages 2) Every method returns these messages… however, this only kind of works for “Save” methods as one would think that “Retrieve” methods should return actual data and not messages 3) Some approach using the call context so as to not "pollute" all message signatures with something; however, with WCF in the picture this complicates things. That is, going back to the messages go on a header? Question: Back to my question then… how are others returning “messages” such as what was described above back through tiers of an application, over WCF and back to the caller?

    Read the article

  • Autocomplete Extender with WCF Service

    - by BrunoSalvino
    I'm trying to use Ajax Control Toolkit's Autocomplete extender with a WCF Service. This question is almost what I'm looking for, one of the answers points to a tutorial but I can't get it to work. In my solution I have a web form application project and a WCF service library project. One of the properties of the Autocomplete extender is ServicePath which the tutorial points to a svc file: <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> <asp:TextBox runat="server" ID="myTextBox" Width="300" autocomplete="off" /> <ajaxToolkit:AutoCompleteExtender runat="server" BehaviorID="AutoCompleteEx" ID="autoComplete1" TargetControlID="myTextBox" ServicePath="Autocomplete.svc" ServiceMethod="GetCompletionList" MinimumPrefixLength="0" CompletionInterval="1000" EnableCaching="true"> </ajaxToolkit:AutoCompleteExtender> </div> </form> Right now in ServicePath I'm pointing to the http address (http://localhost:8731/Design_Time_Addresses/WebApp.WcfServiceLibrary/ProductService/) that my WCF Service is running, but it just don't works.

    Read the article

  • Deserializing a FileStream on Client using WCF

    - by Grandpappy
    I'm very new to WCF, so I apologize in advance if I misstate something. This is using .NET 4.0 RC1. Using WCF, I am trying to deserialize a response from the server. The base response has a Stream as its only MessageBodyMember. public abstract class StreamedResponse { [MessageBodyMember] public Stream Stream { get; set; } public StreamedResponse() { this.Stream = Stream.Null; } } The derived versions of this class are actually what's serialized, but they don't have a MessageBodyMember attribute (they have other base types such as int, string, etc listed as MessageHeader values). [MessageContract] public class ChildResponse : StreamedResponse { [DataMember] [MessageHeader] public Guid ID { get; set; } [DataMember] [MessageHeader] public string FileName { get; set; } [DataMember] [MessageHeader] public long FileSize { get; set; } public ChildResponse() : base() { } } The Stream is always a FileStream, in my specific case (but may not always be). At first, WCF said FileStream was not a known type, so I added it to the list of known types and now it serializes. It also appears, at first glance, to deserialize it on the client's side (it's the FileStream type). The problem is that it doesn't seem to be usable. All the CanRead, CanWrite, etc are false, and the Length, Position, etc properties throw exceptions when being used. Same with ReadByte(). What am I missing that would keep me from getting a valid FileStream?

    Read the article

  • WCF service returns error 500 on /js request

    - by Cine
    I have a wcf service that randomly begins to fail when requesting the autogenerated javascript that wcf supports making. But I have no luck tracking down why. The js thing is part of the wcf featureset, so I dont know how it can suddenly begin to fail and be unable to work until IIS is recycled. The http log gives me: 2010-06-10 09:11:49 W3SVC2095255988 myip GET /path/myservice.svc/js _=1276161113900 80 - ip browser 500 0 0 So its an error 500, and that is about the only thing I can figure out. The event log contains no information. Requests to /path/myservice.svc works just fine. After recycling IIS it works again, and some days later it begins to fail until I recycle IIS. <service name="path.myservice" behaviorConfiguration="b"> <endpoint address="" behaviorConfiguration="eb" binding="webHttpBinding" contract="path.Imyservice" /> </service> ... <endpointBehaviors> <behavior name="eb"> <enableWebScript /> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name="b"> <dataContractSerializer maxItemsInObjectGraph="2147483647" /> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> I dont see any problems in the web.config settings either. Any clues how I can track down what the problem is?

    Read the article

  • Call WCF Service Through Javascript, AJAX, or JQuery

    - by obautista
    I created a number of standard WCF Services (Service Contract and Host (svc) are in separate assemblies). I fired up a Web Site in IIS to host the Services (i.e., address is http://services:1000/wcfservices.svc). Then in my Web Site project I added the reference. I am able to call the services normally. I am needed to call some of the services client side. Not sure if I should be looking at articles calling WCF services through AJAX, JQuery, or JSON enabled WCF Services. Can anyone provide any thoughts or experience with configuring as such? Some of the changes I made was adding the following to the Operation Contract: [OperationContract] [WebInvoke(Method = "POST", UriTemplate = "SetFoo")] void SetFoo(string Id); Then this above the implementation of the interface: [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] Then in the service webconfig I have this (parens are angle brackets): <serviceHostingEnvironment aspNetCompatibilityEnabled="true"> <baseAddressPrefixFilters> <add prefix="http://services:1000/wcfservices.svc/"/>> </baseAddressPrefixFilters> </serviceHostingEnvironment> <serviceHostingEnvironment multipleSiteBindingsEnabled="false" /> Then in the client side I attempted this: <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"> <compositeScript> <Scripts> <asp:ScriptReference Path="http://Flixsit:1000/FlixsitWebServices.svc" /> </Scripts> </CompositeScript> </asp:ScriptManagerProxy> I am attempting to call the service like this in javascript: wcfservices.SetFoo(string Id); Nothing is working. If it is idea or a better solution to call JSON enable, JQuery, etc....I am willing to make any changes. Thanks for any suggestions/tips provided....

    Read the article

  • Need help with WCF design

    - by Jason
    I have been tasked with creating a set of web services. We are a Microsoft shop, so I will be using WCF for this project. There is an interesting design consideration that I haven't been able to figure out a solution for yet. I'll try to explain it with an example: My WCF service exposes a method named Foo(). 10 different users call Foo() at roughly the same time. I have 5 special resources called R1, R2, R3, R4, and R5. We don't really need to know what the resource is, other than the fact that a particular resource can only be in use by one caller at a time. Foo() is responsible to performing an action using one of these special resources. So, in a round-robin fashion, Foo() needs to find a resource that is not in use. If no resources are available, it must wait for one to be freed up. At first, this seems like an easy task. I could maybe create a singleton that keeps track of which resources are currently in use. The big problem is the fact that I need this solution to be viable in a web farm scenario. I'm sure there is a good solution to this problem, but I've just never run across this scenario before. I need some sort of resource tracker / provider that can be shared between multiple WCF hosts. Any ideas from the architects out there would be greatly appreciated!

    Read the article

  • Multiple WCF calls for a single ASP.NET page load

    - by Rodney Burton
    I have an existing asp.net web application I am redesigning to use a service architecture. I have the beginnings of an WCF service which I am able to call and perform functions with no problems. As far as updating data, it all makes sense. For example, I have a button that says Submit Order, it sends the data to the service, which does the processing. Here's my concern: If I have an ASP.NET page that shows me a list of orders (View Orders page), and at the top I have a bunch of drop down lists for order types, and other search criteria which is populated by querying different tables from the database (lookup tables, etc). I am hoping to eventually completely decouple the web application from the DB, and use data contracts to pass information between the BLL, the SOA, and the web app. With that said, how can I reduce the # of WCF calls needed to load my "View Orders" page? I would need to make 1 call get the list of orders, and 1 call for each drop down list, etc because those are populated by individual functions in my BLL. Is it good architecture to create a web service method that returns back a specialized data contract that consists of everything you would need to display a View Orders page, in 1 shot? Something like this pseudocode: public class ViewOrderPageDTO { public OrderDTO[] Orders { get; set; } public OrderTypesDTO[] OrderTypes { get; set; } public OrderStatusesDTO[] OrderStatuses { get; set; } public CustomerListDTO[] CustomerList { get; set; } } Or is it better practice in the page_load event to make 5 or 6 or even 15 individual calls to the SOA to get the data needed to load the page? Therefore, bypassing the need for specialized wcf methods or DTO's that conglomerate other DTO? Thanks for your input and suggestions.

    Read the article

  • How do I setup Linq to SQL and WCF

    - by Jisaak
    So I'm venturing out into the world of Linq and WCF web services and I can't seem to make the magic happen. I have a VERY basic WCF web service going and I can get my old SqlConnection calls to work and return a DataSet. But I can't/don't know how to get the Linq to SQL queries to work. I'm guessing it might be a permissions problem since I need to connect to the SQL Database with a specific set of credentials but I don't know how I can test if that is the issue. I've tried using both of these connection strings and neither seem to give me a different result. <add name="GeoDataConnectionString" connectionString="Data Source=SQLSERVER;Initial Catalog=GeoData;Integrated Security=True" providerName="System.Data.SqlClient" /> <add name="GeoDataConnectionString" connectionString="Data Source=SQLSERVER;Initial Catalog=GeoData;User ID=domain\userName; Password=blahblah; Trusted_Connection=true" providerName="System.Data.SqlClient" /> Here is the function in my service that does the query and I have the interface add the [OperationContract] public string GetCity(int cityId) { GeoDataContext db = new GeoDataContext(); var city = from c in db.Cities where c.CITY_ID == 30429 select c.DESCRIPTION; return city.ToString(); } The GeoData.dbml only has one simple table in it with a list of city id's and city names. I have also changed the "Serialization Mode" on the DataContext to "Unidirectional" which from what I've read needs to be done for WCF. When I run the service I get this as the return: SELECT [t0].[DESCRIPTION] FROM [dbo].[Cities] AS [t0] WHERE [t0].[CITY_ID] = @p0 Dang, so as I'm writing this I realize that maybe my query is all messed up?

    Read the article

  • Testing for interface implementation in WCF/SOA

    - by rabidpebble
    I have a reporting service that implements a number of reports. Each report requires certain parameters. Groups of logically related parameters are placed in an interface, which the report then implements: [ServiceContract] [ServiceKnownType(typeof(ExampleReport))] public interface IService1 { [OperationContract] void Process(IReport report); } public interface IReport { string PrintedBy { get; set; } } public interface IApplicableDateRangeParameter { DateTime StartDate { get; set; } DateTime EndDate { get; set; } } [DataContract] public abstract class Report : IReport { [DataMember] public string PrintedBy { get; set; } } [DataContract] public class ExampleReport : Report, IApplicableDateRangeParameter { [DataMember] public DateTime StartDate { get; set; } [DataMember] public DateTime EndDate { get; set; } } The problem is that the WCF DataContractSerializer does not expose these interfaces in my client library, thus I can't write the generic report generating front-end that I plan to. Can WCF expose these interfaces, or is this a limitation of the serializer? If the latter case, then what is the canonical approach to this OO pattern? I've looked into NetDataContractSerializer but it doesn't seem to be an officially supported implementation (which means it's not an option in my project). Currently I've resigned myself to including the interfaces in a library that is common between the service and the client application, but this seems like an unnecessary extra dependency to me. Surely there is a more straightforward way to do this? I was under the impression that WCF was supposed to replace .NET remoting; checking if an object implements an interface seems to be one of the most basic features required of a remoting interface?

    Read the article

  • What goes between SQL Server and Client?

    - by worlds-apart89
    This question is an updated version of a previous question I have asked on here. I am new to client-server model with SQL Server as the relational database. I have read that public access to SQL Server is not secure. If direct access to the database is not a good practice, then what kind of layer should be placed between the server and the client? Note that I have a desktop application that will serve as the client and a remote SQL Server database that will provide data to the client. The client will input their username and password in order to see their data. I have heard of terms like VPN, ISA, TMG, Terminal Services, proxy server, and so on. I need a fast and secure n-tier architecture. P.S. I have heard of web services in front of the database. Can I use WCF to retrieve, update, insert data? Would it be a good approach in terms of security and performance?

    Read the article

  • Unable to get data from a WCF client

    - by Scott
    I am developing a DLL that will provide sychronized time stamps to multiple applications running on the same machine. The timestamps are altered in a thread that uses a high performance timer and a scalar to provide the appearance of moving faster than real-time. For obvious reasons I want only 1 instance of this time library, and I thought I could use WCF for the other processes to connect to this and poll for timestamps whenever they want. When I connect however I never get a valid time stamp, just an empty DateTime. I should point out that the library does work. The original implementation was a single DLL that each application incorporated and each one was synced using windows messages. I'm fairly sure it has something to do with how I'm setting up the WCF stuff, to which I am still pretty new. Here are the contract definitions: public interface ITimerCallbacks { [OperationContract(IsOneWay = true)] void TimerElapsed(String id); } [ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(ITimerCallbacks))] public interface ISimTime { [OperationContract] DateTime GetTime(); } Here is my class definition: [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] public class SimTimeServer: ISimTime The host setup: // set up WCF interprocess comms host = new ServiceHost(typeof(SimTimeServer), new Uri[] { new Uri("net.pipe://localhost") }); host.AddServiceEndpoint(typeof(ISimTime), new NetNamedPipeBinding(), "SimTime"); host.Open(); and the implementation of the interface function server-side: public DateTime GetTime() { if (ThreadMutex.WaitOne(20)) { RetTime = CurrentTime; ThreadMutex.ReleaseMutex(); } return RetTime; } Lastly the client-side implementation: Callbacks myCallbacks = new Callbacks(); DuplexChannelFactory pipeFactory = new DuplexChannelFactory(myCallbacks, new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/SimTime")); ISimTime pipeProxy = pipeFactory.CreateChannel(); while (true) { string str = Console.ReadLine(); if (str.ToLower().Contains("get")) Console.WriteLine(pipeProxy.GetTime().ToString()); else if (str.ToLower().Contains("exit")) break; }

    Read the article

  • Caching the response of an ASP.NET HTTP Handler server and client side

    - by Bert Vandamme
    Is it possible to cache the response of a http handler on the server and on the client? This doesn't seem to be doing the trick: _context.Response.Cache.SetCacheability(HttpCacheability.Public); _context.Response.Cache.SetExpires(DateTime.Now.AddDays(7)); The _context is the HTTPContext passed as an argument to the ProcessRequest method on the IHttpHandler implementation. Any ideas? Update: The client does cache images that are loaded through the httphandler, but if another client does the same call, the server hasn't got it cached. So for each client that asks for the image, the server goes to the database (and filestream). If we use a aspx page instead of a httphandler together with a caching profile, then the images are cached both on the client and the server.

    Read the article

  • Basic Client-Server Design for persistent connections?

    - by cam
    Here's as far as I understand it: Client & Server make connection Client sends server data Server interprets data, sends client data So on, and so forth, until client sends disconnect signal. I'm just wondering about implementation. Step 2 and 3 are confusing to me, maybe I'm over-complicating it. Is there anymore to interpreting the data than a giant switch statement? Any good books on client/server design? Specifically talking about multithreaded servers, scalability, and message design (byte 1 = header info, byte 2 = blah blah, etc)? Specifically geared towards C++.

    Read the article

  • WCF Async callback setup for polled device

    - by Mark Pim
    I have a WCF service setup to control a USB fingerprint reader from our .Net applications. This works fine and I can ask it to enroll users and so on. The reader allows identification (it tells you that a particular user has presented their finger, as opposed to asking it to verify that a particular user's finger is present), but the device must be constantly polled while in identification mode for its status - when a user is detected the status changes. What I want is for an interested application to notify the service that it wants to know when a user is identified, and provide a callback that gets triggered when this happens. The WCF service will return immediately and spawn a thread in the background to continuously poll the device. This polling could go on for hours at a time if no one tries to log in. What's the best way to acheive this? My service contract is currently defined as follows: [ServiceContract (CallbackContract=typeof(IBiometricCallback))] public interface IBiometricWcfService { ... [OperationContract (IsOneWay = true)] void BeginIdentification(); ... } public interface IBiometricCallback { ... [OperationContract(IsOneWay = true)] void IdentificationFinished(int aUserId, string aMessage, bool aSuccess); ... } In my BeginIdentification() method can I easily spawn a worker thread to poll the device, or is it easier to make the WCF service asynchronous?

    Read the article

  • Entity Framework and WCf

    - by Nihilist
    Hi I am little confused on designing WCf services with EF. When using WCf and EF, where do we draw this line on what properties to return and what not to with the entity. Here is my scenario I have User. Here are the relations. User [1 to many] Address, User [ 1 to many] Email, User [ 1 to many] Phone So now on the webform, on page1 I can edit user information. say I can edit few properties on the user entity and can also edit address, phone, email entities[ like add / delete and update any] On page2, i can only update user properties and nothing related to navigation properties [ address, email, phone]. So when I return the User Entity [ OR DTO] should i be returning the navigation properties too? Or should the client make multiple calls to get navigation properites. Also, how does it go with Save? Like should the client make multiple calls to save user and related entites or just one call to save the graph? Lets say, if I just have a Save(User user) [ where user has all the related entities too] both page1 and page2 will call save and pass me the user. but one page1 i will need a lot more information. but on page2 i just need the user primitive properties. So my question is, where do we draw this line, how do we design theses services ? Is the WCF operation designed on the page and the fields it has ? I am hoping i explained my problem well enough.

    Read the article

  • Publishing WCF .NET 3.5 to IIS 5.1

    - by Adam
    I've been developing a WCF web service using .NET 3.5 with IIS7 and it works perfectly on my local computer. I tried publishing it to a server running IIS 5.1 and even though I can view the WSDL in my browser, the client application doesn't seem to be connecting to it correctly. I launched a packet sniffing app (Charles Proxy) and the response for the first message comes back to the client empty (0 bytes). Every message after the first one times out. The WCF service is part of a larger application that uses ASP .NET 3.5. That application has been working fine on IIS 5.1 for awhile now so I think it's something specific to WCF. I also tried throwing an exception in the SVC file to see if it made it that far and the exception never got thrown so I have a feeling it's something more low level that's not working. Any thoughts? Is there anything I need to install on the IIS5 server? If so how am I still able to view the WSDL in my browser?

    Read the article

  • Will WCF allow me to use object references across boundries on objects that implement INotifyPropert

    - by zimmer62
    So I've created a series of objects that interact with a piece of hardware over a serial port. There is a thread running monitoring the serial port, and if the state of the hardware changes it updates properties in my objects. I'm using observable collections, and INotifyPropertyChanged. I've built a UI in WPF and it works great, showing me real time updating when the hardware changes and allows me to send changes to the hardware as well by changing these properties using bindings. What I'm hoping is that I can run the UI on a different machine than what the hardware is hooked up to without a lot of wiring up of events. Possibly even allow multiple UI's to connect to the same service and interact with this hardware. So far I understand I'm going to need to create a WCF service. I'm trying to figure out if I'll be able to pass a reference to an object created at the service to the client leaving events intact. So that the UI will really just be bound to a remote object. Am I moving the right direction with WCF? Also I see tons of examples for WCF in C#, are there any good practical use examples in VB that might be along the lines of what I'm trying to do?

    Read the article

  • WCF consumed as WebService adds a boolean parameter?

    - by Martín Marconcini
    I've created the default WCF Service in VS2008. It's called "Service1" public class Service1 : IService1 { public string GetData( int value ) { return string.Format("You entered: {0}", value); } public CompositeType GetDataUsingDataContract( CompositeType composite ) { if ( composite.BoolValue ) { composite.StringValue += "Suffix"; } return composite; } } It works fine, the interface is IService1: [ServiceContract] public interface IService1 { [OperationContract] string GetData( int value ); [OperationContract] CompositeType GetDataUsingDataContract( CompositeType composite ); // TODO: Add your service operations here } This is all by default; Visual Studio 2008 created all this. I then created a simple Winforms app to "test" this. I added the Service Reference to my the above mentioned service and it all works. I can instanciate and call myservice1.GetData(100); and I get the result. But I was told that this service will have to be consumed by a Winforms .NET 2.0 app via Web Services, so I proceeded to add the reference to a new Winforms .NET 2.0 application created from scratch (only one winform called form1). This time, when adding the "web reference", it added the typical "localhost" one belonging to webservices; the wizard saw the WCF Service (running on background) and added it. When I tried to consume this, I found out that the GetData(int) method, was now GetData(int, bool). Here's the code private void button1_Click( object sender, EventArgs e ) { localhost.Service1 s1 = new WindowsFormsApplication2.localhost.Service1(); Console.WriteLine(s1.GetData(100, false)); } Notice the false in the GetData call? I don't know what that parameter is or where did that come from, it is called "bool valueSpecified". Does anybody know where this is coming from? Anything else I should do to consume a WCF Service as a WebService from .NET 2.0? (winforms).

    Read the article

  • WCF publish/subscribe service, and ASP.NET MVC client

    - by d3j4vu
    I managed to develop a custom WCF service, using the publish / subscribe model, and hosted inside a managed windows service. Everything's working. I developed an interface as the service contract implementing a method definition marked as a non-one way operation contract (OperationContract(IsOneWay = false)]. This, to make possible returns an instance of a custom class derived from System.Web.Mvc.ActionResult. In the MVC app, event fires ok. It wraps inside an action method, (just the one defined in the interface), but, and this is my current problem, i believe that something relative to the execution context of the windows service (and the hosted wcf counterpart) blocks the execution of the action method in the MVC app. This is what i have until now (some pieces ripped off just to be more clear): /// Method definition for the contract's service. Maps to a MVC ActionMethod. [OperationContract(IsOneWay = false)] ActionResult Imagen(string data, CustomActionResult result); The class to hold an ActionResult derived class instance: public class ServiceEventArgsMvc : ServiceEventArgs { /// <summary> /// /// </summary> public CustomActionResult Result { get; set; } } And the code in the MVC client app: /// <summary> /// Just a simple class to hold an abstract ActionResult derived class instance. /// </summary> public ActionResult Image(string data, CustomActionResult result) { ViewData["data"] = data; return View(); } Ok. ActionMethod sucessfully executes...but when it's done (and usually expected obtain a reditection to a View named Image, like the action method), the WCF service throws a Timeout exception, making clear that he's still waiting for a response from the MVC client. The response never arrives, so the MVC app never finish his work (redirect to the "Image" view as expected). Any ideas?. Guess i'm missing something very simple, but i don't know what it could be. This is drivin' me nuts.

    Read the article

  • Which .NET REST approach/technology/tool should I use?

    - by SonOfPirate
    I am implementing a RESTful web service and several client applications that are mostly in Silverlight. I am finding a litany of options for developing both the server-side and client-side of the API but am not sure which is the best approach. I'm concerned about stability as well as a platform that will continue to exist a few months from now. We started using the REST Starter Kit with .NET 3.5 but moved to the new WCF Web API when updating to .NET 4.0. All of their documentation indicates that WCF Web API is the replacement for the RSK. However, Web API is only in Preview 4 and does not include support for Silverlight or Windows Phone 7 clients (yet). WCF Web API looks like a wrapper on top of the WCF WebHttp Services stuff provided in the System.ServiceModel.Web library which makes me think that maybe it would be simpler to just go with the built-in stuff but Web API does offer some nice features. I am specifically tied-up trying to determine the best course for the client-side. My main requirement is that I need to support deserializing into my client-side objects quickly and easily. The Web API offers a nice client library but doesn't have a Silverlight version. I'd like to use the latest approach and the toolset that is being actively developed and supported. Is the REST Starter Kit really obsolete? Has anyone had any success implementing the WCF Web API toolkit? Is there merit to using either of these over the built-in WCF WebHttp Services features found in System.ServiceModel.Web? Is there a single solution that works for any client (web, Silverlight, etc.)? What suggestions do you have?

    Read the article

  • How does a WCF server inform a WCF client about changes? (Better solution then simple polling, e.g.

    - by Ian Ringrose
    see also "WCF push to client through firewall" I need to have a WCF client that connect to a WCF server, then when some of the data changes on the server the clients need to update its display. As there is likely to be a firewall between the clients and the server. All communications must be over HTTP The server can not make an (physical) outgoing call to the client. As I am writing both the client and the server I do not need to limit the solution to only using soap etc. I am looking for built in surport for "long polling" / "Comet" etc Thanks for the most informative answer from Drew Marsh on how to implement long polling in WCF. However I thought the main “selling point” of WCF was that you could do this sort of thing just by configuring the channels to be used in the config file. E.g I want a channel that logically two way but physically incoming only.

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >