I'm using Excel interop and it seems that this functionality needs to run in the User Interface thread. So I execute that from the ProgressChanged backgroundworker event. Is there a way to have the dowork event (that invoked the progress changed event) interrupt execution until the ProgressChanged event is finished? Here's how the bg is initialized: private void initializeBackgroundWorker() { bg36 = new BackgroundWorker(); bg36.DoWork += bg36_DoWork; bg36.RunWorkerCompleted += bg36_RunWorkerCompleted; bg36.WorkerReportsProgress = true; bg36.ProgressChanged += bg36_ProgressChanged; bg36.WorkerSupportsCancellation = true; } This is how the process is started: private void bg36_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker bw = (BackgroundWorker)sender; This is …

Member Avatar
Member Avatar
+0 forum 3

I have the following wcf service: namespace Scanner { [ServiceContract(Namespace="scan.rsna.org/WebServices/BarcodeScanner")] public interface IBarcodeScanner { [OperationContract] bool InsertScanEvent(BarcodeScanner.ScannedItem barcode); } } namespace Scanner { public class BarcodeScanner : IBarcodeScanner { string dbConnection = ConfigurationManager.ConnectionStrings["annualMeeting"].ConnectionString; [DataContract] public class ScannedItem { Guid _scanID = new Guid(); string _badge; DateTime _scanTime; string _computer = Dns.GetHostName(); public ScannedItem(Guid scanID, string badge, DateTime scanTime) { this._scanID = scanID; this._badge = badge; this._scanTime = scanTime; } [DataMember] public Guid scanID { get { return _scanID; } } [DataMember] public string badge { get { return _badge; } } [DataMember] public DateTime scanTime { get { return _scanTime; …

Member Avatar
Member Avatar
+0 forum 2

Are there two or more ways to couple and decouple the service type and service contract? The book I'm reading speaks of coupling and decoupling in two different ways. Am I reading it wrong? I can provide examples but I'm trying not to over complicate this post. 1) She speaks of coupling and decoupling the service contract and service type. Basically coupled is when you don't define an interface for the service contract. You just use the type. Decoupling is when you use an interface as the contract and a type to implement the interface. 2) But she also seems …

Member Avatar
+0 forum 0

I bought a book to help me learning WCF. Lots of people complained that the book was written for VS 2005 at first then there was a reprinting for VS 2008. What it seems is that the code for VS 2005 would not work in VS 2008. I'm wondering why? What is more likely the solution files or the code itself? I know that code gets deprecated (methods and even whole classes). I"m wondering what are the chances that what i learn in the book from 2008 will work in VS 2010. I assume that I shouldn't have to RE-LEARN …

Member Avatar
Member Avatar
+0 forum 11

Following this [tutorial][1]: I have created a WP8 Mobile Application and trying to call my WCF web service. When calling the WCF service in the browser, I can see the JSON returned with no problems at all. However, when I call the WCF service in my mobile application, I don't get anything back. I have no clue where I am going wrong. This is the code that calls the WCF: string ServiceUri = "urlgoeshere"; WebClient proxy = new WebClient(); proxy.DownloadStringCompleted += new DownloadStringCompletedEventHandler(proxy_DownloadStringCompleted); proxy.DownloadStringAsync(new Uri(ServiceUri)); And the event handler: Stream stream = new MemoryStream(Encoding.Unicode.GetBytes(e.Result)); DataContractJsonSerializer obj = new DataContractJsonSerializer(typeof(List<SightingType>)); var …

Member Avatar
Member Avatar
+0 forum 1

Sorry, If It is a stupid question but I am new to WCF. I have a C# project in which, I am loading a XML document (contains name of students and Id) using Linq to xml and I have to get the associated data (their due date, amount and stuff ) from a WCF service (a link is given). How do I get the associated data from WCF service ? Do I just right click and add service reference.

Member Avatar
Member Avatar
+0 forum 1

Hey im just wondering if or how i can split up my services **IService** namespace Phpwcfconsole { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together. [ServiceContract] public interface IService { [OperationContract] string KundNyKund(Variables.Kunder Kund); [OperationContract] Variables.StringArrays KundVisaKund(); } **Service1** namespace Phpwcfconsole { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in both code and config file together. public class Service1 : IService { public string KundNyKund(Variables.Kunder Kund) { //dostuff } public Variables.StringArrays KundVisaKund() …

Member Avatar
Member Avatar
+0 forum 2

Hey i just wonder if i can send the method comments with the OperationContract so i see it in my WCF Test Client. that way the php dude can see what each method does and how to work from that. /// <summary> /// Text text /// </summary> /// <param name="Kund"></param> /// <returns></returns> this normal method comment option doesent seems to work for me i might be wrong and just looking wrong in the test client but any advice would be nice :P thank you for answers :)

Member Avatar
+0 forum 0

hello! i have a function in my C# code that returns a string array. and when i test my function in WCF Test Client i get Name Value Type (return) length=4 System.String[] [0] "DE" System.String [1] "DK" System.String [2] "NO" System.String [3] "SE" System.String **code if i do var_dump on the function** object(stdClass)[2] public 'LandsKodComboBoxResult' => object(stdClass)[3] public 'string' => array (size=4) 0 => string 'DE' (length=2) 1 => string 'DK' (length=2) 2 => string 'NO' (length=2) 3 => string 'SE' (length=2) **My code so far** <?php $client = new SoapClient("http://localhost:8731/phpwcf/?wsdl"); var_dump($client->MyFunction()); $array = $client->MyFunction(); echo $array[2] ?> * so …

Member Avatar
Member Avatar
+0 forum 4

Hello, so im trying to send an metod that takes a class as input parameter with a bunch of variables. I want to write in some textboxes in my php side of the program send them with my class and into a database. but the database part is no problem i just need help sending the text from textboxes-->class-->thru Wcf -->c# program * **Service1.cs** public class Service1 : IService1 { public string KundGrunduppgifter(Variables.Kunder Kund) { //kund.customerNumber to database //kund.customerDeliveryAdress to database //and etc etc... //check is input is wrong //write errortext return errortext; } } * * * * **IService1.cs** …

Member Avatar
Member Avatar
+1 forum 10

Hi, I'm new to WCF technology and I have to make 2 service providers, that can exchange messages between each othen. So I made two seperate WCF services, and a client application for each service. But my how to implement implement communication between the two wcf services, so that when one service send a message, the other one receives it and sends a reply? if anyone has an idea I would be very grateful. Thank you!

Member Avatar
Member Avatar
+0 forum 2

Hi,I have already a web service written in C# which is designed to send a list of objects to the client.For the shake of simplicity let's say it's those objects have 2 fields, a description and an image.The web service is configured to send the data in buffered mode,now I need to switch it to streamedResponse.The catch is that the cliend is written in Java.So my question, is a wcf web service using streamedResponse interoperable?I've done my research and came accross some articles that say that wcf streaming to Java cannot be done...

Member Avatar
+0 forum 0

As far as I can tell REST is a methodology or an archecture. Is it a real tangable thing? I mean, can you look at a back-end code and determine if it is REST or not REST? How do you communicate with a WCF RESTful service? Are all WCF services RESTful?

Member Avatar
+0 forum 0

Hi, again Im hoping to be on the right topic. So here it is: I am publishing a SilverlightApplication that uses a WCF service to read from a database. The application uses Bing Maps to visualize some polygons. The thing is, that after I publish it ONLY on some machines I get the following Error: at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at ServiceConnection.MyServiceReference.selectAllImotsByEkatte_visualCompletedEventArgs.get_Result() at Tracing.Views.DrawContent.client123_selectAllImotsByEkatte_visualCompleted(Object sender, selectAllImotsByEkatte_visualCompletedEventArgs e) at ServiceConnection.MyServiceReference.Service1Client.OnselectAllImotsByEkatte_visualCompleted(Object state) Caused by: [Async_ExceptionOccurred] Arguments: Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.0.10411.00&File=System.dll&Key=Async_ExceptionOccurred at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at ServiceConnection.MyServiceReference.selectAllImotsByEkatte_visualCompletedEventArgs.get_Result() at Tracing.Views.DrawContent.client123_selectAllImotsByEkatte_visualCompleted(Object sender, selectAllImotsByEkatte_visualCompletedEventArgs e) at …

Member Avatar
+0 forum 0

I am doing system using window phone 7 and sql server as database. I am using below coding to get shopping cart list at listbox. public List<Order> FindOrder(string custemail, string orderstatus) { var findorder = from r in order.Orders where (r.CustEmail == custemail && r.OrderStatus == orderstatus ) select r; return findorder.ToList(); } public pgShopCart() { var obj = App.Current as App; custemail = obj.custEMAIL; string orderstatus = "Pending"; proxy.FindOrderCompleted += new EventHandler<FindOrderCompletedEventArgs>(proxy_FindOrderCompleted); proxy.FindOrderAsync(custemail, orderstatus); } void proxy_FindOrderCompleted(object sender, FindOrderCompletedEventArgs e) { ListBox1.ItemsSource = e.Result; } After that I want to update the orderId status become "success" but I am …

Member Avatar
+0 forum 0

Hi, I have to create several services that have to use some sort of registry, to store and get data from. Also, services should have to communicate with each other, in order to exchange data, using the previously mentioned registry. Each service should be able to connect to the registry in order to get data. I've created the individual WCF services, but how to create the registry ? Should the registry also be a wcf service?

Member Avatar
Member Avatar
+0 forum 2

I am trying to learn how to make a mobile phone communicate with a server and a database. So far, I have made a web-service on my PC using this tutorial: http://msdn.microsoft.com/en-us/library/ms733069.aspx The above tutorial makes a sortof WCF service. What would be the best Database system for me? Simplicity and ease-of-use is key. I was thinking either RavenDB or SQL Server. Any suggestions on what I should use and if there are any digestable tutorials online?

Member Avatar
Member Avatar
+0 forum 2

Hello, I am creating an API in WCF (.NET 4, C# ). I am taking a .NET List as input from client. my only concern is that if my client is in a language other than .NET (like java), can i still accept List as an input and consume it as .net Lists? or i will have to parse java lists to .net lists? if i have to parse it to .net Lists then how i can do it?

Member Avatar
Member Avatar
+0 forum 2

Hi, I have a WCF Webservice, and I have an asp.net application that uses this web service. I Have them both running on the same machine, but get a time out. Is there something I have to specify myself in the web.config? I am fairly new in WCF, as this is my first project using it, so please as informative as possible! Thanx

Member Avatar
Member Avatar
+0 forum 2

[B]Hi! [/B] Im new on this forum.. so Hello to all :) Im a beginner in programming WCF.Im a student, on our faculty, we get a new task to make a project in WCF.I hope that you guys could help me a little bit..I dont know how to start.I watched some toturials on youtube and so on.. [B]So here is my task:[/B] Create Web services using Windows Communication Foundation framework - WCF. In Visual Studio select the WCF Service Application project and add a new service, provided with a service, operations and data contract. The service must have parameters and …

Member Avatar
Member Avatar
+0 forum 6

Hello everyone..I'm trying to access the methods of a WCF service from a pocket pc emulator..I added a Web Reference to the service and tried to access the method like this [code] WebReferenceService1.Service1 client = new WebReferenceService1.Service1(); MessageBox.Show(client.GetData(10,true)); [/code] ..but everytime i call the method..i get System.Net.WebException error saying "Unable to connect to remote server"..the webservice is up and running..I can access it from the browser or the console application where I add the service using Add Reference..Could anyone tell me where I am going wrong?? Any help would be appreciated.

Member Avatar
Member Avatar
+0 forum 1

hey there, I'm writing a program where I have to store and retrive student information(e.g. name,address,photo..) in the database. I've written the code to interact with the database in a WCF service..The problem is I'm able to get the image from the database if I directly write the code to interact with the database in the Windows Forms Application..but when I try to get the image through the WCF service there's some sort of error saying "The underlying connection was closed: The connection was closed unexpectedly." I don't understand where I'm going wrong..Could anyone please tell me why am I …

Member Avatar
Member Avatar
+0 forum 1

I have a C# WCF Ajax service with an OperationContract that accepts a string of text that is expected to be CSV. I have written most of a CSV parser for this, but I would like to possibly use OLEDB to parse this string. Is this possible? I would rather not save this file to disk and then parse it. Any ideas on how to make the OLEDB connection to a string in RAM?

Member Avatar
+0 forum 0

I am developing a project with wcf . I need to develop a wcf service that will take data from database. I should write it in WCF custom data provider. I can do it with wcf linq and webService with EF. But I can not understand the example of Custom data provider with WCF.[URL="http://msdn.microsoft.com/en-us/library/ee960143.aspx"]http://msdn.microsoft.com/en-us/library/ee960143.aspx[/URL] Can anyone send me an easy example of wcf custom data provider. My mail is : <removed>

Member Avatar
Member Avatar
+0 forum 2

Hi, I am using the following codel. But it is always returning 'False'. Even though i gave correct values.. Plz help... [code] PrincipalContext adContext = new PrincipalContext(ContextType.Domain, "xxx.xxx.0.15", "Administrator", "Password"); using (adContext) { return adContext.ValidateCredentials(userName, passWord, ContextOptions.Signing); } [/code] I tried the this one also.. [code] DirectoryEntry de = new DirectoryEntry("LDAP://serverIpAddress/CN=myusername,CN=Users,DC=domain,DC=com" + "domain.com\\", userName, passWord);[/code] This erros is coming Unknown error (0x80005000)

Member Avatar
Member Avatar
+0 forum 10

I got the error below what might cause it? Server Error in '/' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: Line 42: </serviceBehaviors> Line 43: </behaviors> Line 44: <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> Line 45: </system.serviceModel> Line 46: <applicationSettings> Source File: C:\inetpub\vhosts\test\httpdocs\test\web.config Line: 44 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

Member Avatar
+0 forum 0

I have created a simple web service based off one of the project templates in the Microsoft WCF Starter Kit 2 for .NET 3.5. I have successfully implemented a GET method. However I am having trouble get a POST method to work. [CODE] [WebHelp(Comment = "Sample description for DoWork")] [WebInvoke(UriTemplate = "DoWork", Method = "POST", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)] [OperationContract] public SampleResponseBody DoWork(SampleRequestBody request) { //TODO: Change the sample implementation here return new SampleResponseBody() { Value = String.Format("Sample DoWork response: '{0}'", request.Data) }; } [/CODE] Below is the definition of the SampleResponseBody and SampleRequestBody classes: [CODE] public class …

Member Avatar
+0 forum 0

I have a very simple WCF program where I have a simple self-host and a client running on the same computer. There is a single method which returns a System.IO.Stream, which is actually a serialized form of a simple string. (This could be any number of data types, but for the time being let's take it as a string). Following is the code I use if you want to take a look at. SerializeData() and DeserializeData() are methods used to do just that, and works fine. [B]Host Service: [/B] [CODE]namespace HelloWCF1 { [ServiceContract(Namespace = "http://My.WCF.Samples")] public interface IService1 { [OperationContract] …

Member Avatar
+0 forum 0

Hi Guys, I'm currently developing a project using WCF (hosted on local IIS) which connects to a local SQL database using LINQ to get data. My problem is that when I run the code, 9/10 times it'll fail with the "Specified Cast Is Not Valid" error, but the other 1/10 times it will return the correct value (a messagebox with the records 'name' field. The code snippets below are from my wcf datacontract/servicecontract, server and client code. There is only one record in the table im retrieving. WCF Service (IFaveoService.cs) [CODE][ServiceContract] [ServiceKnownType(typeof(SRType))] public interface IFaveoService { [OperationContract] IEnumerable<SRType> GetSRTypeByID(int srID); …

Member Avatar
Member Avatar
+0 forum 10

I have a WCF service in which I have one method, It gets new live auctions from the database. It is called every second. For each auctions WCF creates new thread and start the auction. This thread updates database every second and after auction ends that thread gets close. However this service consuming servers physical memory even after databases doesn’t have new auctions. When physical memory is fully consumed, the services restarts. Can you please you help me to sort out this problem, If you need more information please revert back me, I will provide more information on this. Thank …

Member Avatar
+0 forum 0

The End.