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

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

WCF NetDispatcherFaultException - Throws exception only when I include file (List)

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :WCF

Hi All,

My service would return a file (List<byte> - use WSSF so dont know why it is a list rather than a byte array. When I consume the service it throws the following exception:

"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://www.tempuri.org. The InnerException message was 'Error in line 1 position 1124. Expecting state 'Element'.. Encountered 'Text'  with name ', namespace '. '.  Please see InnerException for more details."

Any ideas on how to fix it would be much appreciated.



View Complete Post

More Related Resource Links

Generic list with WebService throws 'Two Mappings for []' exception


Please consider below libraries:

ClassLibrary.dll (Smart Device Class Library project)

 public class B
        public string test;

 public class C
        public List<B> tempList = new List<B>();

WebServie (.NET 2.0)

Contains reference of ClassLibrary.dll
public class Service1 : System.Web.Services.WebService

        public List<B> ListOfB( string str)
            B obj = new B();           
            obj.test = str;

            List<B> list = new List<B>();

userprincipal.changepassword throws exception


Hi all,

      userprincipal.changepassword(oldpassword, newpassword);

gives error: that is Configuration information could not be read from the domain controller, either because the machine is unavailable, or access has been denied. (Exception from HRESULT: 0x80070547)

but userDirectoryEntry.invoke("ChangePassword", new object[] { oldpassword, newpassword });

      userDirectoryEntry.CommitChanges works fine.

Any one please tell me the reason behind this.

WebControls.TableRow throws exception on Add()


I have the following method to strip hidden and user-specified columns from a gridviewrow and return a tablerow. 

    Private Shared Function StripHiddenColumns(ByVal gvRow As GridViewRow, ByVal ColumnsToExclude() As Integer) As TableRow

        Dim row As New TableRow
        Dim i As Integer = 0
            For Each cell As TableCell In gvRow.Cells
                If cell.Visible Then
                    If Not ColumnsToExclude.Contains(i) Then
                    End If
                End If
                i += 1

            Return row
        Catch ex As Exception
            Throw ex
        End Try
    End Function

However, when I run this code and hit the Add method for the TableRow,  I get an InvalidOperationException stating the Collection was modified; enumeration operation may not execute.  I've gotten this exception before, but usually it's because I'm attempting to modify a table that is databound.  This particular one is not, i am creating it.  Can anyone offer any insight? 

Thanks in advance.


SPWorkflowManager.CancelWorkflow throws an exception


Sorry, I had posted that same question in the "Dev and Programming" forum, but I'm reposting here because it's more of a workflow related question.

We are trying to cancel workflow programmatically.

It used to work fine until we migrated our environment to a new server and now it fails.

Our code goes something like this: 


foreach (SPWorkflow wf in form.Workflows)


//code omitted for brievety



But an ArgumentException is thrown.

Msdn docs say that an ArgumentNullException exception can be thrown (ArgumentNullException: The workflow to cancel belongs to an SPWeb object that has been deleted) but it is actually an ArgumentException that is thrown. Plus I know for sure that the SPWeb does not get deleted.

I tried to reflector what piec

List common file types in a .NET project.

List common file types in a .NET project.

Powershell script to copy a list attachment to a file

I have a script that builds a list of items.  I'd like to add the ability to download the list items' attachments to a local directory.  IS this possible?  There are lots of examples of how to add attachments but nothing that can download the attachments.  Any help would be appreciated.

EvaluateOldNewStates() throws exception when updating TreeViewItem.IsSelected

I apply a WPF theme in my application. At some point in my code, I need to change the selected tree view item. so I update the property MyViewModel.IsSelected and raise PropertyChanged event. Then I get this: Object reference not set to an instance of an object. System.Windows.StyleHelper.EvaluateOldNewStates(MultiTrigger multiTrigger, DependencyObject triggerContainer, DependencyProperty changedProperty, DependencyPropertyChangedEventArgs changedArgs, Int32 sourceChildIndex, Style style, FrameworkTemplate frameworkTemplate, Boolean& oldState, Boolean& newState) System.Windows.StyleHelper.InvokePropertyTriggerActions(TriggerBase triggerBase, DependencyObject triggerContainer, DependencyProperty changedProperty, DependencyPropertyChangedEventArgs changedArgs, Int32 sourceChildIndex, Style style, FrameworkTemplate frameworkTemplate) System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(Style ownerStyle, FrameworkTemplate frameworkTemplate, DependencyObject container, DependencyProperty dp, DependencyPropertyChangedEventArgs changedArgs, Boolean invalidateOnlyContainer, FrugalStructList`1& triggerSourceRecordFromChildIndex, FrugalMap& propertyTriggersWithActions, Int32 sourceChildIndex) System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEve

Page navigation in a frame throws an exception

I created a very simple WPF project that exhibits the following error. I have no idea how to get of this error. System.Windows.Data Error: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.Menu', AncestorLevel='1''. BindingExpression:Path=TemplatedParent; DataItem=null; target element is 'MenuItem' (Name=''); target property is 'CommandTarget' (type 'IInputElement') Steps to reproduce:1. Create a WPF Application project in Visual Studio 2008 (Windows 7)2. Create Page1.xaml <Page x:Class="WpfApplication1.Page1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Page1"> <TextBlock> <Hyperlink NavigateUri="Page2.xaml">Page 2</Hyperlink> </TextBlock> </Page> 3. Create Page2.xaml <Page x:Class="WpfApplication1.Page2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Page2"> <TextBlock> <Hyperlink NavigateUri="Page1.xaml">Page 1</Hyperlink> </TextBlock> </Page> 4. Add a frame in Window1.xaml <Window x:Class="WpfAppli

NullReference Exception when editing an xml file in C#

When trying to add new node to Category node, I get categoryNode is null, but it exists in xml file CODE: XmlDocument     xmlDoc = new XmlDocument(); xmlDoc.Load(requestPath);     XmlNode categoryNode = xmlDoc.SelectSingleNode("CATEGORY");     XmlNode newNode = xmlDoc.CreateElement("REQUEST");     XmlAttribute newAttribute = xmlDoc.CreateAttribute("description"); newAttribute.Value = request.GetId(); newNode.InnerText =   "blank"; newNode.Attributes.Append(newAttribute); categoryNode.AppendChild(newNode); xmlDoc.Save(requestPath);   FILE: <GROUP description="Kwang">   <CATEGORY description="soo">blank</CATEGORY>   </GROUP>

SSIS throws error when it doesn't find file

Hello All, I am facing one issue that i dont know in advance if there is file on FTP or not. I scheduled a job which runs every hour which in turn calling SSIS package. Now, when there is file on FTP, it works fine. But, when there is no file on FTP then itthrows error which i want to handle. Is it possible to check for any files present on FTP? Cheers, Pranav

customize list view table header css file

i need to make table header for my list to be red and on hover to get specific  image so all my site have the same appearence also i need this to reflect to the list view webpart thanks

How to include a javascript file in a custom action?

I need to call a custom javascript function from a ribbon button, how do I include the javascript file within the custom action solution in order that it will be properly referenced by the html output? I am not allowed to define a custom masterpage at this point. So what can I do?   Thanks, Stephan  

MDAC SDK - why is the list of OLE DB providers different to what I see when creating a UDL file?

In MDAC 2.8 SDK on Windows Server 2003 SE x64.  Using RowsetViewer 2.70, list of datasources is not same as when I edit a UDL file on the same server.  Why is this? I want to test a specific OLE DB provider, but it's not on the list within the SDK's tools.  I can see the specific provider in the registry, and it has the correct format as defined in the SDK's OLE DB documentation for providers, so It's installed correctly.  Note, the provider works okay with the application and tests okay in the UDL file edit dialog.  It's just the SDK that I can't use it in :-( Alternately, is there another (3rd party?) tool I could use?  All I'm looking to to do is run simple SQL query test via OLE DB to get timings.  Note, I'm a programmer, but not used to ADO or OLE DB interfaces - that's why I'm looking for a ready made tool :-) Any help would be be great, thanks, Richard.  

CLR Profiler for the .NET Framework 2.0 : A bug (with possible fix!) - It throws exception - null ob

CLR Profiler for the .NET Framework 2.0   I tied to profile a service on my machine. But when I try to see the heap data (during reading of the log file) it throws exception that the object reference is not set (null object).   I debugged the CLR profiler and found that in class ReadNewLog, there is method "ReadFile" internal void ReadFile(long startFileOffset, long endFileOffset, ReadLogResult readLogResult, int requestedIndex) ...     if (matched > 0 && c != -1)     {         /* use some other stack trace as a reference */         int otherStackTraceId = ReadInt();         otherStackTraceId = stacktraceTable.MapTypeSizeStacktraceId(otherStackTraceId);         int[] stacktrace = stacktraceTable.IndexToStacktrace(otherStackTraceId);         if (matched > stacktrace.Length - hadTypeId)             matched = stacktrace.Length - hadTypeId;         for(int i = 0; i < matched; i++)         {             int funcId = stacktrace[i + hadTypeId];             Debug.Assert

File Not Found Exception from iiscore.dll

Create a asp.net mvc project with the default template  and used bmc appsight to monitor the w3wp process ; so when ever an action is clicked an exception is occured in iiscore.dll here is the sample one which i got.  Log Entry 530641OperationOpen "\\?\C:\CRAPPYTEST\HOME\ABOUT"CommentThe system cannot find the path specified. ProcessW3WP.exe:5436:5844Causality ID: {0B49C343-7918-4721-A53E-FFD4C7A1C35D}Moduleiiscore.dllTimeStart - Sep 14 18:39:43.913035Duration - 0.000121Stack Dumpiiscore.dll, 0x5d65fddciiscore.dll, 0x5d64b7b3iiscore.dll, 0x5d64fe97iiscore.dll, 0x5d65270fiiscore.dll, 0x5d6562dfiiscore.dll, 0x5d656338iiscore.dll, 0x5d65084eWEBENGINE.DLL, 0x5c8c289bWEBENGINE.DLL, 0x5c8c28d0System.Web.ni.dll, 0x1e7cdd3dSystem.Web.ni.dll, 0x1e7cdb80mscorwks.dll, 0x71761e6fmscorwks.dll, 0x719ba26emscorwks.dll, 0x718bdf6fmscorwks.dll, 0x719ba3a9mscorwks.dll, 0x718bef35mscorwks.dll, 0x719ba42dWEBENGINE.DLL, 0x5c8c7a2eWEBENGINE.DLL, 0x5c8c34cfmscorwks.dll, 0x718bea90mscorwks.dll, 0x718be3a2mscorwks.dll, 0x718be516mscorwks.dll, 0x718a1ec9kernel32.dll, 0x76881194ntdll.dll, 0x76f8b3f5ntdll.dll, 0x76f8b3c8

SharePoint 2010 Export list Items to Excel, wrong url in iqy file

Hi, I have a SharePoint 2010 Environment that uses https://portal.<something>.com. Exporting to Excel of a list uses wrong URL. When I go to the a list, select the list to show the "office ribbon" and then select export to excel, excel will show the error "Excel cannot connect to the SharePoint List". When I take a look at the IQY file that is created it contains the wrong url: http://portal.<something>.com instead of https://portal.<something>.com Changing the URL in the IQY file manualy to https://portal.<something>.com and then opening it will excel is working fine, list data is exported to excel then. Alternate access mapping is configured to use https://portal.<something>.com as default, export to access is working normaly. I already deleted the http://portal.<something>.com alternate access mapping once to see if this fixes the problem. No fix, even not after IISreset or rebooting the server. Where or how is the export to Excel IQY file created and where is it possible to fix the URL it is putting in the IQY file? Grtz, Arjan

Attach File to Custom List

Hello - I need to use the Client Object Model to attach an item to a custom list item.  I have attachments enabled on the custom list.  The following code will upload a attachment to a list item ONLY if at least one attachment was added to the item via SharePoint. Dim credentials As New System.Net.NetworkCredential(MyUser, MyPassword, MyDomain) Dim SiteUrl As String = "http://spsandbox13" Dim clientContext As New ClientContext(SiteUrl) clientContext.Credentials = credentials '-- List item 41 hard coded for testing Dim attachmentPath As String = String.Format("/{0}/Lists/{1}/Attachments/{2}/{3}", "sites/ITS/GBPlayground", "FormConfiguration", "41", "SomeFileNameForMe7") Using fs As New FileStream("C:\Users\gbadmin\Documents\WhatsUp.txt", FileMode.Open) Microsoft.SharePoint.Client.File.SaveBinaryDirect(clientContext, attachmentPath, fs, True) End Using The above code works great as long as the item already has an attachment.  If the item doesn't have an attachment I get a (409): Conflict error.  I've also tried to create a folder in the attachments folder for the list item to see if once the folder was created that the error would go away.  The code for this is as follows: Dim list As Microsoft.SharePoint.Client.List = clientContext.Web.Lists.GetByTitle("
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