.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

Can't read MTOM response

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :.NET Framework
Hi Guys, I am running into a problem when trying to call a service that uses MTOM encoding.  Basically, I make the call and an error is thrown: "Client found response content type of 'multipart/related; type="application/xop+xml"; start="<soap.xml@xfire.codehaus.org> "; start-info="text/xml";               boundary="----=_Part_413761_448939451.1284410234193"', but expected 'text/xml'." Since my app is defaulted to text/xml I change my config using the WSE tool so that it will be able to accept MTOM responses, however trying the call again continues to throw that same error.  Here is my config: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> </configSections> <applicationSettings /> <system.web> <globalization /> <webServices> <soapExtensionImporterTypes> <add type="Microsoft.Web.Services3.Description.WseExtensionImporter, Microsoft.Web.Services3, Version=, Culture=neutral, PublicKeyTo

View Complete Post

More Related Resource Links

What is the best way to read REST (XML) response?



I make a REST request to Amazon S3 using HttpWebRequest and get an XML response. The simplest example is my bucket list. I want to display the number of buckets and their names. What is the most efficient way to read the XML response and process it?

This is the XML response I'm getting:

<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">

MTOM-enabled WCF service sends document inline in SOAP response


I'm running a WCF service that has messageEncoding="Mtom" in the config file. The WCF service however, in its SOAP response sends the document as a Base 64 encoded document inline and not as a <xop:include.....> reference outside the SOAP. I'm not sure what I'm doing wrong. Please guide me.


Desired Format:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: multipart/related; boundary=MIMEBoundaryurn_uuid_F862C3E04D9E35266C1256303956115; type="application/xop+xml"; start="0.urn:uuid:F862C3E04D9E35266C1256303956116@apache.org"; start-info="application/soap+xml"; action="urn:ihe:iti:2007:RetrieveDocumentSetResponse"
Date: Fri, 23 Oct 2009 13:19:11 GMT

Content-Type: application/xop+xml; charset=UTF-8; type=&

Can't read ping response from webservice

I am trying to ping a webservice but the response is coming back= nothing
I contacted a person there and he said they were receiving the ping and sending back a
success response as shown after my code.
I am unable to read the rsponse. Any help is appreciated 
Protected Sub btnPing_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPing.Click
        Dim ES As New EchoSignDocumentService()
        Dim serviceurl As String = "https://www.echosign.com/services/EchoSignDocumentService9"
        ES.Url = serviceurl
        Dim s As String
        Dim apikey As String = "XDYYBE6Y336S3F"
        s = ES.testPing(apikey).message
    End Sub

Also tried

  Protected Sub btnPing_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPing.Click
        Dim ES As New EchoSignDocumentService()
        Dim serviceurl As String = "https://www.echosign.com/services/EchoSignDocumentService9"
        ES.Url = serviceurl
        Dim pong As Pong
        Dim apikey As String = "XDYYBE6Y336S3F"
        pong = ES.testPin

How to read XML response com from another site such as Mooneybookers or CashU?


hi everybody; this is the first time I post help request

In my system I submitting html form to payment site (Moneybookers or CashU), the the site response me by XML response to tell me the status of the payment proces.

I want to read this XML response in the page which will recieve this response.

the XML response like the folowing:

<date>14/09/2007 23:07</date>
<date>14/09/2007 23:07</date>
<paymentCurrency> </paymentCurrency>


_AppStart.cshtml: can't get response/request to write/read cookie?


currently, I'm setting up an HttpCookie in a "master" page (layout) and check wiehter I need to send the user back to some specific page depending on the value, if it has expired, etc.
Because the master layout page is not the 1st "page" code to process, I can sometime get runtime error because the cookie is already expired.

I thought I would move this part to the _AppStart.cshtml file but I can't get to read/write (Response/Request) the cookie there?

Should I do this in a _PageStart.cshtml in all my folders rather?


Serial Port Communication Read and Write using C#.net

In this simple article you will learn that how you can Open and read COM port data using System.IO.Ports Namespace.
Simply just create New Project of windows application in C#.

Import ServiceProcess APIs
using System.IO.Ports

Imports System.IO.Ports

Write Parsing functions which parse port data according to attached device

Response.BinaryWrite help needed


Hi all

Im new to .NET and stuck now, so i hope anyone can help my with my problem.

I have a MS SQL database where i have stored some documents as Binary data. I cant figure out how to retrieve them and show/download them in my browser.

I found some guides online and have try to put something together.


private void Write()
 int id = 0;
 string strID = Request.QueryString["id"];
 int.TryParse(strID, out id);

 var db = new ModelDataContext();
 var doc = db.DocumentDatas.Where(x => x.ID == id).FirstOrDefault();

 byte[] byteArray = File.ReadAllBytes(doc);


How do i fill the byteArray with the data?

Thanks in advance :)


Response.Redirect slow


I'm in the middle of migrating servers and on the new server Response.Redirect is extremely slow. It takes around 20 seconds for the browser to get the redirect. This is something that was quick on the existing server. It's an ASP.NET 2.0 application, both servers are running IIS6.

Additionally, if I "manually" do the redirect, it's fast. For example:

Existing way:


takes around 20 seconds on the new server

New way:

Response.Status = "302 Moved Temporarily";
Response.AddHeader("Location", url);

is fast on the new server.

Any ideas why Response.Redirect would be so slow on the new server?

Scripts not read when in head tag


I just upgraded to VS2010 if that matters.  I'm learning JQuery and noticed that scripts don't work if they're in the head tag.  Also, I need the script tag with type="text/javascript" in the head (with nothing else) in order for the JQuery scripts in the body to work.

Very bizzare, any suggestions?

With a separate script tag in the <body> with my JQuery script, this works

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />
<script type="text/javascript">

This doesn't:

<head runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" />

I am not able to read xml file with XDocument if its Descendants has Attribute xmlns="http://abc.co


I am not able to read xml file with XDocument if its Descendants has  Attribute like:-

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
  <row ID="1" xmlns="http://www.opentravela.org/OTA/2003/05">
    <var country_name="Caribbean and Rest of the world" city_name="Kingston" flight_category="Economy Class" via="Atlanta" flight_departure="London Heathrow" airline_logo="Delta" adult_fare="Delta" child_fare="660" infant_fare="561" date1="132" date2="2010-08-15" />


I don't know what to do ?

Looking for some help..

How to read XML using LINQ in VB.NET


Can someone please tell me (sample code) how to read this XML into a SQL DB?  Should I use LINQ to XML?  Does anyone have any sample code?  I am working in VB.NET


<?xml version="1.0" encoding="utf-8"?>

<ReadOrderResponseType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<Status xmlns="urn:mysol:apis">Success</Status>

<TimeStamp xmlns="urn:mysol:apis">2010-07-25T15:26:49.1150235Z</TimeStamp>

<StoreUrl xmlns="urn:mysol:apis">http://xyz.COM</StoreUrl>

<PageResponse xmlns="urn:mysol:apis">




Read Excel file from Web Application (C#)



I have a web app where user uploads a file.

File is saved in server locally and I want to read some data from it.

Currently my development  server has office 2003.

So do I need office 2007 in order to be able to  read an excel from office 2007 ?

What are other requirements  ?

I tried a test, using

Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook wrkBook; // = new Microsoft.Office.Interop.Excel.Workbook();

wrkBook = excelApp.Workbooks.Open(@"C:\www\excel_files\b.xls", ....);

But When trying to open the file I get the error:

Exception from HRESULT: 0x800A03EC

So I'm wondering what I'm missing.


How to read value of CheckBox in EXCEL sheet


I am using OLEDBConnection (@"Provider=Microsoft.ACE.OLEDB.12.0;") to connect to the EXCEL file and read contents. When I read the contents, I get all the contents from the excel sheet but i dont get contents for checkboxes placed inside.

My Excel sheet contains set of checkboxes and I need to know If they are checked or not.These checkboxes are controls which are added from Developer tab in EXCEL.

I dont want to use Excel Assemblies for reading contents as it is not recommended. And also i am using OLEDBconnection and want to stick to this .

Awaiting replies from you guys. Thanks in Advance.

How to read Excel table?


If I  use Microsoft.Jet.OLEDB.4.0 to retreive for example named range or sheet from Excel and use it as data source for some server control on the ASP page, everything works fine. But when I try to get table from Excel like this: "select * from [Table1]", debugger complains that database engine could not find object Table1. So how should I reference Table1 in Excel file so that the database engine could find it?

How to read the custom http header



I have just joined the forum. I have a very simple query. I have added custom header to my website. Now I want to read the custom header. I am using IIS 6.0 on windows XP. I have already tried using using the Request.ServerVariables and and Request.header method. But none of them give me the custom header added to website.

Can any body help?

Thanks a lot in advance



Can't read global resource in asp button


I have translated Text Ok in arabic and I have that placed in global Navig.resx file

<asp:Button ID

Crystal Report gives System.AccessViolationException: Attempted to read or write protected memory. T


when a crystal report for same id is opened again at same time or refreshed then it gives the

"System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

Stack Trace is :-

Stack Trace:

[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
CrystalDecisions.ReportAppServer.Controllers.DatabaseControllerClass.SetConnectionInfos(ConnectionInfos ConnectionInfos) +0
CrystalDecisions.CrystalReports.Engine.Table.ApplyLogOnInfo(TableLogOnInfo logonInfo) +362
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetTableLogon(Tables tables, String user, String password, String server, String database, Boolean ignoreCase) +258
CrystalDecisions.CrystalReports.Engine.ReportDocument.SetDatabaseLogon(String user, String password, String server, String database, Boolean ignoreCase) +204
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