.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

Passing UTF-8 encoded string to SOAP

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :ASP.Net

I am using a third party Web Service. I am passing a string to a function in that service, that string, which i am reading from a UTF-8 text file. The problem it that the string contain some non ASCII characters.

Now if i save that text file to ANSI format, read it in a string and pass that string to Service then it works smoothly but with UTF-8 encoded string the service throw exception "The request failed with HTTP status 400: Bad Request."

Long story short

  1. NON ASCII characters
  2. UTF-8 encoding
  3. SOAP

I am using ASP.NET.

Third party sevice is in java. I also tried it by making a web service in .net, but there was issue there too.

View Complete Post

More Related Resource Links

Passing String to Rdlc's TextBox

Hello  I am pretty new to reporting services. Now i have something like this. on the .cs file, i have a fullName lets say String fullName = "John Smith", Now I want to pass this string to the report's textBox and show this value on this textbox.   How can i do this? 1.How should i write in .cs file? 2. How should i set the expression for the textbox?   Thank you very much. It is very urgent! Please help!

HtmlHelperExtensions in MVC2 return a HTML string, unencoded. In MVC3 this tring is encoded!

 HtmlHelperExtensions in MVC2 return a HTML string, unencoded. In MVC3 this string is encoded! How can I return unencoded HTML to a Razor view in MVC3? 

Passing an List to my Action

    public ActionResult RenderMyThing(IList<String> strings)     {         return View("RenderMyView");     }     Somebody will come to my page, RenderMyThing.aspx ... and I always want to pass a list of strings         routes.MapRoute("MyRoute", "RenderMyThing.aspx", new { controller = "My", action = "RenderMyThing", new List<String> { ... } });    Is this possible?

passing messageContract object to a WCF Service method using Soap - not as a method parameter

i want a web application to create a service reference to my WCF service, insert information to the header of the soap call and call my WCF method. my WCF supports soap operations (also there is an endpoint in the config). i read about MessageContract attribute and declared one in the interface file: [ServiceContract] public interface IBasicService { [OperationContract] [WebGet(UriTemplate = "GetData?value={value}")] // Add support for HTTP GET Requests string GetData(int value); } [MessageContract] public class BasicServiceHeader { [MessageHeader] public string myString; } the implementation of the contract : public class BasicService : IBasicService { public string GetData(int value) { return string.Format("You entered: {0}", value); } } i don't want the BasicServiceHeader to be passed as a parameter of GetData function , i want to keep the function signature as it is (without a BasicServiceHeader parameter) and to extract the BasicServiceHeader inside the function, (just like using soapHeader) can i do that ?

WCF MTOM Client calling Java Webservice - Issues with File attachment Content ID encoded in SOAP mes

Hello,I'm having difficulty calling a MTOM enabled Java based web service that accepts an file as input..NET appeats to be generating a SOAP message where the reference to the binary part of the message is an encoded url.For Example:  <inc:Include href="cid:http%3A%2F%2Ftempuri.org%2F1%2F634000265217257868" xmlns:inc="http://www.w3.org/2004/08/xop/include"/>In fact, the Content ID defined in the SOAP message, looks nothing like the actual Content ID of the actual message part.Content-ID: <http://tempuri.org/1/634000265217257868=2787915398744@soapui.org>The service is invoked and executed on the java webserver...but the data element appears to be null.I do not believe the java web server understands the reference in the SOAP message because it is encoded....Or...perhaps it's because the Content-ID attribute has extract stuff on it.I'm working with a custom MTOM encoder in WCF....is there a way to generate your own Content ID or tell .NET not to encode the url?My frustration with .NET has reached an all new level with this project...Any help would be greatly appreciated.Here the SOAP message that is being generated:<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:ns="http://docs.oasis-open.org/ns/cmis/messaging/200901" xmlns:ns1="http://docs.oasis-open.org/ns/cmis/core/200901&q

A Href removing space when passing a string in a email

In an email action I'm building a string using an <A href.  I'm working with a list called Document Sets and also a column called Document Set.  I'm passing to a page the current document set in order to filter a web part. 

Here is the example

<A href="http://test.net/sites/r3bs/DocSetPAHO/Site%20Pages/dynamic.aspx?DocumentSet=<%Document Set%>">Click here to review the items.</A>

The problem is that when the document set column data contains a space (such as Company Overview), the email removes the space between Company and Overview (as seen below).  If I add the Document Set column to the email directly it displays fine with the space 

[%Document Sets:Document Set%]


I've tried storing the value to a workflow variable but it still removes the space in the actual email.

Simple ASP.NET SOAP request to return string



I have a requirement to build a simple ASP.NET web page which sends some parameters to a web service, and then displays the string which was returned.

I'm a complete .NET newby and the only examples I can find seem really really complex.  I just need something mega simple, but which an handle parameters being sent to the web service.  Can anyone point me in the direction of a simple bit of C# which will do this with no frills or fuss?

Any help much appreciated, thanks!

problem in passing string array from activex dll to JavaScript


I do have a problem in passing string array from activex dll to JavaScript. i need to implement a methos as 

C# : 

Passing SQLDataSource results to vb string


Please help, have been banging head over this for a while.

How can I get the distinct result from a SQLDataSource (in this case a URL) into a a vb string

The SqlDataSource only delivers on result and is dependent upon a drop down list which is databound to the same table

I have tried a very messy way of putting it into a label in a form view then trying to reference that as a object

 Dim strurl as string = Formview1.Itemtemplate.Itemtemplate.URLlbl.text etc........ but this won't work

There must be a way to directly pull the data from the result of the SQLDatasource isn't there??

I am trying to pull the URL to pull an xml into a feed aggregator

Any help would be much appreciated

reposted with no help: passing a string parameter to a web method


I have a web form (html) and I'm trying to pass a single string as a parameter to my web method, (this should be simple but no one can seem to answer me)

<script type="text/javascript" language="javascript">
        var qs = new Querystring();
        var v1 = qs.get("TorVName");
        //var jsonData = JSON.stringify(v1);  
        //var list = v1;
        //var jsonText = JSON.stringify({ list: list });
        $().ready(function() {
                type: "POST",
                url: "Default.aspx/GetColumns?TorVName=" + v1,
                data: {},
                contentType: "application/json; charset=utf-8",

HTTP POST request and encoded string



I have to do a simple HTTP POST request by key/value pairs and receive a XML file with a session key. I made it work, but there's something strange about it - when session key includes character '&', then it return encoded like '&amp;'. After that my application needs to send that session key to server every time I make a query. When session key includes '&', then query won't work, because server side is expecting correct (not encoded) session key. Does somebody knows how to fix this problem? My HTTP POST Content-type is "application/x-www-form-urlencoded".

Passing connection string to Enterprise Library DAAB 3.1


The company I work is considering to use the Enterprise Library Data Access Application Block. The problem is an internal policy that forces all company systems to get the connection string from a sql server.

Is there any way to just pass the connection string to the Data Access Application Block instead of getting it from the app.config or web.config?

I dont see any overloaded methods on the DatabaseFactory.CreateDatabase() method. Pointers please!

Passing a SSIS Variable with a string datatype to a Stored Procedure requiring a uniqueidentifier


I have a SSIS package that uses a SQL Server stored procedure as a data source. The parameter in the stored procedure is pulling data from a column with a uniqueidentifer (guid) data type. I created a package level variable in SSIS with a string datatype. SSIS variables do not offer a uniqueidentifier datatype.

I have the following text in the SQL Command text box:

exec dbo.spBillingReferenceSource
@BatchID = ? 

When I click the parameters button the mappings are @BatchID for the parameter (which is the exact name of the parameter in the stored procedure) and User::BatchID (the SSIS variable) 

When I run the stored procedure in preview mode in the SSIS dataflow, it returns an error message -- "No value given for one or more of the required parameters"

If I run the stored procedure by typing the value in the datasource box such as listed below, it works and delivers the proper records. I have even modified the stored procedure to convert the column to use varchar(36). However, it still returns the same error message. Does anyone have any suggestions on how I can get this to work. Thank you.


How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Connestion string create any database server

This links important to how to create connection string to any data base sever.

SQL Connection String

We can learn or know how can we connect the database from our .net. This will help for freshers or .NET beginners!

Built-in Functions - String Functions

String functions let you extract various portions of character strings, change the case of strings, concatenate and reverse strings and perform many other types of manipulations. All built-in string functions are deterministic with the exception of CHARINDEX and PATINDEX
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