.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

WCF - data send/response

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :ASP.Net

I'm a junior programmer, and also new to WCF. I have built working "stubs" for a WCF client and a WCF service. Now I want my WCF client to send some data to my WCF service, and then get a computed data result back from the WCF service and show it in a web page.

What's an easy way to do this type of send/response using WCF?

Much thanks

View Complete Post

More Related Resource Links

Collaboration Data Objects: Send Microsoft Exchange Appointment Reminders to Your Pager Using CDO


Besides your typical e-mail services, Microsoft Exchange also provides the service infrastructure you need to build extensible knowledge and workflow management systems. Understanding Collaboration Data Objects (CDO) is the key to accessing these Exchange services for your own programs. With CDO you can automate tedious tasks and integrate information such as e-mail, calendars, and contacts with almost any application. This article explains how CDO enables you to access Exchange services, then walks you through a sample application that reads calendar events from an Exchange server and sends pager reminders to your users.

Sean McCormick

MSDN Magazine June 2000

send data in class object from one page to another using session


hello everybody

now i hav stored all data like user name, data fatched from database of that user

and i stored that data and user name such as:

string strUserName="user name"

dataset ds =new dataset();// data of that user

now i wan yo send d whole data from my login page to user profile page

can anybody help me for that...................

and plz tell me that how much is this way is benifitial to send data from one page to another page

plz........kindly waiting for positive rply

Web Service that will receive xml request and send xml response


I am trying to create a web service that can do the following functionality:

Request XML 

<?xml version="1.0" encoding="UTF-8"?>
<Authentication UserName="test" Password="test" MyId="0987">

Response XML - After authenticating request xml from client send them back the following response:

<?xml version="1.0" encoding="UTF-8"?>
   <Test MyId="0987">
       <TestType id="11"></TestType>
       <TestType id="22"></TestType>

How can I create web service to do this.

Send an Email with User fields data entered in the form


Hi All,

          I have a form which have some user input fields(like textboxes,dropdownlists,textarea etc) fields and a submit button.

on click i need to send email with body contents as all the details entered by user in the form

Can anyone suggest how i should approach to this in sharepoint..

any code examples would be appreciated.


How to send data from WPF UI to excel file?

How to send data from WPF UI to excel file? Thanks.

Sys.Data.DataContext.saveChanges method doesn't send update to server after DataServiceException ex

Hello,I have a page with a simple form that updates a single record in a table in my database.The database is accessed via WCF Data Services. To load and save data from/to the server, I usethe Sys.Data.DataContext object provided by the ASP.NET AJAX library. When the "save" button on theform is clicked, I use the saveChanges method of the Sys.Data.DataContext object to send all changes to the server.Also, at the server side, I use an interceptor that checks the "Price" fields of the record, and throws a DataServiceException exception when the contents of the field is a negative number.Both the JavaScript and the interceptor (in C#) are copied below.Here is the interesting thing:When I enter a negative price in the form, the interceptor throws the exception and my form shows an error message. Good.However, if I then make one of the other fields in the form a bit shorter (for example from "abcd" to "abc"),the saveChanges method doesn't send the data to the server. But it does call the success callback that I passed in to saveChanges, creating the impressionthat the data has been saved. This happens while the Price field is still negative. I used Fiddler to make sure thatno message is sent to the server. Also, the interceptor doesn't get executed.The weird thing is that if I make one of the fields a bit longer instead (for example &q

Best way to send data to report server from merge replicated database

Hi ALL,              I have merge replication configured on database say Testdb on production server. I want data from testdb(merge replicated) database to send to report server. How can i accomplish this....Whts the best way to send data at regular intervals to report server.. Any suggestions plz TIA

Posting form data and receiving a response

Hey everyone,I have an application that needs to post data to a url on the web and then receive an xml response.  I have an HTML form (provided by vendor) that posts the data correctly, however when clicking the submit button the page is redirected to the post url and the xml is displayed in the browser.  I need to do this on a postback within an existing asp.net project.  Basically, the user will fill out the form, the form data will post to the url, the xml response will be received, and the appropriate values will be displayed on the screen. I've found a bunch of examples for doing this but I just can't seem to get my head around it.  Can anyone point me in the right direction or explain how I should go about this?  Thanks for your help!Will

Getting data out of objects in a JSON response

I'm working on an MVC2 site that needs to update the values of a select list based on the value selected by a user in another list. This is the response I'm getting from my controller's JSON action: [{"Selected":false,"Text":"Client1Group1","Value":null},{"Selected":false,"Text":"Client1Group2","Value":null}] The problem is that the data object my function gets back is a collection of generic objects. When the following script runs I get two alerts, but instead of getting the Text value from my objects I get "undefined".var clients = $("#properties_ClientList");var groups = document.getElementById("properties_GroupList");//User selects a client nameclients.change(function() {    //Clear group SelectList    $('#properties_GroupList option').each(function(i, option){ $(option).remove(); });    //Repopulate group SelectList    $.getJSON("<%=Url.Content("~/Admin/GetGroupSelectListForReportEditViewAsJsonResult")%>", { clientId: clients.val() },        function(data) {            $.each(data, function(){                

How to send data back to the datasource?

I have an ObjectDataSource which has two methods - GetData which gets data from the database and returns an array of Classes, and UpdateData which takes an array of Classes and updates the database.  The array of Classes contains sufficient information to allow UpdateData to work out what it needs to do.  So, to get an update to work, all I need to do is pass the [amended] array of Classes back to the ObjectDataSource via the UpdateData method. Then I have a control which inherits from DataBoundControl.  The control is happily using PerformSelect and PerformDataBinding to make the data available.  As it happens, I'm also implementing IScriptControl and throwing most of the data to the Browser as JSON for processing as a Javascript array.  I've got to the point where, on a PostBack, the data arrives back on the server and the control gets the array into the state where it is ready to update. Then, I need to pass the array of Classes over to the ObjectDataSource (the converse of the PerformSelect).  I was expecting to see a PerformUpdate or similar function within DataBoundControl.  At that point, I have juddered to a stop - and can't find anything which talks about how to get the data source to update. I'm, probably missing something obvious - and actually hope that I am! Thanks, Nick

putting data in a format send by email

Gooday If i want to send my data to someone by email so as they can update the data into their database , how can i do this . The database is too big to send by email? thanks Robrh

Using HttpWebRequest to send POST data with parameters and a file

I have a form that has the following<form action="http://site" enctype="multipart/form-data" method="post"> <input type="hidden" name="action" value="the action" /> <input type="hidden" name="apiKey" value="key here" /> <input type="hidden" name="name" value="racing" /> <input type="hidden" name="title" value="Race Cars" /> <input type="hidden" name="signature" value="sig here" /> <input type="file" name="file" /> <input type="submit" name="_upload" value="Upload" /> </form>I know its not .net controls.. but hat doesn't matter for now, what I need to do is post this form with all it's data, but entirely in code.I have found this post: http://www.developmentnow.com/g/36_2005_3_0_0_300351/Using-HttpWebRequest-to-send-POST-data.htm this describes how to do it but I am not getting it.I will have a file upload on my page and a textbox for name and title, but the rest are generated in code.I know it's a long shot, but can anyone give me an example of exactly how I would do it for  my scenario? I have been at it all day and I am struggling! I keep getting bad gateway errors when

Can you render cahnges in the curent and send a Response?

I am generating Word docs from a gridview.  The Word doc gets sent to the client using a Resposne object.  However, I would also like to highlight the row in question and update a file generation log display (another gridview).   All the data fucntions on the server side fire fine, but any visual updates to the current page never hit the client.  The Response object seems to take over the entire response.   Is there any way to accomplish both: execute the Response and update the current page? 

Programatically Send and receive data using Post Method

Hi,I wish to make a script which programatically send the POST data to one server and then the other server receive the POST message and retrieve the information. How should make this work? I already successfully write the sender site, the code as follow:string postData = "id=0&co=5";ASCIIEncoding encode = new ASCIIEncoding();         //data encoding         byte[] dataEncode = encode.GetBytes(postData);         //end ascii encoding scheme         string url = "http://localhost:51711/Handler1.ashx"; //         //web request         HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);         req.Method = "POST";         req.ContentType = "application/x-www-form-urlencoded";         req.ContentLength = dataEncode.Length;         //send data                Stream st = req.GetRequestStream();         st.Write(dataEncode, 0, dataEncode.Length);         st.Close();ASCIIEncoding encode = new ASCIIEncoding();byte[] dataEncode = encode.GetBytes(postData);stri

Writing image binary data to the Response


Hi there,

I've created 2 web user controls. A = User control that displays an image, and B is the user control that hosts A. I'm trying to stream an array of bytes to A, but it seems like the Response.BinaryWrite method completely overwrites any heirachial controls (I can't see any of B's other controls besides the image).

How do I get A to just display the image from the byte stream? It doesn't come from a database, it's an image I created on the fly.

A's code:

        public void UpdateImage(byte[] imgbytes)
            Response.ContentType = "image/jpg";


How to send binary data ( ogg audio file) using a web service?


Hi folks, I would appreciate any help or guidance on this topic:

How can I receive binary data (specifically an ogg audio file) using a WCF4 service?

The general idea is to define and host a WCF service inside IIS that returns an audio file (ogg file)

I have read some info related with using ByteStreamMessageEncodingBindingElement class to achieve this, also I read some topic related on using MTOM to attach a binary file. It seems that it can be several ways or approaches to achieve this.

So any guidance on the themes and/or examples for the better way to solve this point would be very appreciated.

Thanks in advance.



Only send report if data exists


I am trying to solve a problem where the people set up to get subscriptions only want the report emailed if it contains data.  Currently if whatever report it is does not have any data matching the report criteria they are still emailed an empty report.  I know I could add logic that basically runs the same query as the report and if @@ROWCOUNT > 0 then I could put some logic in the actually run the report and send the subscription but as a DBA that does not make sense as that is vbasically like hitting the database twice to run the same report.


Any help would be greatly appreciated

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend