.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

Error while consuming Webservice

Posted By:      Posted Date: September 24, 2010    Points: 0   Category :.NET Framework


I'm consuming one webservice which hosted in IIS in my windows service. While consuming that web service proxy method I'm getting below error.

But its not happening regularly, randomly it s happening. Sometime its working very fine.

Error is :

The content type text/html of the response message does not match the content type of the binding (text/xml;charset=utf-8). If using a encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 163 bytes of the response were "<html><head><title>Error</title></head><body> Either a required imersonation level was not provided, or the provided impersonation level is invalid </body></html>

Thanks in advance,

View Complete Post

More Related Resource Links

Error Consuming Web Service - Unable to import binding xxx from namespace ...


In VS2008 / C# / ASP.NET 3.5, I wrote a test web service app. Here is an extract from the code:

namespace emed.MathWebService
    /// <summary>
    /// Sample Math Services For Learning Web Services Deployment
    /// </summary>
    [WebService(Namespace = " http://localhost/MathService")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class MathService
        public float Add(float a, float b)
            return a + b;


I have published this to an IIS virtual directory named MathService, and when I try to launch it with the URL http://localhost/mathservice/MathService.asmx is works fine and displays all the operations (Add, Subtract etc) in the service.

I then created a test web application in VS2008 (named WebSvcTe

Error in consuming web service using WCF client

Hi, I have consumed an external webservice in my client application using WCF. And every thing works great in my Dev box(XP with IIS5.1) But when the same application is moved to Prod server(Win Server 2003 with IIS6.0) it fails. Below is the exception caught: There was no endpoint listening at http://MyExternalWebServiceUrlWithSessionId could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. And the InnerException is: Unable to connect to the remote server My Config file has the below settings:<system.serviceModel> <bindings> <basicHttpBinding> <binding name="Default_Binding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCoun

WCF REST webservice authentication error when hosted with godaddy

Hi guys, I'm currently hosting my site on a shared windows hosting box with Godaddy. I have upgraded my hosting account to .NET 3.5 and having IIS7 as well which is in integrated pipeline mode. I recently build a simple WCF web service using the REST started kit preview 2. Once i uploaded it to the server, I am getting this error"IIS specified authentication schemes 'Basic, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used." You can see it here:http://sawasdeethaiart.com/service.svcThe obvious fix for as i have read from various websites, is to make sure I configure my IIS to have either Basic or Anonymous specification enabled. But as i am on a shared hosting account, i dont have any access to do this. (I have checked all my options in the IIS hosting panel, but there is no option). I am also done this in my web.config<authentication mode="None"></authentication> Is there any other option I can add  to my web.config to overcome this? or is there any other fix for this? Any help will be greatly appreciated. Thanks,Mark  

WCF client consuming oracle webservice is inconsistently works

Hi, In my WCF client application, I am consuming the Oracle  webservices. Strangely this wcf client functioning inconsistently. That means sometime, it does not find the service endpoint and some times it does. Where the code and environment are absolutely same in both the cases. But when I use web services, I see the code works consistently. There is no endpoint listening at the address http://<serviceurl> Does any one faced similar issue with WCF? Thanks!

Error while consuming WCF service on IIS5.1

Hi,   I have hosted a WCF service on IIS. Getting the following error while trying to add service reference in client web application. While I am able to run the service and view the WSDL.   ERROR: The document at the url http://localhost/TestSvc/Service1.svc was not recognized as a known document type. The error message from each known type may help you fix the problem: - Report from 'http://localhost/TestSvc/Service1.svc' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'. - Report from 'DISCO Document' is 'There was an error downloading 'http://localhost/testSvc/Service1.svc?disco'.'.   - Unable to connect to the remote server   - No connection could be made because the target machine actively refused it - Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'. - Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'. Metadata contains a reference that cannot be resolved: 'http://localhost/TestSvc/Service1.svc'. Metadata contains a reference that cannot be resolved: 'http://localhost/TestSvc/Service1.svc'. If the service is defined in the current solution, try building the solution and adding the service reference again.     Thanks, Bi

SSRS DataSource as XML (Using WebService) Error: Credentials

Hello all, I have a requirement in which i have to generate reports (using SSRS) with my Sharepoint list as Data Source. This can be done by consuming the web services in my SSRS, by providing the connection string and Type = XML. My connection string when browsed in browser, "http://<server name>/_vti_bin/lists.asmx" gives me the *method lists* in the <server name>.. which is fine. However when this is used in my DataSource in SSRS, i get the following error: "You might not have permission to view this directory or page using the credentials that you supplied. The Web server has a filter installed to verify users connecting to the server and it failed to authenticate your credentials." :( In the credentials tab, i am using the "Windows Authenticated"   Any help is highly appreciated. :)

Webservice, server was unable to process request error


System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XsdValidatingReader.Read()
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at BusinessObjects.OrderHelper.PlaceOrder(String StrorderXml) in C:\Documents and Settings\mchinta\My Documents\Visual Studio 2008\Projects\CcbApp\BusinessObjects\OrderHelper.cs:line 63
   at IServiceReference.IOrder.PlaceOrder(String orderXml) in C:\Documents and Settings\mchinta\My Documents\Visual Studio 2008\Projects\CcbApp\IServiceReference\IOrder.asmx.cs:line 24
   --- End of inner exception stack trace ---

Here is my XML

<?xml version='1.0' encoding='utf-8' ?><Order>Data</Order>

My S

Getting Error SECU1075: While calling webservice from C# DLL,WinForms



I have designed a console application as a web service client which is able to talk with webservice; however instead of console application if I design a WinForm or DLL of the same code I am getting following error message.

SECU1075: An error was discovered processing the <wsse:Security> header | System.Web.Services |    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)...

The only difference I figured out is, in case of DLL or WinForm it is creating an extra DLL with name <ProjectName>.XmlSerializers.dll which is not the case with Console application.

Anybody know what should I need to do to call the webservice from DLL instead of console application? Help appreciated

lists.asmx webservice an unexpected error occured


I have a sharepoint site and am using the list.asmx webservice to update rows in a list.  My code was working well.  For some reason, after doing a very large batch of updates, the same code now gives this error each time I run it.  The strange thing is that everything worked, I did a large batch then everything broke.  I switched to another site and it worked again.  I did a large batch and everything once again broke.

<Result ID="1,Update" xmlns="http://schemas.microsoft.com/sharepoint/soap/"><ErrorCode>0x80131904</ErrorCode><ErrorText>The operation failed because an unexpected error occurred. (Result Code: 0x80131904)</ErrorText>

Cross-Domain policy error using soap in Silverlight with a Webservice


Getting the following error...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso

Error when consuming WSDL from Axis Web Service



I have a service that was written in IBM WebShpere Integration Developer 7.0 (Java, hosted as Axis Service).

When trying to test the service using various tools (such as SoapUI) the service works fine.

When trying to consume the service with Visual Studio 2008 (C#), the .NET engine fails to load all WSDL content, and I can't see any of the service operations.

The service exposes complex types, which has references (imports) to other WSDL files. Those files DO exist.

I get the following error in Visual Studio:

Custom tool error: Unable to import WebService/Schema. Unable to import binding 'IGetSSTByNumberExport1_IGetSSTByNumberHttpBinding' from namespace 'http://GetSST/IGetSSTByNumber'. Unable to import operation 'GetSSTByNumber'. The datatype 'http://GetSST/ISST:SST' is missing.    D:\Development\Stuff\FileR\ESBTest\ESBTest\Properties\Settings.settings

and several similar errors.

I tried to Import the same WSDL from local files and got the same errors.

I tried to add as a Service Reference as well as a Web Reference with no success.

I tried to delete all references and re-add them with no success.

I tried to expose another Axis service, which has only Simple Types - This worked fine.

I've seen an earlier post which suggested that Axis servi

asp.net webservice ERROR on production server.


Hi All,

 I'm using a web service in my asp.net 3.5 application.The web-service is hosted in my live server and it is working fine. My web application is also hosted in the same server.But when i try to access the webservice from my asp.net web application hosted online,I'm getting the following error.

[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xx.xx.xx.xx:80]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224

I'm able to call the online webservice from my web application hosted locally on my system and it is working fine.

Thanks in advance


getting error while accessing sharepoint usergroup webservice.



here is my code

ServiceReference1.UserGroup usrgrpService = new ServiceReference1.UserGroup();
            usrgrpService.Credentials = System.Net.CredentialCache.DefaultCredentials;
            usrgrpService.Url =

            XmlNode usersSite = usrgrpService.GetUserCollectionFromWeb();         


the UserGroup class is not getting populated in the intellisense and when i compile the progam i am getting the following error. the type or namespace 'Usergroup' does not exists.

my aim is to get the usergroups of a subsite in to sql database using sharepoint object model and sharepoint webservices. can any one please guide me how to proceed.

Protocol error (503 Service unavailable) when calling webservice from Win2003


I'm receiving a 503 Service unavailable -error from a webservice when calling client is on WinServer 2003.

Scenario: Windows Forms (.NET 4) application calls remote webservice on windows server 2003 to fetch information.
In some cases it takes a long time for the WebService to get the informationa (long running database procedure) so the client waits for the response.
WebService timeouts are set at +30min.

The setup has worked fine for some time now but recently we discored that a particular long running request began to fail.
The Windows Forms client fails with a 503: Service Unavailable -error and ProtocolError after just a couple of minutes into waiting for the response.

We did some testing and this error occurs if the client application is installed on a Windows Server 2003 box.
If we do the same test with the client application installed on a Windows 7 box it works without errors.

It seems that it has something to do with Windows 2003 but how to debug this?
Anyone have any ideas what could be the problem?


error in webservice after uploaded in the webserver



      i created a webservice in vs 2005, in which i am having service.asmx and service.cs in app_code folder and webconfig file, i written some web methods in .cs file and executed it worked fine in local system, then i created a virtual directory named testfold in iis and added this files in iis and published it.

 The problem is when i added my files on webserver in mysite and tried to access that webservice in my local windows app --> add webreferences i am getting error stating

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

Source Error:

Line 32:             ASP.NET to identify an incoming user. 
Line 33: -->
Line 34: <authentication

i try to run my WebService in Windows-7 64 bit and i got this error


i try to run my WebService in Windows-7 64 bit and i got this error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the except

Webservice versions.asmx: Getversions-method returns error on an item of a custom list.


I using GetVersions from the webservice http://server/_vti_bin/versions.asmx. This method works Okay in SharePoint 2007, and in SharePoint 2010 it also works Okay on documents from a document library. But when I used on an item from a custom list, it returns an error stating: "Value cannot be null.\r\nParameter name: key". In SharePoint 2007 I could retrieve the histroy on an item with the call GetVersions("Lists/MyCustomList/5_.000"), in SharePoint 2010 this fails.

Do I need to change the parameter, or use another filename for an item instead of "5_.000"? Does any one have the same experience?

Thank you

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