jladd45205
-
Posts
2 -
Joined
-
Last visited
-
Days Won
1 -
Donations
0.00 GBP
Content Type
Profiles
Bug Tracker
Wiki
Release Notes
Forums
Downloads
Blogs
Events
Posts posted by jladd45205
-
-
Yes you can connect to the SOAP Endpoints via C#. Although u cant generate the WSDL, u can manually setup the Envelope XML yourself and send it as a normal web request. Below is some sample code I used to send money via mail to a specific account. You just need to look at the source on how the SOAP endpoint is reading the incoming stuff and then reverse engineer it.
public async Task SendMoney(string charecter, long quanity) { var realm = await _forumnDB.Realms.FindAsync(_realmID); if (!string.IsNullOrWhiteSpace(realm.SoapIP) && realm.SoapPort > 0 && !string.IsNullOrWhiteSpace(realm.SoapUserName) && !string.IsNullOrWhiteSpace(realm.SoapPassword)) { XmlDocument soapEnvelopeXml = GetXMLDoc(string.Format("send money {0} \"Approved GM Request Money\" \"Attached is the money you requested\" {1}\n", charecter, quanity)); HttpWebRequest webRequest = CreateWebRequest(string.Format("http://{0}:{1}", realm.SoapIP, realm.SoapPort), realm.SoapUserName, realm.SoapPassword); InsertSoapEnvelopeIntoWebRequest(soapEnvelopeXml, webRequest); // begin async call to web request. IAsyncResult asyncResult = webRequest.BeginGetResponse(null, null); // suspend this thread until call is complete. You might want to // do something usefull here like update your UI. asyncResult.AsyncWaitHandle.WaitOne(); // get the response from the completed web request. string soapResult; using (WebResponse webResponse = webRequest.EndGetResponse(asyncResult)) { using (StreamReader rd = new StreamReader(webResponse.GetResponseStream())) { soapResult = rd.ReadToEnd(); } } } else { } } XmlDocument GetXMLDoc(string command) { XmlDocument soapEnvelopeDocument = new XmlDocument(); soapEnvelopeDocument.LoadXml(string.Format(@"<SOAP-ENV:Envelope xmlns:SOAP-ENV=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:SOAP-ENC=""http://schemas.xmlsoap.org/soap/encoding/"" xmlns:xsi=""http://www.w3.org/1999/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/1999/XMLSchema"" xmlns:ns1=""urn:MaNGOS""><SOAP-ENV:Body><ns1:executeCommand><command>{0}</command></ns1:executeCommand></SOAP-ENV:Body></SOAP-ENV:Envelope> ", command)); return soapEnvelopeDocument; } HttpWebRequest CreateWebRequest(string url, string username, string password) { HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); webRequest.Credentials = new NetworkCredential(username, password); webRequest.ContentType = "text/xml;charset=\"utf-8\""; webRequest.Accept = "text/xml"; webRequest.Method = "POST"; return webRequest; } static void InsertSoapEnvelopeIntoWebRequest(XmlDocument soapEnvelopeXml, HttpWebRequest webRequest) { using (Stream stream = webRequest.GetRequestStream()) { soapEnvelopeXml.Save(stream); } }
- 1
mmaps issue
in Archived Help and support
Posted
Until the Error is fixed in the script by the devs, you can just edit the script to replace movemap-generator to mmap-extractor