Having problems using WebService

Discussion in 'ASP .Net Web Services' started by Mark Parter, Jul 13, 2004.

  1. Mark Parter

    Mark Parter Guest

    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="urn:eek:asis:names:tc:DSML: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!
     
    Mark Parter, Jul 13, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. judith
    Replies:
    16
    Views:
    1,078
    Chris Uppal
    Oct 16, 2006
  2. Milsnips
    Replies:
    2
    Views:
    264
    Surya Yadav
    Sep 26, 2004
  3. phil2phil

    having problems with webservice (proxy) reference

    phil2phil, Aug 12, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    128
    ArunPrakash
    Aug 13, 2005
  4. Roberto Giorgetti

    Error connection using webservice locally (3 webservice in balanci

    Roberto Giorgetti, Jun 13, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    212
    Roberto Giorgetti
    Jun 13, 2006
  5. Vipin Vm
    Replies:
    3
    Views:
    287
    Vassilis Rizopoulos
    Jul 22, 2008
Loading...

Share This Page