markW - Tuesday, January 13, 2009 1:12 PM:
If I wanted to make a web services connection to the server with the native AML (ie from a Unix machine or such where the IOM isn't available), what is the format and process? Seems like the basic credential properties would XML properties, but not sure how the hierarchy works and could use an example.
Any thoughts?
Thanks,
Mark
PeterSchroer - Tuesday, January 13, 2009 8:47 PM:
Hey Mark,
I don't have the exact answer, which might depend on which libraries are available to you on the Unix or such machine. But this is what the code looks like in .NET and Javascript. In both cases I am using the XMLHTTP object to form and send the SOAP request. I'm sure there is a comparable object / class you can use on your unix system to send a soap message..
Javascript:
var soap = "" +
"<SOAP-ENV:Envelope xmlns:SOAP-ENV=’schemas.xmlsoap.org/.../’ " +
"encodingStyle=’">schemas.xmlsoap.org/.../’>" +
"<SOAP-ENV:Body>" + YOUR-AML-HERE + "</SOAP-ENV:Body></SOAP-ENV:Envelope>";
var xmlHTTP = new ActiveXObject ("microsoft.XMLHTTP");
xmlHTTP.open("POST", "//localhost/Innovator/Server/InnovatorServer.aspx", false);
xmlHTTP.setRequestHeader("SOAPaction", "ApplyItem");
xmlHTTP.setRequestHeader("DATABASE", "InnovatorSolutions");
xmlHTTP.setRequestHeader("AUTHUSER", "admin");
xmlHTTP.setRequestHeader("AUTHPASSWORD","xxxxxxxxxxx"); // note this is the hashed password, not plain text.
xmlHTTP.send(soap);
var XMLResult = xmlHTTP.responseText;
.NET
Public Function SendAML(ByVal Action As String, ByVal AML As String, ByVal Config As XmlDocument, ByVal LogName As String) As String
Dim Result As String = ""
Dim Result2 As String = ""
Dim httpWebRequest1 As HttpWebRequest = CType(WebRequest.Create("server-url/server/innovatorserveraspx"), HttpWebRequest)
Dim bs As Byte() = Text.Encoding.UTF8.GetBytes(AML)
httpWebRequest1.Method = "POST"
httpWebRequest1.ContentLength = CLng(bs.Length)
httpWebRequest1.ContentType = "text/xml"
httpWebRequest1.Headers.Add("SOAPAction", Action) ' usually = "ApplyItem" or "ApplyMethod"
httpWebRequest1.Headers.Add("AUTHUSER", "admin")
httpWebRequest1.Headers.Add("AUTHPASSWORD", "xxxxxxxPasswordxxxxx")
httpWebRequest1.Headers.Add("DATABASE", "database-name")
Dim stream2 As Stream = httpWebRequest1.GetRequestStream()
stream2.Write(bs, 0, bs.Length)
stream2.Close()
Dim httpWebResponse1 As HttpWebResponse = CType(httpWebRequest1.GetResponse(), HttpWebResponse)
Dim stream1 As Stream = httpWebResponse1.GetResponseStream()
Dim encoding As Encoding = encoding.GetEncoding("utf-8")
Dim streamReader2 As StreamReader = New StreamReader(stream1, encoding)
Result = streamReader2.ReadToEnd()
streamReader2.Close()
stream1.Close()
Jagathees - Thursday, April 28, 2016 12:36 PM:
Can you tell me how to call SOAP request using Java