Deployment methods as web service operations in winform

I can not expose my methods as web methods in winform and other clients call them webservice? Basicall I'm trying to get my winform application to host a web service without asp.net or iis.

I am trying to get ^% & ^ & blackberry to communicate with my winform application .... trying for hours looking for another way to get two to talk without http webservice.

I watched UDP, but && BB does not provide any documentation for Visual Studio development other than webservice.

0
source share
2 answers

Many people have a problem: they forget that they need to add a firewall rule or port preface in order to allow an external connection to the endpoint when trying to connect to a hand-held device using an operator’s Internet connection (rather than Wi-Fi). this may be completely skipped, since the blackberry is sitting next to you, and you do not think of it as an outside party.

If not, try an application hosted in WCF

You can provide your service using the WCF endpoint.

from http://msdn.microsoft.com/en-us/library/ms731758.aspx

// Host the service within this EXE console application. public static void Main() { // Create a ServiceHost for the CalculatorService type and use // the base address from config. ServiceHost hostDefault = new ServiceHost(typeof(CalculatorService)); int manualFlowControlLimit = hostDefault.ManualFlowControlLimit; basicHttpBinding portsharingBinding = new basicHttpBinding(); hostDefault.AddServiceEndpoint(typeof( CalculatorService ),portsharingBinding,"http://localhost/MyService" ); using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService))) { // Open the ServiceHost to start listening for messages. serviceHost.Open(); // The service can now be accessed. Console.WriteLine("The service is ready."); Console.WriteLine("Press <ENTER> to terminate service."); Console.ReadLine(); // Close the ServiceHost. serviceHost.Close(); } } 
+1
source

Grade. You can host a SOAP service using WCF, but I'm not sure if this is a great architecture.

0
source

Source: https://habr.com/ru/post/1302732/


All Articles