Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Exchange
2000.active.directory
2000.admin
2000.announcements
2000.app.conversion
2000.applications
2000.clients
2000.clustering
2000.connectivity
2000.development
2000.documentation
2000.general
2000.information.store
2000.interop
2000.kms
2000.misc
2000.protocols
2000.realtime.collabo.
2000.setup
2000.transport
2000.win2000
admin
application.conversion
applications
clients
clustering
connectivity
design
development
misc
mobility
setup
tools
  
 
date: Sun, 23 Dec 2007 07:33:41 -0800,    group: microsoft.public.exchange.development        back       


WebDav with HttpRequest   
Hi,
I wrote an application(VB.Net) with XmlHttp object (COM) to do some 
operations in the exchange server. This application works fine. Now , I want 
to write the same application with HttpRequest(.Net) instead of XmlHttp, but 
always When I try to get a response from a query, I get the following error :
The remote sever returned an error:(404) Not Found.
Here some lines of the application:

 '***** Save the attachment *******
' sUrlAttach is the url of an attachment in the exchange
        Dim myreq As Net.HttpWebRequest = Net.WebRequest.Create(sUrlAttach)
        myreq.Method = "GET"
        myreq.Credentials = New System.Net.NetworkCredential("****", "*****")
        ' The error occures after this line :
        Dim o_resp As Net.WebResponse = myreq.GetResponse()
        Dim instream As Stream = o_resp.GetResponseStream()
        Dim sr As StreamReader = New StreamReader(instream)
        Dim sResp As String = sr.ReadToEnd()
        Dim fs As New FileStream("C:\" & attchFileName, FileMode.Create)
        Dim w As New StreamWriter(fs)
        w.Write(sResp)
        w.Close()
        fs.Close()

Like I wrote before, This is just one example ,and I have this problem with 
others querys too.

Thanks,

David
date: Sun, 23 Dec 2007 07:33:41 -0800   author:   DavidE

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us