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

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

Asynchronous WebService with Tcp/Ip Socket?

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :WCF
Hi people, Our code is written in VS 2005, 2008, mostly. And we just migrated to 2010. Originally we planned on connecting one webservice to another webservice. But this data transfer have to pass through a stand alone Tcp/Ip socket app whcih acts like a firewall/filter. Request and response all have to go through this Tcp/Ip socket app. From what I've heard our webservice is a synchronous webservice which doesn't goes well with the socket app. Data/connection could be lost waiting for the response. So I am thinking we need a asynchronous webservice. Does WCF have webservice capabilities that use Tcp/Ip socket? I know that WCF is a summation of webservice, Tcp/Ip, Namepipe, etc. But can I use WCF as a webservice and Tcp/Ip at the same time? All using asynchronously? Give example plz? BlueMarker

View Complete Post

More Related Resource Links

Webservice using socket layer programming



   I want to access a webservice in asp.net programming. This webservice was done using socket layer programming and also i am having the ipaddress and port address. Did any one know about how to access webservice using socket layer and if know let me know how to access the webservice. Thank you

Problem with asynchronous call to webservice


Hello people.

I have a website where i call function in a web service. I am calling it asynchronously. The problem is the data which is returned from webservice is not shown in my label.

See here

protected void Page_Load(object sender, EventArgs e)
IAsyncResult asyncResult;

AsyncCallback callback = new AsyncCallback(MyCallBack);
asyncResult = serv.BeginGetImageList(req, callback, null);

private void MyCallBack(System.IAsyncResult asyncResult)

Label1.Text = "TEST";


Very simple but when the page is loaded, the label dont have any text.

Please help.

App to Support WebService and Socket Connection



I have a scenario at my hand where in I have to build a WebApp/Control for implemeting the following two scenarios:

1. The Server app will be accesed by a device and based on the logic,  an XML is returned to the calling device. My solution is to implement a WebService for this.

2. The App also needs to communicate with another device for transfering the images, videos, audio, etc to the server app. The requirement from the client (who himself has a bit of Technically knowledge) end is to do it using the Sockets.


I am not sure if the same can be bundled into the same app. But have to do it somehow.

Any sort of inputs will be highly appreciated.



Sumit Bhatnagar

Cheers!! Sumit Bhatnagar

jQuery $(document).ready() and ASP.NET Ajax asynchronous postback

Many call it the ASP.NET jQuery postback problem, but using the technique below should make it no problem anymore. $(document).ready() isn't called after an asynchronous postback. What this means? You lose the functionality that should be executed within $(document).ready() after an UpdatePanel rendered its contents after an asynchronous postback.

jQuery live() and ASP.NET Ajax asynchronous postback

The issue is that normally $(document).ready() is called when the DOM is ready to be manipulated. But this doens't happen after an ASP.NET Ajax asynch postback occurs.

This means that the initial jQuery bindings won't be automatically available after the asynchronous postback is over. I underline "automatically" here because my last post describes more possibilities, how this issue can be worked around.

saving XML output from webservice


 I created a webservice that takes casenum as input and gives results as a dataset in an XML.

I could make a web client to display the resulting dataset in a grid view. Pls see my code copied below.

Now I want to create a console client that takes the casenum as input, to call the webservice and saves the resulting xml for further processing, but can't figure out how to just capture the xml to save. Here's the code for my web client. I would appreciate if you could help modify this tocapture the resulting xml to save file locally.

Thank You.

namespace ResultsWebServicesClient
    public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)

        private void BindDataToGrid(string CaseNum)
            FG_Results results = new FG_Results();
            DataSet ds1 = new DataSet();
            ds1 = results.Get_FG_Results(CaseNum);
            GridView1.AutoGenerateColumns = true;
            GridView1.DataSource = ds1.Tables[0];

        protected void GetResults(object sender, EventArgs e)


HTTP Post and WebService


I am working on a application which will accept the data in the post request. My application also wants to expose a web service and want to call another web service. Considering all these 3 action that I want to do, can I create a single application which will have a web form which will accept the POST request and expose a web service at the same time.

Although it may be possible to achieve this, Is this a correct way of doing it?

Calling webservice from the server


I have a sample web service and aspx file. I deployed them to an existing website that contains classic asp files.

web-service: --- using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; [WebService(Namespace = "http://localhost/MyWebServices/")] public class MembershipRegisWebService : System.Web.Services.WebService { public MembershipRegisWebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World."; } }

aspx.cs file: --- using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Services; public partial class CallWebService : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { MembershipRegisWebService mrWs = new MembershipRegisWebService(); Response.Write("Calling web service:" + mrWs.HelloWorld()); } }

It runs locally, but it shows an error when running it from the server:

Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the follow

C# / Java webservice


I am writting a client applicatin that acesses a webservice written by another company.  I need to test against this webservice but since it is live I need another place to test with.  I don't have access to the code from the webservice but have added a reference to my project.  I would like to create a test platform using C# which will run on IIS and not Java.

I have created a basic webserive using both the NetBeans platform and the VS/C# platform.  The problem I am having is if I dynamically change the web address from one to the other my client application complains that the webservice is invalid.  I have verified all the calls are the same.

Are there any setting with VS/C# that allow me to configure it to behave more like the Java webservice?  I don't have the server support to host the Java application for full testing along with other problems using the Java version.

I have run both services in the "WCF Test Client" and can see where the WCF service uses the varibles for request and the Java uses body/request but can't get the WCF to follow that format.  I read somewhere about changing the OperationContract with SoapRpcMethod but then the mentod is not longer exposed. I also tried a Web Service in .NET 3.5 instead of a WCF server but that seems to be more trouble and does not

Printing crystal report from webservice



I am trying to print crystal repot directly from a C# application, which is calling webservice. I am able to display report in crystalreportviewer by passing the webservice call to datasource. However, is there anyway, I can print directly without showing the report?

Alternatively, I was trying return ReportDocument object from webservice, which would solve my problem, but I was unable to return the ReportDocument because of serialization issue. Is it even possible? Thank you


Cutting Edge: Revisiting Asynchronous ASP.NET Pages


If you need to scale up an existing Web application, you should first look to asynchronous operations, says Dino Esposito. He explains how new features coming in ASP.NET MVC 2 make this easier.

Dino Esposito

MSDN Magazine April 2010

Concurrent Affairs: Solving The Dining Philosophers Problem With Asynchronous Agents


We use the new Asynchronous Agents Library in Visual C++ 2010 to solve the classic Dining Philosophers concurrency problem.

Rick Molloy

MSDN Magazine June 2009

Windows with C++: Asynchronous WinHTTP.


This month's column explains how to use Windows HTTP Services, or WinHTTP, the new, powerful API for implementing HTTP clients.

Kenny Kerr

MSDN Magazine August 2008

.NET Matters: Asynchronous I/O with WebClient


In this month's installment of .NET Matters, columnist Stephen Toub answers reader questions concerning asynchronous I/O .

Stephen Toub

MSDN Magazine July 2008

.NET Matters: Asynchronous Stream Processing


This month Stephen Toub discusses asynchronous stream processing.

Stephen Toub

MSDN Magazine March 2008

Concurrent Affairs: Asynchronous Device Operations


Jeff Richter uses the AsyncResult class to implement the CLR's Asynchronous Programming Model to perform hardware device operations asynchronously.

Jeffrey Richter

MSDN Magazine June 2007

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