M
Mark Parter
I have installed DSML Services for Windows on a webserver. I've created an ASP.NET page to pass SOAP queries to this using the following code;
Dim strSOAPXML As String = soapreq.Text
Dim objHTTPReq As System.Net.HttpWebRequest
Dim objHTTPRes As System.Net.HttpWebResponse
objHTTPReq = CType(System.Net.WebRequest.CreateDefault(New System.Uri("http://www.someurl.com/dsml/adssoap.dsmlx")), HttpWebRequest)
objHTTPReq.ContentType = "text/xml;charset=""utf-8"""
objHTTPReq.Accept = "text/xml"
objHTTPReq.Method = "POST"
objHTTPReq.Headers.Add("SOAPAction", """http://tempuri.org/Add""")
Dim objStream As System.IO.StreamWriter
objStream = New StreamWriter(objHTTPReq.GetRequestStream(), Encoding.UTF8)
objStream.Write(strSOAPXML)
objHTTPReq.GetRequestStream().Close
'objHTTPRes = objHTTPReq.GetResponse()
Dim objXML As New System.Xml.XmlDocument()
objHTTPRes = objHTTPReq.GetResponse()
objXML.Load(objHTTPRes.GetResponseStream())
objXML.Save(soaprec.Text)
When I pass it a SOAP request, like so;
<se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/">
<se:Body xmlns="urnasis:names:tcSML:2:0:core">
<batchRequest>
<searchRequest dn="cn=a-user,ou=Staff,ou=User Accounts,dc=staff,dc=someurl,dc=com" scope="baseObject" derefAliases="neverDerefAliases">
<filter>
<present name="objectclass"/>
</filter>
</searchRequest>
</batchRequest>
</se:Body>
</se:Envelope>
I always get an 'Internal Server Error' on the 'objHTTPRes = objHTTPReq.GetResponse()' line.
Can anybody offer any advice on how to get this working? I've been trying for days now and am getting balder by the minute!
Dim strSOAPXML As String = soapreq.Text
Dim objHTTPReq As System.Net.HttpWebRequest
Dim objHTTPRes As System.Net.HttpWebResponse
objHTTPReq = CType(System.Net.WebRequest.CreateDefault(New System.Uri("http://www.someurl.com/dsml/adssoap.dsmlx")), HttpWebRequest)
objHTTPReq.ContentType = "text/xml;charset=""utf-8"""
objHTTPReq.Accept = "text/xml"
objHTTPReq.Method = "POST"
objHTTPReq.Headers.Add("SOAPAction", """http://tempuri.org/Add""")
Dim objStream As System.IO.StreamWriter
objStream = New StreamWriter(objHTTPReq.GetRequestStream(), Encoding.UTF8)
objStream.Write(strSOAPXML)
objHTTPReq.GetRequestStream().Close
'objHTTPRes = objHTTPReq.GetResponse()
Dim objXML As New System.Xml.XmlDocument()
objHTTPRes = objHTTPReq.GetResponse()
objXML.Load(objHTTPRes.GetResponseStream())
objXML.Save(soaprec.Text)
When I pass it a SOAP request, like so;
<se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/">
<se:Body xmlns="urnasis:names:tcSML:2:0:core">
<batchRequest>
<searchRequest dn="cn=a-user,ou=Staff,ou=User Accounts,dc=staff,dc=someurl,dc=com" scope="baseObject" derefAliases="neverDerefAliases">
<filter>
<present name="objectclass"/>
</filter>
</searchRequest>
</batchRequest>
</se:Body>
</se:Envelope>
I always get an 'Internal Server Error' on the 'objHTTPRes = objHTTPReq.GetResponse()' line.
Can anybody offer any advice on how to get this working? I've been trying for days now and am getting balder by the minute!