Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Thu, 8 May 2008 00:11:01 -0700 (PDT),    group: microsoft.public.dotnet.framework.webservices        back       


How to get SoapException details / soap fault details   
Calling a webservice using HttpWebRequest below.  Only WebException
can be caught per documentation.  How about SoapException - how do I
get those details.  Most web services will throw soapexceptions.  Any
way to accomplish this.

public HttpWebResponse SendSoapRequest(string soapEnvelope, string
url)
        {
            //Setup the Request
WebRequest webRequest = WebRequest.Create(url);
            HttpWebRequest httpRequest = (HttpWebRequest)webRequest;
            httpRequest.Method = "POST";
            httpRequest.ContentType = "text/xml";
            httpRequest.Headers.Add("SOAPAction: x");
Stream sendStream= httpRequest.GetRequestStream();
            //Add Soap Envelop to the Request
            StreamWriter writer = new StreamWriter(sendStream);
            writer.Write(soapEnvelope);
            writer.Close();
            sendStream.Close();
            sendStream.Dispose();
            //Send the Request
            WebResponse response = null;
            StreamReader reader = null;
  try
            {
                //Get the response
                response = httpRequest.GetResponse();


            }
            catch (WebException webEx)
            {
                ....


Thanks.
date: Thu, 8 May 2008 00:11:01 -0700 (PDT)   author:   Alpha83

Google
 
Web ureader.com


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