.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

REST Starter Kit - parsing issue with ampersand in element

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :WCF
We built a REST web service using the REST Starter Kit.  We want to allow XML post elements that contain ampersands.   How can we modify the code to have the parsing at the element level so that when an XML post element contains an ampersand we don't generate an error?

View Complete Post

More Related Resource Links

Is the REST Starter Kit still needed with WCF 4?


The REST Starter Kit was targeted at WCF 3.5. I am wondering if it is still needed with WCF 4?

WCF Rest Security Issue

I have developed a wcf Rest application and I have prepared a web client in which I am using simple javascript embed over html pages now I want to implement some security to my pages how can I do so can any one explain me. I am not using asp.net as client. I am trying to implement some security to secure my data but I am not able find the way to do it.

XML Parsing Error: no element found

I had an old SQL server  2008 instance removed and reinstalled SQL server, SSAS, SSRS all together.   When trying to log onto Report Server, I am seeing following error.  can you hel? thanks     XML Parsing Error: no element found Location: http://myservername:8080/Reports/Pages/Folder.aspx Line Number 1, Column 1:

Annoying issue with: Element 'xxxx' is not a known element.


I am getting hundreds of messages like that: "Element 'xxxx' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. "

Very simple to reproduce, just start a new web project and start adding elements to the web page. All this craps starts poping up, no intellisense.

REST Query Batch Issue


Hi All,

I've got an issue when querying the listdata.svc from a Silverlight client.   

I construct the query as follows:

var parametersQuery = context.Parameters.Expand("AssociatedTask") as DataServiceQuery<ParametersItem>;

If I execute the query individually and then process the results then the AssociatedTask collection gets populated, if I include it as a batch then it does not.

I've examined the query in Fiddler and as far as I can tell the request and response are identical.

Anyone shed any light on the issue?

Can't POST to WCF REST Starter Kit Example


Hi Folks,

I'm trying to test the WCF REST Starter Kit, project template of REST Collection Services.
I'm following the example here: http://msdn.microsoft.com/en-us/library/ee391967.aspx on the Rest Collection Services (halfway down the page).
( In this sample, we create a Bookmarking service...)

I am able to issue a GET request to the service and I get a proper 200 code response from the server.

However, when I try in Fiddler to issue a POST request I get a 415 ERROR CODE  RESPONSE FROM THE SERVER.
In the request Body I have XML tags to insert a new object....
I am following the XML schema created by the HELP Page auto generated by the Service... So from what I can tell the format of the XML in the body is O.K....

This is my XML Body:
<Tags>String content</Tags>
<Title>String content</Title>
<User>String content</User>

Any ideas of what I'm doing wrong or what can cause this error?
Maybe my header is wrong....

REST WCF 3.5 using JSON - Default Value issue & EmitDefaultValue colliding with each other


Hi Carlos,

This question is related to forum http://social.msdn.microsoft.com/Forums/en/wcf/thread/1698968e-6608-485d-a8d5-d4c0138c1078

In case Update API, if I pass data Id as 0, I'm having issue since it is the default value of int & dataId is declared as int. Similarly, result is declared as int. Because of this, if I want to pass 0 in result value instead of 200, its not returning me the value at all as it is declared as int & its emitdefaultvalue is set to false.

Can you tell me if there is any way to solve this issue? Am I suppose to declare all variables as string in the data contract so that I won't have this issue of default values or is there any other way?


IsapiModule Error 500 Issue


I am about exhausted trying to figure out this error:

HTTP Error 500.0 - Internal Server Error

Description: The page cannot be displayed because an internal server error has occurred.

Error Code: 0x8007007b

Notification: ExecuteRequestHandler

Module: IsapiModule

Requested URL: http://localhost:80/ReportServer

Physical Path: c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer

When I enable Failed Request Tracing Rules and view the log output I am supposing that the actual problem is in the 2nd call where there are 2 backslashes before the actual filename in the specified path:


CALL_ISAPI_EXTENSION DllName="C:\Windows\Microsoft.NET\Framework\v2.0.50727\\aspnet_isapi.dll"


MVC2 issue - Stuck. Trying to create a cms with nested partials


I am currently trying to display multiple items on a single page. I am not sure as to how to tackle this. What I have is a database table that has all the page data in. I have this run as a PagesController and this works fine. However what I would like to do is, if say the Products page is selected via the menu, I want to pull back not only the Products page html but also get all the products, and even be able to pull them through via category. I was trying to use a partial view, but I can't get it to work. The same would be for other pages, having partial views to display the other content, ie if Gallery is selected, the page html for Gallery shows and it then can push to a partial view that pulls all the gallery images from the gallery db table and so on. 

Maybe I am tackling this the wrong way. I have the pages stored in the db to allow for a CMS system I have setup. Maybe I need to use models for all the other items(Products, Gallery, Videos and such) and use the partial for the page html?

Any help would be greatly appreciated as I am confused.

UpdatePanel is not a known element - message when upgrading to 1.0 ajax


It worked on one of my old pages.  I change the web.config, renamed all the <asp.

On some aspx page it doesn't recognize the updatepanel.  It only does on one page.  If I create a new aspx page with a different name - then it works.

Should I just create a new web project ajax - then copy all my code into there?  Or is there a way to get those old pages to recognize the new ajax controls?

error in installing portal starter kit



I tried to install portal starter kit (http://www.asp.net/downloads/archived-v11) , but I found error code (2869) in installing. Windows of my computer is VISTA.

Error is like below:

Id_token is not a valid Windows NT name. Give the complete name: <domain\username>.

User or role "id_token" does not exit in this database.

Error code 2869.

Thanks in advanced.

Event not raised while parsing xml file



In Visual Studio 2010 ASP.NET 4.0

I want to write a procedure to validate a xml file with a xsd. I found some examples on the web but the one i chose does not work as attended. The example uses XmlReader with a XmlReaderSettings and a ValidationEventHandler.

Here is the code

Protected Sub VerifyDes(ByVal filename As String)

        Dim xslDes As XmlReaderSettings = New XmlReaderSettings()
        xslDes.Schemas.Add("", "http://www.mysite.com/xsd/ValidData.xml")
        xslDes.ValidationType = ValidationType.Schema
        xslDes.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings

        AddHandler xslDes.ValidationEventHandler, AddressOf xslDesValidationEventHandler

        Dim des As XmlReader = XmlReader.Create(filename, xslDes)

        While (des.Read())

        End While

    End Sub

    Protected Sub xslDesValidationEventHandler(ByVal sender As Object, ByVal e As ValidationEventArgs)

        'some code here
    End Sub

I tested this procedure with a xml file which was well formed but contained some elements which were not conform to the xsd.

No event or error occured. It said the file was valid.

Then i tested with a badly formed file. A XmlException was raised but nothing happened with the ValidationEventHandler.

It seems lik

xpath issue


Hi i am using xpath to loop through each node,

the xml is below i can get the value of "link" but i cant get the thumbnail value, have you got any ideas how i can do this, my code is below.



     <link>test 1</link>
     <media:thumbnail url="http://test.com/image.jpg" height="75" width="75" />



     <link>test 2</link>
     <media:thumbnail url="http://test.com/image.jpg" height="75" width="75" />


public void FindLinks(XPathNavigator p_xPathNav, DataTable dt)
            //run the XPath query
            XPathNodeIterator xPathIt = p_xPathNav.Select("//item");

            //use the

get value from xml element



i have this xml

<Field Name="Users_wff_AU" Type="FIELD_TYPE_STRING" MultiValue="True">
<Value No="1">xyz</Value>
<Value No="2">abcl</Value>
<Value No="3">xcc</Value>

i want to get the  xcc in string variable

Dim strwfUser As String = xNode.Item("Value").InnerText

User validation Issue in xlsx file



I am validating user from Login.xlsx file. It was working fine by validating email and password from that file. For testing i got new file same contents of file but added some more user names.

So after that when i validating the user i am getting the following error "Data type mismatch in criteria expression".

But when i replaced the new to old one it is working fine. The contens of both files are the same. So why this kind of error happened.


Multiple Paramatized Threading issue


I need the funcitonality to have two methods run concurrently of each other and the parent thread (aka the method that makes these two calls) to halt until BOTH are done. After the threads are done, I need to perform logic on the returns of the method, so it is essential for both of them to be complete before the parent thread continues. I have searched the internet and tried varous attacks, and I always come up with the same result, this being the parent thread continues operation after the first thread finishes, leaving the second thread running.  Can someone show me a quick example of how I can do this. I have tried checking states of the threads, halting the threads, but I always end up with the same thing. Any help would be great. Thanks.

Data Truncation issue with Enterprise Library Logging WriteLog stored Proc


Hi ,

I'm using Enterprise Library Logging  feature for logging. The issue i am facing is when the Logging message is too large(more than 65534 chars) ,complete data  is not logged in the Formatted Mesage column which is  of data Type nText .

I am able insert complete data if i try inserting from Sql insert Query from sql management studio. Do i need to add any attributes to data base listener or do i need to change the sp.

 Is there any way to increase the WriteLog stored proc param size in EnterpriseLibrary.Logging config file ? . Please let me know.


Thanks In Advance.

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