Mohamed Adly

Hi All, i'm new at ASP.Net and i want to know how to make Windows Application invoke a method or even send message to web application. simply it's a presentation player, where the control from the presenter on Windows Application, if the presenter click on next or back button i want the Web-Site to navigate to the next image. so the problem is to send command or even message to the Web Application to invoke the required method in order to navigate to the second image and the opposite direction, the Web-Site End-User may wants to send any question to the presenter, what should i do to deliver the message from the Web Application to the presenter on the Windows Application

Re: Visual C# General Windows Application To WebSite Application and vice versa?

Andreas Johansson

The most simple way is to use .NET webservices to call methods that is published by a website.
http://msdn2.microsoft.com/en-us/webservices/default.aspx




Re: Visual C# General Windows Application To WebSite Application and vice versa?

Mohamed Adly

I see an intro to .Net webservices, but what i don't understand is how can i -from the Webservice itself- call method to be invoked either in My Windows Application or My Web Application.

Another thing i think that it's better to embed both My Windows Application and Web Application within the same solution and add the web service to this solution, is this powerful

So please tell me what to do in steps to make both my windows application talk to my web application and vice versa

Thanks for your reply and waiting for the steps ;-)





Re: Visual C# General Windows Application To WebSite Application and vice versa?

timvw

The keywords for a websearch would be something like 'c# consuming webservice'...

Typically, you choose 'add webreference' in visual studio, which then generates a proxy to interact with the webservice.. And afterwards you can simply instantiate and call methods on the proxy as if it where the webservice itself...





Re: Visual C# General Windows Application To WebSite Application and vice versa?

Mohamed Adly

My Problem is in the WebService itself , Assume the following Web methods to pass messages between Windows Application and Web-Application

[webmethod]

public void FromWindowsToWeb(string WinMessage)

{

// What should i do here to pass this message to the webapplication, regarding that their is a method @ ASP that take that message and do some work

}

[webmethod]

public void FromWebToWindows(string WebMessage)

{

// What should be written here to pass this message from to the windows application, also the same their is a method @ My Windows Application that takes this message and do some work

}

Sure in both applications i add my webservice as a web reference to call these methods, assume @ Windows application:

MyWebServiceObjectAtWindowsApplication.FromWindowsToWeb("Next");

and @ WebApplication:

MyWebServiceObjectatAtWebApplication.FromWebToWindows("Comment123");

that's my problem exactly, what is to be done at the webservice to pass the string from windows to web and vice versa





Re: Visual C# General Windows Application To WebSite Application and vice versa?

Mohamed Adly

My Problem is in the WebService itself , Assume the following Web methods to pass messages between Windows Application and Web-Application

[webmethod]

public void FromWindowsToWeb(string WinMessage)

{

// What should i do here to pass this message to the webapplication, regarding that their is a method @ ASP that take that message and do some work

}

[webmethod]

public void FromWebToWindows(string WebMessage)

{

// What should be written here to pass this message from to the windows application, also the same their is a method @ My Windows Application that takes this message and do some work

}

Sure in both applications i add my webservice as a web reference to call these methods, assume @ Windows application:

MyWebServiceObjectAtWindowsApplication.FromWindowsToWeb("Next");

and @ WebApplication:

MyWebServiceObjectatAtWebApplication.FromWebToWindows("Comment123");

that's my problem exactly, what is to be done at the webservice to pass the string from windows to web and vice versa





Re: Visual C# General Windows Application To WebSite Application and vice versa?

Mohamed Adly

The problem is what is to be done to pass message from Windows To Web Application

Assume the following WebService Methods

[WebMethod}

public void FromWinToWeb(string Message)

{

// What is to be written Here to pass the message from Win to Web Application, calling static method at Web Application that what i'm asking about

}

Regarding that at both Windows and Web applications i add the Web Service as Web-Ref. and make an instance of it, to be able to use methods inside it.

the problem how to call the web application from inside the webservice itself.

what your thought about making the Windows Application, Web Application, and Web Service within the same solution





Re: Visual C# General Windows Application To WebSite Application and vice versa?

Mohamed Adly

The problem is what is to be done to pass message from Windows To Web Application

Assume the following WebService Methods

[WebMethod}

public void FromWinToWeb(string Message)

{

// What is to be written Here to pass the message from Win to Web Application, calling static method at Web Application that what i'm asking about

}

Regarding that at both Windows and Web applications i add the Web Service as Web-Ref. and make an instance of it, to be able to use methods inside it.

the problem how to call the web application from inside the webservice itself.

what your thought about making the Windows Application, Web Application, and Web Service within the same solution





Re: Visual C# General Windows Application To WebSite Application and vice versa?

JDPeckham

Well your problem (in my opinion) is that you have a win app, webapp,AND a service app all with business logic it sounds like. Put ALL of your business logic and data logic in your service, then you only have 1 App, the service, and your any number or type of clients can be really just presentation layer for those service methods.






Re: Visual C# General Windows Application To WebSite Application and vice versa?

Mohamed Adly

I Understand that i should encapsulate all my business logic inside the webservice and add it @ every client from any type ( Win or Web) that's very good idea, and i will did it, but could you tell me how to send message from the Web-Service to the WebSite.

Now the problem of sending messages from the WebSite to the Windows is solved by using some Webmethod that is to be called from the Web Application by adding the webservice as web ref., the second part of the problem is to call some method from the webservice itself to the Website or what's the solution

i'll send the message from the webservice to the windows application using socket programming as my web service is found on a web server, so by adding a class that send network messages from the server to the client this is simple.

The vice versa :-) from the client to web-service to ........... web application fill in the spaces :-) :-)





Re: Visual C# General Windows Application To WebSite Application and vice versa?

Mohamed Adly

Can any body help me how to Send some message from Web Service to My Website some suggest HTTPRequest is this powerful or their is another solution



Re: Visual C# General Windows Application To WebSite Application and vice versa?

Mohamed Adly

Can Any body tell me how to send some message from WebService to web application can i use HTTPRequest or their is another solution