1.Implement linux mono DevelopWindowsWebService
L linux and windows are in a LAN segment
L publish webService in IIs of windows
2.WindowsSettings in
LWebServiceCode
Using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Web;
Using System. Web. Services;
Namespace MonoWebService
{
/// <Summary>
/// Summary of Service1
/// </Summary>
[WebService (Namespace = "http://tempuri.org/")]
[WebServiceBinding (ConformsTo = WsiProfiles. BasicProfile1_1)]
[System. ComponentModel. ToolboxItem (false)]
// To allow ASP. net ajax to call this Web service from a script, cancel the comments to the downstream.
// [System. Web. Script. Services. ScriptService]
Public class Service1: System. Web. Services. WebService
{
[WebMethod]
Public string HelloWorld ()
{
String text = string. Format ("Machine Name: {0} Time: {1}", this. Server. MachineName, DateTime. Now. ToString ());
Return text;
}
}
}
L publish webService
L test in IE
L if the fire prevention function of the local machine is enabled, disable it. If the firewall is enabled, windows will block linux access
3.LinuxSettings in
LMonoCall code in
Using System;
Using System. Collections;
Namespace WebServiceCallApp
{
Class MainClass
{
Public static void Main (string [] args)
{
// Console. WriteLine ("Hello World! ");
ArrayList myList = new ArrayList ();
WinService. Service1 myService = new WinService. Service1 ();
Console. Write (myService. HelloWorld ());
Console. Read ();
}
}
}
L confirm that Windows WebService is accessible
L add webService to Mono
Be sure to add http: // 10.168.14.131/Service1.asmx? Wsdl
The Wsdl must be available. Otherwise, the monoDevelop cannot find the webService.
LRunning Effect