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

Post New Web Links

Encoding of "ows_Title" in WebService result

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :SharePoint

I query a Discussion Board/Custom List with a SOAP WebService call to the GetListItems(...)-Method. To process the result XML, I use something like:

resultNode = listservice.GetListItems(listName, "", queryNode, viewFieldsNode, "10000", queryOptionsNode, null);

XmlDocument doc = new XmlDocument();

XmlNodeList childs = doc.ChildNodes;
XmlNodeList items = childs [0].ChildNodes;            
foreach (XmlNode node in items)
    string Title= node.Attributes["ows_Title"].Value;

Now, in some Discussion Titles or Titles of a List Item, I get weired encoded signs when users decided to write words in foreign languages, like french: "Je suis là" or "Je vois la fenêtre".

I think the problem is, that these characters have a certain encoding which ends up in characters like "..@.." etc. after the InnerXml was loaded by the XmlDocument.LoadXml-Method.

So the question is, how can I get/display the origianl Title of the item that was deliverd by the query to the Discussion Board/List?

View Complete Post

More Related Resource Links

Webservice Return as List Need Help to set result as List


Hi all,

I have webservice which return list of class.

    public List<Myclass> MyMethod(String ID)


//some operetions is done


I am calling this service and I want to get result as list.

its accessable myclass (public) ad myMethod Public

I tried

List<myservice.Myclass> myserv=new List<myservice.Myclass>();

I want to result to bing on above variable.

myservice.NewWebServiceService newme = new dene.NewWebServiceService();


I gives an error such as

Error    1    Cannot implicitly convert type 'WindowsApplication1.myservice.Myclass[]' to 'System.Collections.Generic.List<WindowsApplication1.myservice.Myclass>'    C:\Documents and Settings\Mikail\Belgelerim\Visual Studio 2005\Projects\WindowsApplication1\WindowsApplication1\Form1.cs    24    20    WindowsApplication1

Thanks for any reply.

How get the same result with result.aspx and query webservice?




i've got a problem: I use webservice to query search server, but I have to query with MSSQLFT: but I d'ont find how get result like this:

0AA1001 … B0620747302 … TEST … DEGATS DES EAUX … MR DUPONT … TOULOUSE … 31100 … 06P03760 …

any idea? I try with description but no result... This is my query:

SELECT description,rank, title, path, author FROM SCOPE()

LDAP result encoding


Hi, I have an ASP.NET application works with Oracle SSO (Single-Sign-On) and "Oracle" LDAP. Application reads user login name (user-dn) from request header (obtained from SSO) and then reads from LDAP first name, second name and email:

DirectoryEntry entry = new DirectoryEntry(@"LDAP://ldaptest.xxx.net/...");
entry.AuthenticationType = AuthenticationTypes.None;

using (DirectorySearcher ds = new DirectorySearcher(entry))
    ds.Filter = String.Format("({0})", Request.Headers["Osso-User-Dn"]); // UserLoginName

    SearchResult result = ds.FindOne();
    if (result != null)
        if (result.Properties["givenname"].Count > 0)
        {    firstName = Convert.ToString(result.Properties["givenname"][0]); }                        

        if (result.Properties["sn"].Count > 0)
        {   secondName = Convert.ToString(result.Properties["sn"][0]); }

        if (result.Properties["mail"].Count > 0)
        { /* Email */ }

It works fine, but if the first name or second name contain some national chars (czech language), these chars are replaced by any nonsence chars. When I made a WinForm application with this code, it returns all ok. I tried many settings with no effect. Have any ide

Encoding en Decoding HTML



I stored in a database a ntext "<b>Hello</b>";

But when  I read it from the database I see <b>Hello</b> instead of Hello.

In the html source I see this: &lt;b&gt;Hello&lt;/b&gt;

Any Idea?


saving XML output from webservice


 I created a webservice that takes casenum as input and gives results as a dataset in an XML.

I could make a web client to display the resulting dataset in a grid view. Pls see my code copied below.

Now I want to create a console client that takes the casenum as input, to call the webservice and saves the resulting xml for further processing, but can't figure out how to just capture the xml to save. Here's the code for my web client. I would appreciate if you could help modify this tocapture the resulting xml to save file locally.

Thank You.

namespace ResultsWebServicesClient
    public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)

        private void BindDataToGrid(string CaseNum)
            FG_Results results = new FG_Results();
            DataSet ds1 = new DataSet();
            ds1 = results.Get_FG_Results(CaseNum);
            GridView1.AutoGenerateColumns = true;
            GridView1.DataSource = ds1.Tables[0];

        protected void GetResults(object sender, EventArgs e)


ASP.NET XML Writer Encoding Problem


Hi everybody,

I'm working on an ASP.NET application which writes xml sitemap to xml file. while I'm generating the loc element, I found that the writer converts the "&" in dynamic URLs to "&amp;" which I think it's not acceptable by Google. is there any way to get out of this?

Part of my code is as follow:

                writer.WriteString("/english/pages/pages.aspx?sid=" + drSections("SectionID").ToString + "&pageid=" + drPages("PageID").ToString + "")

and my output comes like :

<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

HTTP Post and WebService


I am working on a application which will accept the data in the post request. My application also wants to expose a web service and want to call another web service. Considering all these 3 action that I want to do, can I create a single application which will have a web form which will accept the POST request and expose a web service at the same time.

Although it may be possible to achieve this, Is this a correct way of doing it?

Active Directory and .NET: paging the search result

Hi everybody!

I have a question about Active Directory in .NET
For my project I need to fetch results from Active Directory search page by page, because later I would need to bind it to the pageable DataGrid.

I tried to use .NET library DirectoryServices for that, but paging provided by this library is transparent to the user and is used only to increase the efficiency of searching, when results are too big. I.e. I cannot tell the DirectorySearcher to give me first page, then the next or previous page, it returns me all resulting pages in one bundle.

However, what I need is to explicitely get page after page directly from the AD searcher and to be able to go at least one page forward or backward.

The solution with copying all results to the DataBase and then do the paging is not accepeted by the clent, since it is too inefficient. And since it's a Web app, I cannot keep results in memory either.

I found some hints about COM Interface, but I could not find good and detailed examples or explanations. I aslo found this line of code: DirectoryServices.Interop.IDirectorySearch.ExecuteSearch(), but I don't know which libraries should i add to be able to compile this code.

If somebody could help me out with that problem, any suggestion is welcome, 'cause this issue is eating me alive :)

Thank you!

Calling webservice from the server


I have a sample web service and aspx file. I deployed them to an existing website that contains classic asp files.

web-service: --- using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; [WebService(Namespace = "http://localhost/MyWebServices/")] public class MembershipRegisWebService : System.Web.Services.WebService { public MembershipRegisWebService () { //Uncomment the following line if using designed components //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World."; } }

aspx.cs file: --- using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Services; public partial class CallWebService : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { MembershipRegisWebService mrWs = new MembershipRegisWebService(); Response.Write("Calling web service:" + mrWs.HelloWorld()); } }

It runs locally, but it shows an error when running it from the server:

Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the follow

C# / Java webservice


I am writting a client applicatin that acesses a webservice written by another company.  I need to test against this webservice but since it is live I need another place to test with.  I don't have access to the code from the webservice but have added a reference to my project.  I would like to create a test platform using C# which will run on IIS and not Java.

I have created a basic webserive using both the NetBeans platform and the VS/C# platform.  The problem I am having is if I dynamically change the web address from one to the other my client application complains that the webservice is invalid.  I have verified all the calls are the same.

Are there any setting with VS/C# that allow me to configure it to behave more like the Java webservice?  I don't have the server support to host the Java application for full testing along with other problems using the Java version.

I have run both services in the "WCF Test Client" and can see where the WCF service uses the varibles for request and the Java uses body/request but can't get the WCF to follow that format.  I read somewhere about changing the OperationContract with SoapRpcMethod but then the mentod is not longer exposed. I also tried a Web Service in .NET 3.5 instead of a WCF server but that seems to be more trouble and does not

Printing crystal report from webservice



I am trying to print crystal repot directly from a C# application, which is calling webservice. I am able to display report in crystalreportviewer by passing the webservice call to datasource. However, is there anyway, I can print directly without showing the report?

Alternatively, I was trying return ReportDocument object from webservice, which would solve my problem, but I was unable to return the ReportDocument because of serialization issue. Is it even possible? Thank you


Express Yourself: Encoding Videos Using Microsoft Expression Encoder 3 SDK


Video on the Web involves huge amounts of data. Learn the best way to manage and move that data with the help of Microsoft Expression Encoder 3.

Adam Miller

MSDN Magazine June 2010

The XML Files: Web Services Encoding and More


Aaron Skonnard covers the difference between document/literal and rpc/encoded Web Services and the history behind them.

Aaron Skonnard

MSDN Magazine May 2003

Encoding Problems in Razor



On my projects I am using SquisIt Framework and I have the following on page head:


      .Render("~/Styles/FlyOnDreams.FlyOnPages.Core.min.css")) %>

This is working. However when I use Razor view engine I am using the following:


Writing Data to database with jQuery Forms, ASMX Webservice, & JSON - help!



Can someone point me in the right direction on how to submit data from a jQuery form to a ASMX webservice? I have gotten everything on the form ready to be submitted to the database and now I am stuck on how to send it over using $.ajax(). Everything I have read tells me how to get data from a webservice and display it with jQuery, but not the other direction nor how to access the json data within the within the webservice service(similar to a Request.Form approach with ASP.NET forms).

In other words: 

1. What do I need to do to my webservice to make sure it can receive data from the jQuery form. 

2. What do I need to do in jQuery to receive an acknowledgement the save on the server side was successful. 

I can explain more if need be, but if there is a comprehensive tutorial on not only reading, but also WRITING data with jQuery, JSON, etc. I would love to get pointed in that direction. 

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