.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

Webservice using socket layer programming

Posted By:      Posted Date: August 23, 2010    Points: 0   Category :ASP.Net


   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

View Complete Post

More Related Resource Links

Asynchronous WebService with Tcp/Ip Socket?

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

C# Socket programming

Hi,       Im having a problem with some socket programming and im hoping someone here can help me. basically im trying to bind a listener to a port. I have used some source code i obtained from the net, however the code was a few years old and contained the obsolete "Dns.Resolve(string.Empty);" method to get the IPHostEntry information. Ive tried to replace this with "Dns.GetHostEntry(string.Empty);" however my code does not seem to be excuting past this point so im wondering if i have a logical error. this is the original method private void AcceptConnections() { IPHostEntry localMachineInfo; IPEndPoint localEndPoint; Socket listener = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); try { localMachineInfo = Dns.Resolve(string .Empty); localEndPoint = new IPEndPoint(localMachineInfo.AddressList[0], _port); // Bind the listener socket to a local port listener.Bind(localEndPoint); // Set the socket in a 'listener' mode listener.Listen(10); // Continue accepting and processing new connections indefinitely while (true ) { threadEvent.Reset();

Getting Error in Socket Programming...


I am creating one application with socket programming.
I am using visual studio 2008 with windows 7.
I am getting a error Message...

at line....



"No connection could be made because the target machine actively refused it"

class Class1{



void Main(string[] args)



IPAddress[] ipAddress = Dns

Socket Programming-error


AsyncClient.cs(247,40): warning CS0618: 'System.Net.IPAddress.Address' is obsolete: 'This property has been deprecated. It is address family dependent. Please use IPAddress.Equals method to perform comparisons.

Get Same Buffer Size in Socket Programming


Dear All,

Actually i am developing an app which send audio file from client to server and server read the byte and save that file in waver format problem is that  i want to send buffer size of audio file or audio length to server but didint get the same size so plz help me regarding this prob

i am using c#

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

Create 'WebService' layer automatically


Hi all.  is there a utility to automatically create the 'webservice layer' from an existing namespace?  I have several business objects, and I want to expose both the types and methods so that the consumer of the webservice can use the webmethods and also pass custom objects back and forth from the consumer to the webservice and back.  I believe there is something that will do this automatically, but I'm not sure what is available to do that.  Any help would be appreciated.



Coding / Programming Tips for C#

Using proper guidelines and a template-framed style of coding will really helps developer to enjoy the coding with more understandable, reliable code and application development.

C# Object Oriented Programming

So far in C# Essentials we have looked at the basics of programming in C# such as variable types and flow control. Although it would be possible to write a functional program using these techniques, there is much more to becoming a proficient C# programmer. C# is, above all, an object oriented programming language and as such any C# programmer will be expected to create object-oriented applications using this language.

Object Oriented Programming

Four core concept of OOP Object Oriented Programming. 1.Inheritance, 2.Polymorphism, 3.Abstraction and 4.Encapsulation

Object-Oriented Programming Concepts

This is the first in a series of articles describing the use of object-oriented programming techniques as implemented by the C# programming language. This series follows the C# Fundamentals tutorial that beginners are advised to read first.

Parallel port complete: programming, interfacing & using the PC's parallel

Parallel port complete: programming, interfacing & using the PC's parallel


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


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