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

Top 5 Contributors of the Month
Post New Web Links

Exchange Web Services - Attachments not working

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :.NET Framework

I am trying to attach files using the Exchange Web Services in C#.   I generated a web reference in my C# project by pointing to the wsdl within EWS.  The path is <EWS Server>/ews/services.wsdl.

When I run this line of code:

esp = _esb.CreateAttachment(reqCreateAttach);

I get the following error:

{"The request failed schema validation: The element 'CreateAttachment' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages' has invalid child element 'Attachments' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'. List of possible elements expected: 'ParentItemId' in namespace 'http://schemas.microsoft.com/exchange/services/2006/messages'."}

reqCreateAttach is of the type CreateAttachmentType.

It contains an array of FileAttachmentTypes.

Please help.

View Complete Post

More Related Resource Links

Indexing services on window server 2008 is not working with .net

Hi, I am useing Microsoft indexing services in windows 2008 64 bit .I am getting error like "Exception from HRESULT: 0xC0000005" while i am createing  new catlog from .net 2.0.I am using  "ciodm.dll" for adding new catlog. i am using this code for create new catelog.   Dim Admin As New CIODMLib.AdminIndexServer   Admin.AddCatalog(varContractNo, txtCatelog.Text + "\" + varContractNo) Admin.Stop() Admin.Start() AddScope(txtDocFolderPath.Text, txtSite.Text, txtCatelogname.Text)   Please help me anybody have fixed this issue on window server 2008 64 bit.  

Automatically populating Contact Selector not working in Form Services

Hi,I'm currently working on a form where i wan't to automatically populate a contact selector control with a users manager. I've got the managers userid, called the ResolvePrincipal webservice provided by sharpoint, and set all the values in the contact selector with the correct values. When previewing it works perfectly however when i move the form to Form Services it won't work.I've tried setting it via rules: i.e. on the change of a textbox write the manager values to the contact selector.I've tried setting the default values of the contact selector to fields where i write the manager values.I've tried setting it through code i.e. SelectSingleNode() and SetValue() for each of the fields in the contact selector.All of which work fine in preview mode but will not work in Form Services, UNLESS the contact selector already has a user in it. So if the contact selector is blank it won't work, however as soon as i manually select a user then try using any of the previously mentioned methods of setting the control it works. While using code i get a nullreferenceexception which leads me to think that possibly when theres no user in the control the xml nodes representing the AccountId, DisplayName, AccountType don't exit???? TO throw another spanner in the works, on the very odd occasion it will work in Form Services as expected, after celebrating and trying again it returns

SQL Server Tables and Exchange Web Services sample does not include email body

I've sucessfuly implemented the above, very useful example. However, I cannot work out how to include the Body of the email with the reast of the data. Can anyone shed some light for me? Thanks Robert

WSDL not working for SQL Reporting Services 2008

I have seutp reporting services successfully, but now i want to generate a proxy to be able to interact progromatically with the reporting services 2008 like I did in 2000 and 2005.  I have tried viewing the WSDL from a command like this:   http://localhost/reportserver/reportservice.asmx?WSDL and I get an error like this:   The path of the item 'WSDL' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash. (rsInvalidItemPath) Get Online Help Any thoughts?  I also tried from WSDL.exe, no dice. Thanksl Ben

SharePoint 2010 - "My Inbox"(OWA) webpart not working with Exchange 2010

Hi, I'm trying to setup the webpart "My Inbox" (OWA) in SharePoint 2010. It works when connecting to OWA running exchange 2007, but failes with error 400 not found when connecting to OWA running Exchange 2010. The error appears after logging in.  I'm using this url: https://<exchangeserver>/owa I assume that this should be supported by Exchange 2010, but it seems to fail using this parameter /?cmd=contents. Any suggestions?   Best regards, Petter

Target audiences not working in excel services web part

My appologies i posted this originally in the pre-2010 forum So i'm reposting here: We have recently upgraded to Sharepoint 2010 and we're experiencing problems with the "target audience" field being available to the users. I am not the CA admin though so it'll make this a bit tough to get solved if the problem is there. What i'm looking for are the suggestions of things for me to forward to the CA admin to change or check if anything. We have a seperate Virtual Machine that is running 2010 that has this option available to users on that farm for some reason. however on our corporate farm we don't have that option available. Plus on top of this the quick launch items are not working with audiences as well to turn off the headers to links that have nothing in them due to security trimming on document libraries. I'm hoping that this being a more of an overview of things to check would help others who may have this problem as well. I've seen resolutions such as rebooting the server and such, however that's a bit lower level and we need some higher level things to check that may resolve the issue. Think the simple stuff first to check and lets work down the list. Doesn't matter how stupid it is but can we get a more compiled list of things to check to make sure that target audience visibility to users is enabled? Thanks!

WCF ReST services not working in IIS 7.5


I know this has come up before, but I haven't seen an answer that fits this situation. I have a project in Visual Studio 2010 Ultimate RTM created with the "WCF REST Service Application" project template. It works fine in the Visual Studio development web server but I get 404.0 errors if I try to deploy it to IIS. I think IIS has all the correct .Net 4 stuff, but I'm not an IIS expert. I don't have a .svc file but I believe it shouldn't be necessary and, as I said, it works in the development server. Visual Studio and IIS are running on the same Windows Server 2008 R2 box.



Shared calendars and Exchange Web Services Managed API




there are many users and their e-mail addresses with calendars in our company. All the calendars are shared with one Exchange account, that means, by logging in with this special account, I can see in OWA all the users' calendars.


My problem is, that when I try to find appoitments of some of the shared calendars using EWS (Exchange Web Services) API, I always get just calendar of that special virtual user (created just for sharing).


Here is what I do:

ExchangeService service = new ExchangeService();

service.Credentials = new NetworkCredentials("myspecialaccount@domain.com", "password");

service.Url = "https://myexchangewebservicesurl";

CalendarFolder folder = CalendarFolder.Bind(service, WellKnownFolderName.Calendar);

now when I call folder.FindAppoitments I get only appoitments (actually I get nothing because the account has no appoitments) of the account I used in credentials, but I want to have an option to choose some of the shared calendar.


Does anyone know how to do that? Thank you very much..

Second instance of Reporting Services not working correctly



Need to access Reporting Services from outside firewall. The IT department installed second instance of RS on a box outside the firewall and pointed it to the Report Server inside the firewall. The application that runs the reports uses Forms Authentication and appears to working correctly. It picks up the "cookie" from RS and calls the report with the cookie in the header.

The Problem:

The call to programmatically login to RS works...but when the report is requested, a page comes up and asks the user to enter the username and password for the "data source". Once a "sql server user" is entered, and the user clicks on the "View Report" button, the report comes up. Why is RS asking for credentials for the report's data source???

Sharepoint 2010 security token services is not working.



I have sharepoint 2010 server , i m tryiing to search on sharepoint site but i am getting error "security token service is not avaible"

I have already applied wcf hotfix but stil getting exception when i open this service ,so is there any workaround to start this service or any workaround to search on sharepoint site(I am using sharepoint.office.search dll to search on sharepoint site)


Please reply as its really urgent


Thanks in advance!!


Windows Sharepoint Services 3 search not working getting event ids 2424 and 2436.


I can login with the accounts for content and the search service on the local server.

I have the loopback reg fix.

But the crawler will not crawl.

I have deleted all search databases in sql and it I have created one from scratch and setup different accounts for the content and search service.

I downloaded and installed windows sharepoint services 3 with service pack 2 on another server and when I used the same accounts that I had on the non working sharepoint install the search worked.



Reporting Services not working after installing .Net 2.0 SP2



I have a SharePoint 2007 site that connects to some reports in Reporting Services. SQL Server 2005. I went to apply the security patch KB2418241 that requires NET Framework 2.0 Service Pack 2 to be installed first. Everything was working fine.

After installing NET Framework 2.0 Service Pack 2 the Reporting Services reports stopped working. Now, when I access the reports I get the following error message.


 An unexpected error occured while connecting to the report server. Verify that the report server is configured for SharePoint integrated mode. --> The request failed with HTTP status 401: Unauthorized.


Also, I see in the logs the following error.


AppDomainUnloadListener.RegisterSelf() entered lock(this=15368010)


I've been struggling w

Windows Sharepoint Services 3 search not working getting event ids 2424 and 2436


This the default install running on Windows 2008 64 bit.

Our content database is located on the d drive and the Sharepoint services 3 install located on the c drive.

We constantly get event ids 2424 and 2436 when the index tries to run. Which is every five minutes.

I have the loopback fix in place.

This was working fine and then it stopped working. When doing a search on sharepoint we were able to pull up some data but not the newest data.

I  deleted the search database and created a new one with a new name.

I also downloaded and installed a new install of sharepoing services 3 and used the same domain accounts for the search service and the content and the index worked when I uploaded something. I was able to do a search.

I tried running a repair on the sharepoint services 3 install and it didn't work.

I hope it is not necessary to re-install everything from scratch.


Not exactly sure why I don't get id 2424 anymore but it is not there.


event ids are listed below

Log Name:      Application
Source:        Windows SharePoint Services 3 Search
Date:          11/16/2010 11:45:02 AM
Event ID:      2436
Task Category: Gathe

Search Services is not working



  I am getting this error when I click Search setting in the Central administration Share services.

Retrieving the COM class factory for component with CLSID {3D42CCB1-4665-4620-92A3-478F47389230} failed due to the following error: 8007042d.   at Microsoft.SharePoint.Portal.Search.Admin.Pages.SearchAdminPageBase.ErrorHandler(Object sender, EventArgs e)
   at Microsoft.SharePoint.Portal.Search.Admin.Pages.SearchSSPAdminPageBase.OnError(EventArgs e)
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP._layouts_searchsspsettings_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\5dcc5888\e51b3b52\App_Web_searchsspsettings.aspx.2a428413.ffdn56mf.0.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web

MOSS 2007 MySite not working after deleting & readding an exchange account


Hi All,

One of our users had their AD account deleted and readded in Exchange, and now they cannot access their mysite, as the old profile information still exists. How and where would I fix this please?

As a test, I recreated this issue and found that deleting the old mysite entirely meant the new user profile could go and recreate a new mysite, but I need to know if I can somehow re-link the old mysite with the new profile?


Many thanks!



You can't be right all the time, but you can be smart everyday.

Retrieve Email Attachments from Exchange 2003


I need to retrieve email attachments from a mailbox on an exchange server. Its exchange 2003 so don't have the option of using Exchange Web Services (which would make this a lot easier!).

Ideally looking to do this in a console app, which I can then expose as a service.

Some of the API libraries out there might be out of the question for security reasons.

Any suggestions / advice / code examples greatly appreciated.

using Exchange Web Services EWS to Read Email notifications



I have developed a dis attended windows service(services that runs in background) to send thousands of emails trough an Exchange Server. I'm using the following account to send emails mike@mydomain.com.

For some reason, our customers tell us that they never received the email(at least 25 customers complains about this). Because we send thousands of email we couldn't use an Outlook client to read the Inbox. I was thinking in use EWS. Whe use .net SMT client to send emails in Async way. But  let's think in the following scenario:

I send an  email today, and for some reason (network bottleneck) this messages  holds on the Exchange and couldn'be dispatched three days after.

Because our Windows services runs in background we can't catch this errors. The only way is try to read some notifications sents to the sender address( mike@mydomain.com in my case). How can I figure out this situation?



michaelfallas@gmail.com Michael Hidalgo Fallas
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