.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Help - Cannot call webservice Get error: Server was unable to process request. --> Object reference

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ADO.Net
Here is my code, I don't fully understand the erro because I have instantiated all objects
Any help or advice appreciated.
Dim transactionResult As PremiumCredit.TransactionResult = New PremiumCredit.TransactionResult
        Dim newBusiness As PremiumCredit.NewBusiness = New PremiumCredit.NewBusiness
        Dim transferEngine As PremiumCredit.XMLTransferEngine = New PremiumCredit.XMLTransferEngine
        'Build up NewBusiness Object
        newBusiness.AddCoverCode = String.Empty
        newBusiness.BankAccountName = Session("BankAccountName").ToString
        newBusiness.BankAccountNumber = Session("BankAccountNumber").ToString ' 02149187
'Populate the rest of new Business object etc
        System.Net.ServicePointManager.ServerCertificateValidationCallback = New System.Net.Security.RemoteCertificateValidationCallback(AddressOf ValidateCertificate)
            transactionResult = transferEngine.Crea

View Complete Post

More Related Resource Links

Webservice, server was unable to process request error


System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XsdValidatingReader.Read()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at BusinessObjects.OrderHelper.PlaceOrder(String StrorderXml) in C:\Documents and Settings\mchinta\My Documents\Visual Studio 2008\Projects\CcbApp\BusinessObjects\OrderHelper.cs:line 63
   at IServiceReference.IOrder.PlaceOrder(String orderXml) in C:\Documents and Settings\mchinta\My Documents\Visual Studio 2008\Projects\CcbApp\IServiceReference\IOrder.asmx.cs:line 24
   --- End of inner exception stack trace ---

Here is my XML

<?xml version='1.0' encoding='utf-8' ?><Order>Data</Order>

My S

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Object canno

hello,i am using a web servicewrtitten in .net and i access the webservice from my wepApplication i get this error System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Object cannot be cast from DBNull to other types.my code is access webservice: protected void btnSave_Click(object sender, EventArgs e)        {            int intStatusCode;            dtProjectStatus = (DataTable)ViewState["dtProjectStatus"];            try            {                objService.Credentials = System.Net.CredentialCache.DefaultCredentials;                if(dtProjectStatus.Rows.Count>0)                {                  intStatusCode = objService.InsertTest(dtProjectStatus);                }   

Unable to install SQL Server 2005 Express: The error is (-2146885628) Cannot find object or propert

I am installing 2 instances of SQL Server 2005 Express for 2 different accounting packages on Windows XP SP3.  I have the first installed, after much use of the forums.  The version of setup.exe was 2005.90.2047.0. I am not able to install the second, for Microsoft Office Accounting 2009, setup.exe version 2005.90.3042.0.  The error I am getting in Summary.txt is: Error String    : The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually." The error is  (-2146885628) Cannot find object or property. Error Number    : 29503 The errorlog file for MSSQL.2 has a lengthier description: 2009-09-05 23:00:32.13 Server      Microsoft SQL Server 2005 - 9.00.3042.00 (Intel X86)     Feb  9 2007 22:47:07     Copyright (c) 1988-2005 Microsoft Corporation     Express Edition on Windows NT 5.1 (Build 2600: Service Pack 3) 2009-09-05 23:00:32.31 Server      (c) 2005 Microsoft Corporation. 2009-09-05 23:00:32.31 Server      All rights reserved. 2009-09-05 23:00:32.32 Server      Server process ID is 5516. 2009-09-05 23:00:32.32 Server      Authentication mode is MIXED. 2009-09-05 23:00:32.35 Server      Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\LOG\ERRORLOG'. 2009-09-05 23:00:32.38 Server      Regi

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Index was ou


Dear All,

I am using a client program(c#) which calls the web service.

I am getting the below error:

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Index was outside the bounds of the array.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at KrtoPGMSSQLWebServiceClient.rtowebservice.Service.PostGreDataSync(String StrNonQuery, Byte[] byteRowTimestamp, String TableName, Int32 strUniId, String strRemoteCode)
   at KrtoPGMSSQLWebServiceClient.ManipDataExportClient.InsertManipData(DataSet ManipTablesDS) 

KrtoPGMSSQLWebServiceClient--is namespace name

ManipDataExportClient--is class name

InsertManipData--is function name (which calls the DataSet  ManipTablesDS)


I want to know that  whether i am getting this error at the time of calling web service or while accessing web service and why.

Plzzzz help me solve this...

Thank You

Registering controls of current assembly object reference NOT set error


Hi There,

I have created a simple ASP.net Web Application (2.0) and have added a web user control.

Now in my page I have added this control but I have registered like this,

<%@ Register Assembly="WebApplication1" Namespace="WebApplication1" TagPrefix="Custom" %>

Which means I want to access all the controls in my current Web Application project

Then I have added my user control like this,

<Custom:MyUserControl ID="MyUserControl1" runat="server" PublicProperty="Hello" />

Every thing is fine but when I execute the project, NO control on my user control gets "instantiated" and thus I receive error "Object Reference Not Set"

Note that My Control has,

1) Public property PublicProperty as String

2) 1 Label control

In Load Event Handler I am setting Text property of Label Control to PublicProperty. Here object reference NOT set error occurs (which means Label control is NOT initialized).

I don't want to register my control using Src, TagPrefix etc. Any ideas?


FileUpload error: Object reference error


I have a FormView with a FileUpload to upload an image in a database.

I keep getting an object reference error.(view code)

I am using this same script to upload the image to the database, but when I try to update the file upload I get the error.    

string strFilePath=Server.MapPath("\\images\\"+fupdImage.FileName);

        Byte[] image=null;
        HttpPostedFile imgVid=FileUpload.PostedFile;

        image=new Byte[imgVid.ContentLength];//Object reference not set to an instance of an object.

        if(FileUpload.HasFile) {
        string imageFile=FileUpload.PostedFile.FileName;
        int index=imageFile.LastIndexOf(".");
        string fileFormat=imageFile.Substring(index+1);


Object reference error

Hi, I have an XML File shown below<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:g="http://base.google.com/ns/1.0"> <Title>Products</Title> <link rel="self" href="http://localhost:49200/" /> <updated>30-08-2010T04:17:45Z</updated> <author> <id>tag:localhost,30-8-2010:/support/products</id> <entry> <id>13137</id> <title>example</title> </entry> </author> </feed> I am trying to read the id tag in the entry tags but i get object reference not set to ............. error the code to read it isDim prddoc As New XmlDocument prddoc.Load(Server.MapPath("prd.xml")) Dim xmlList As XmlNodeList = prddoc.GetElementsByTagName("entry") Dim rootNode As XmlElement rootNode = prddoc.DocumentElement For ic As Integer = 0 To xmlList.Count - 1 response.write(prddoc.SelectNodes("//entry/id").Item(0).InnerText Nextthe error is on line response.write(prddoc.SelectNodes("//entry/id").Item(0).InnerTextplz help  

Error "Object reference not set" when I try to set a Navigation Property

I'm using Entity Framework. The following code throws a runtime error "System.NullReferenceException: Object reference not set to an instance of an object." The line before the error, it looks like newControl is in fact instantiated.My model has a Control entity and a ControlType entity. Control includes the Navigation Property "ControlType." I'm trying to set ControlType.Type = 2.SurveyFormControlsModel.Control newControl = new SurveyFormControlsModel.Control(); newControl = CreateControl(childTokenName, ControlTypeEnum.TextBox); newControl.ControlType.Type = 2; // <<--ERROR HERE context.Controls.AddObject(newControl);                                SurveyFormControlsModel.Control newControl = new SurveyFormControlsModel.Control();                                 if (listItems.Count == 0)                                 {                                     newControl = CreateControl(childTokenName, ControlTypeEnum.TextBox);                    &

Get xhr object in vb.net when error occured in ajax call using JQuery.

Hi Dude,   I have a big problem in Jquery ajax call. I am calling the web service whenever click the update button. I have a separate web service class, in which consist of few methods. When I calling the web service method, I have made the error handling and log the error information in db after that I have to override the "ex" that means error object to XMLHttpRequest. Is it possible to assign the sqlexception to ajax object (xhr) in vb.net? Please help me its much more useful for me.   Thank in advance.

Object reference not set to an instance of an object error.

i've installed the VSeWSS.msi on VS 2005, i'm using SPS 2007, i'm developing on my workstation in C#, i've added the Mircosoft.Sharepointserver dll reference to my project but i still can't deploy a very basic webpart. i get the "Object reference not set to an instance of an object" error but there's no reference to a line, column, project or anyhting. very frustrating. any suggestions/links whould be appreciated.

Login error - Object reference not set to an instance of an object.

Hi all,I've set up the login section as a user control. WheneverI log in I get a "Object reference not set to an instance of an object", with the code stopping on this line: if (Membership.ValidateUser(txtUserName.Text,txtPassword.Text))Can anyone tell me how to fix this please?protected void LoginButton_Click(object sender, EventArgs e) { TextBox txtUserName = loggedin.FindControl("UserName") as TextBox; TextBox txtPassword = loggedin.FindControl("Password") as TextBox; CheckBox ckbRememberMe = loggedin.FindControl("RememberMe") as CheckBox; if (Membership.ValidateUser(txtUserName.Text,txtPassword.Text)) { FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, ckbRememberMe.Checked); } else { // Msg.Text = "Login failed. Please check your user name and password and try again."; } } <asp:LoginView ID="loggedin" runat="server"> <AnonymousTemplate> <asp:Login ID="Login1" runat="server"> <LayoutTemplate> <table id="mainbox" width="400"> <tr> <td width="150" class="label">

Strange Repeater Error, Object reference not set, Label not visible etc etc..

Hi Everyone,This is very strange and as of yet I cant seem to get round it, although it is a somewhat easy error to identify it is however becoming very annoying as everything I try doesn't seem to work...The repeater displays results for upcoming subscribers birthdays and after their day and month ("dd/mm/") I have a label to display the current year. This causes the old error of: Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error:  Line 55: Label lblYear = e.Item.FindControl("lblYear") as Label;Line 56: Line 57: lblYear.Text = DateTime.Now.Year.ToString();Line 58: }Line 59: As you can see the object is set correctly - The ASPX is below, for saving time on reading etc I've posted the repeater script only and not the whole page, although I can do if needs be.I've tried a number of things with subtle differences but to no avail: with Literal, same error - Tried inserting the year directly via <%#((system.datetime).now.year.tostring())%> or something to that effect, this also doesnt

Error while export to pdf-Object reference not set to an instance of an object

Hello, I am getting error while rendering the report to pdf in SSRS 2008. This is happening randomly and sometimes I get this error. I have SQL Server 2008 SP1 installed in my system . I installed the cumulative update 1 for SP1 also but no luck. Every time when export to pdf fails, SSRS is creating the dump file in the logs. I have captured the log of this specific error. Please let me know if you have any idea about this.   reportrendering!ReportServer_0-297!1ec4!03/30/2010-10:32:57:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report., ; Info: Microsoft.ReportingServices.ReportProcessing.UnhandledReportRenderingException: An error occurred during rendering of the report. ---> Microsoft.ReportingServices.OnDemandReportRendering.ReportRenderingException: An error occurred during rendering of the report. ---> System.NullReferenceException: Object reference not set to an instance of an object.   at Microsoft.ReportingServices.Rendering.HPBProcessing.Paragraph.get_SpaceBefore()   at Microsoft.ReportingServices.Rendering.RichText.LineBreaker.FlowParagraph(Paragraph paragraph, Directions direction, IntPtr hdc, Single dpiX, FontCache fontCache, FlowContext flowContext, Boolean keepLines, SizeF flowContextSize, Int32& contentOffset)   at Mi

Help with Object reference not set to an instance of an object. error.

I was given a chunk of code to help with accessing dynamic forum controls about a week back and when I implemented the code I get the error "Object reference not set to an instance of an object". I asked in the thread the code was given but have not recived an answer yet (asked about 4 days ago) and I think that is beause  the thread is marked as resolved. The line of code  causing the error is   if(t.Equals(this.ddlAmountToAdd.ClientID)&&!string.IsNullOrEmpty(v))    And here is the full code for the c# .Net 4 page.using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class GameInformation_AddUpcomingRelease : System.Web.UI.Page { public string[] Regions = { "USA", "Japan", "Europe", "Other" }; //Create a string array of regions. public string[] Platforms = { "PlayStation 3", "X-Box 360", "Wii", "Computer", "PSP", "Other" }; //Create a string array of platforms. protected void Page_Load(object sender, EventArgs e) { ddlPlatform1.DataSource = Platforms; ddlPlatform1.DataBind(); ddlRegion1.DataSource = Regions; ddlRegion1.DataBind(); } protected override void OnInit(EventArgs e)

Configure managed accounts - object reference not set to an instance of an object - error

I was working in central admin and activated the managed accounts password change for the farm account with the option to change the password now.  I got the email notification that the password was changed and it seems in the log files that it did update all the credentials that were used with the account.  Problem is now that when I hit the configure managed accounts link in central admin all I get is the error: Error Object reference not set to an instance of an object.  Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: c6dc7a46-894f-4b85-8711-8af1e8ec7903 Date and Time: 8/23/2010 9:20:20 AM Added information from logs: 08/23/2010 10:41:33.24  w3wp.exe (0x0F2C)                        0x07FC SharePoint Foundation          Logging Correlation Data       xmnv Medium   Name=Request (GET:http://cmtcalcium:33333/_admin/ManagedAccounts.aspx) b9fae5a9-7405-407d-87fc-239dc0ff59d0 08/23/2010 10:41:33.24  w3wp.exe (0x0F2C)                        0x07FC SharePoint Foundation     &n

Giving me an error "Object reference not set to an instance of an object."

Hello Everyone, I am currently developing a website for online examination.  For that I have to collect user information at the time of registration. I want to develop a 3-tier application. I have SignUpWizard. Aspx page. I have also created 3 classes (Users.cs, UserDAL.cs and UserBAL.cs) and 1 stored procedure (InsertUserInfo).Code for Users.cs:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration; using System.Data.SqlClient; using System.Web.Security; using System.Data; namespace ITIL.DomainModels { public class Users { public int UserID { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Username { get; set; } public string Password { get; set; } public string EmailAddress { get; set; } public string dateTime { get; set; } public string IPAddress { get; set; } public string SecurityQuestion { get; set; } public string SecurityAnswer { get; set; } } }Code for UserDAL.cs:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Data.SqlClient; using System.Configuration; using ITIL.DomainModels; namespace ITIL.DAL { public class UserDAL { publi

Site Manager Error object reference error line 145 SiteManager.aspx SmtPostBackHandler1.UniqueID

Hi I am getting error bellow irrespective of if its IE or firefox Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 143: Line 144: Line 145: <a onclick='javascript:__doPostBack("", "Refresh=<%= TreeView1.SelectedNode.Value %>")' style="cursor:pointer"> Line 146: <SharePoint:EncodedLiteral runat="server" text="<%$Resources:cms, SmtRefreshLink%>" EncodeMethod='HtmlEncode'/> Line 147: Source File: c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\SiteManager.aspx Line: 145 Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] Microsoft.SharePoint.Publishing.Internal.WebControls.ObjectSerializer.get_WebServerRelativeUrl() +148 Microsoft.SharePoint.Publishing.Internal.WebControls.ObjectSerializer.get_CachedList() +149 Microsoft.SharePoint.Publishing.Internal.WebControls.ObjectSerializer.get_AutomationId() +178 Microsoft.SharePoint.Publishing.Internal.WebContro
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend