Run SSRS report via SSIS using ReportExecutionServiceSoapClient - c#

How do I run a SSRS report using VS2015 in a SSIS package. The following answer is not the latest way of doing this apparently from what I have read. This post is the old way
how to run SSRS reports using SSIS? because it mentions ReportExecutionService not ReportExecutionServiceSoapClient.
I also tried another sites answer when I call the proxy (like first line of code it fails.
var webServiceProxy = new ReportExecutionServiceSoapClient("ReportExecutionServiceSoap")
Error I get is:
An exception of type 'System.InvalidOperationException' occurred in System.ServiceModel.dll but was not handled in user code
Additional information: Could not find endpoint element with name 'ReportExecutionServiceSoap' and contract 'ServiceReference1.ReportExecutionServiceSoap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.
It does not matter if I use the default config or the one from the below example or if I call the constructor that does not require a endpoint, so I am lost what else to try.
Refer to:
C# Example in SSIS
app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services />
<bindings>
<basicHttpBinding>
<binding name="basicHttpBindingConfig" allowCookies="true" maxReceivedMessageSize="5242880">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Ntlm" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://<myserver>/reportserver/ReportExecution2005.asmx?WSDL"
binding="basicHttpBinding" bindingConfiguration="basicHttpBindingConfig"
contract="ServiceReference1.ReportExecutionServiceSoap" name="ReportExecutionServiceSoap" />
</client>
</system.serviceModel>
</configuration>
Also at design time there is a warning:
The 'contract' attribute is invalid - The value 'ServiceReference1.ReportExecutionServiceSoap' is invalid according to its datatype 'clientContractType' - The Enumeration constraint failed.

Related

Web service not returning data in correct format

I have created following test application to retrieve data from Service Now.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
namespace ServiceNowConnection
{
class Program
{
static void Main(string[] args)
{
Service_Now_Reference.getRecords records = new Service_Now_Reference.getRecords();
records.sys_user = "XXXXXXX";
Service_Now_Reference.ServiceNowSoapClient proxyUser = new Service_Now_Reference.ServiceNowSoapClient();
proxyUser.ClientCredentials.UserName.UserName = "XXXXXX";
proxyUser.ClientCredentials.UserName.Password = "XXXXXX";
Service_Now_Reference.getRecordsResponseGetRecordsResult[] result = proxyUser.getRecords(records);
foreach (var item in result)
{
Console.WriteLine(item.sys_created_by);
}
Console.ReadLine();
}
}
}
This connects to the service now application correctly with no errors, but when I try to print retrieved data it gives me keys instead string type answers.
For some properties it gives correct values (example sys_updated_by)
how can I avoid this situation.
The way you need to do it.
If you are using RESTfull API in C# of cause you can do it by sending direct HTTPS call to service now.
But things getting complicated when you are using SOAP api
While you're importing web service to your program it includes following XML codes to the App.config or Web.config depending on your application intention(Web application or stand alone Application).
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ServiceNowSoap">
<security mode="Transport" />
</binding>
<binding name="ServiceNowSoap1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://XXXXXXXX.service-now.com/service_subscribe_sys_user_list.do?SOAP"
binding="basicHttpBinding" bindingConfiguration="ServiceNowSoap"
contract="ServiceReference1.ServiceNowSoap" name="ServiceNowSoap" />
</client>
</system.serviceModel>
First of all if you are expecting to have big set of records to be retrieved you need to increase the size of Max Received Message Size.
for that you need to edit the tag like following
<binding name="ServiceNowSoap" maxReceivedMessageSize="2000000000">
Next part is adding displayvalue=all to the URL.
We can't edit end point url withing the XML it self instead you can remove the URL and add it as a key value. But still you cant add parameters to the url with & sign you need to store values as separate keys and combine it withing the program to get the full URL
Final XML will be like this
<configuration>
<appSettings>
<add key="serviceNowUrl"
value="https://XXXXXXXX.service-now.com/service_subscribe_sys_user_list.do?"/>
<add key="displayvalue" value="displayvalue=true"/>
<add key="protocol" value="SOAP"/>
</appSettings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ServiceNowSoap" maxReceivedMessageSize="2000000000">
<security mode="Transport">
<transport clientCredentialType="Basic" proxyCredentialType="Basic"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="ServiceNowSoap1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint binding="basicHttpBinding" bindingConfiguration="ServiceNowSoap"
contract="Service_Now_Reference.ServiceNowSoap" name="ServiceNowSoap" />
</client>
</system.serviceModel>
</configuration>
You can assemble the url as follow
string url = ConfigurationSettings.AppSettings["serviceNowUrl"];
string protocol = ConfigurationSettings.AppSettings["protocol"];
string displayvalue = ConfigurationSettings.AppSettings["displayvalue"];
System.ServiceModel.EndpointAddress endpoint = new System.ServiceModel.EndpointAddress(string.Format("{0}{1}{2}", url, protocol, displayvalue));
If you update the URL you are using to get the WSDL and make requests to, to include 'displayvalue=all' the response will include display names as well as sys_id values (think foreign_key) of referenced records.
For more info check out: http://wiki.servicenow.com/?title=Direct_Web_Services#Return_Display_Value_for_Reference_Variables&gsc.tab=0
Thanks,
Bryan

BasicHttpBinding from app.config inaccessible in code

I have several web services that I am connecting to from a Visual Studio C# project using service references. Two of the service references were created and work without a problem, and one of them took quite a lot of effort to get imported, and now seems to not be working.
I believe the problem lies in the app.config file since it is getting a "Could not find endpoint element" error when I try to create the client.
Here is the app.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="RateQuoteSoap">
<security mode="Transport" />
</binding>
<binding name="RateQuoteSoap1" />
<binding name="QuoteSoap" />
<binding name="WebservicePrimusSoapBinding" />
</basicHttpBinding>
<customBinding>
<binding name="QuoteSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint
address="https://webservices.rrts.com/rating/ratequote.asmx"
binding="basicHttpBinding"
bindingConfiguration="RateQuoteSoap"
contract="RoadRunnerService.RateQuoteSoap"
name="RateQuoteSoap" />
<endpoint
address="http://services.echo.com/Quote.asmx"
binding="basicHttpBinding"
bindingConfiguration="QuoteSoap"
contract="EchoService.QuoteSoap"
name="QuoteSoap" />
<endpoint
address="http://services.echo.com/Quote.asmx"
binding="customBinding"
bindingConfiguration="QuoteSoap12"
contract="EchoService.QuoteSoap"
name="QuoteSoap12" />
<endpoint
address="http://api.shipprimus.com/"
binding="basicHttpBinding"
bindingConfiguration="WebservicePrimusSoapBinding"
contract="PrimusService.WebservicePrimusServicePort"
name="WebservicePrimusServicePort" />
</client>
</system.serviceModel>
</configuration>
The PrimusService is the one that is not working correctly, and the full error when I try to initialize the client like WebservicePrimusServicePortClient serviceClient = new WebservicePrimusServicePortClient("WebservicePrimusServicePort"); is
System.InvalidOperationException: Could not find endpoint element with name 'WebservicePrimusServicePort' and contract 'PrimusService.WebservicePrimusServicePort'in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.
I have also tried to simply initialize a BasicHttpBinding object using the binding name and the endpoint name with no luck (short variable names for readability)
BasicHttpBinding a = new BasicHttpBinding("QuoteSoap"); // Works fine
BasicHttpBinding b = new BasicHttpBinding("WebservicePrimusSoapBinding"); // Fails
BasicHttpBinding c = new BasicHttpBinding("WebservicePrimusServicePort"); // Fails
It throws no error for binding a, but binding b and c fail with the error:
System.Collections.Generic.KeyNotFoundException: No elements matching the key 'WebservicePrimusSoapBinding' were found in the configuration element collection.
While not a direct solution, I ended up just taking the information from the app.config and creating my own BasicHttpBinding and EndpointAddress objects in code. This is more of a workaround than a fix for the problem, and I still don't know why I couldn't access the information in the app.config directly.
I followed the solution in this answer about how to consume a service without using the app.config file.
I created my BasicHttpBinding like
BasicHttpBinding binding = new BasicHttpBinding();
binding.Name = "PrimusServiceBinding"; // Completely Unnecessary
and my endpoint like
EndpointAddress endpoint = new EndpointAddress("http://api.shipprimus.com/");
and could connect to the service and retrieve information without a problem, even providing as little information as I did (basically just the address).

Error "The username is not provided. Specify username in ClientCredentials." when passing CredentialCache.DefaultNetworkCredentials

I am writing a simple C# console application that will make a call to the "Lists.asmx" web service on a SharePoint site in order to pull down attachments. I've already added the service reference and tried to run it but it fails with the error
The username is not provided. Specify username in ClientCredentials.
when it tries to make a service method call to GetAttachmentCollection. Below is the code:
static void Main(string[] args)
{
ListsSoapClient client = new ListsSoapClient();
client.ClientCredentials.Windows.ClientCredential =
CredentialCache.DefaultNetworkCredentials;
XElement attachments = client.GetAttachmentCollection("Projects", "42");
// Do something with the attachments
}
As you can see I'm trying to set the ClientCredential to be the credentials for the the current user but it does not appear to be sending the user name. My SharePoint site is configured with https and Windows Authentication. Below is my simple config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpsBinding>
<binding name="ListsSoap">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Ntlm"
proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpsBinding>
</bindings>
<client>
<endpoint address="https://intranet.test.com/_vti_bin/Lists.asmx"
binding="basicHttpsBinding" bindingConfiguration="ListsSoap"
contract="ListServiceProxy.ListsSoap" name="ListsSoap" />
</client>
</system.serviceModel>
</configuration>
I have tried clientCredentialType="NtlM" and clientCredentialType="Windows" but I get the same result. Is there something wrong with my configuration file or some variable that I need to set on client?

How to pass user credentials to web service?

I am consuming a webservice using WSDL in windows application. When I try to use method, i get the following error:-
The HTTP request is unauthorized with client authentication scheme
'Anonymous'. The authentication header received from the server was '"
{"The remote server returned an error: (401) Unauthorized."}
I have user credentials but don't know how to pass it using c# code in windows application.
Here is the how it is working for me:-
Config file setting looks like this:-
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="bindingName" >
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://10.10.10.10:1880/testpad/services/Testwebservice"
binding="basicHttpBinding" bindingConfiguration="bindingName"
contract=testService.GetData" name="test_Port1" />
</client>
</system.serviceModel>
</configuration>
and here i am passing user credentials:-
var ser = new GetDataClient();
ser.ClientCredentials.UserName.UserName = "userid";
ser.ClientCredentials.UserName.Password = "Pa$$word1";
You can try to genereate your service client proxy using the method mentioned here. Once you have an instance of your WCF client proxy, it will have a property ClientCreditials which you can populate as needed.
Hope this helps.

WCF Service Client: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding

I've got a WCF Service running on my local IIS server. I've added it as a service reference to a C# Website Project and it adds fine and generates the proxy classes automatically.
However, when I try and call any of the service contracts, I get the following error:
Description: An unhandled exception occurred during the
execution of the current web request.
Please review the stack trace for more
information about the error and where
it originated in the code.
Exception Details: System.ServiceModel.ProtocolException:
The content type text/html;
charset=utf-8 of the response message
does not match the content type of the
binding (application/soap+xml;
charset=utf-8). If using a custom
encoder, be sure that the
IsContentTypeSupported method is
implemented properly. The first 1024
bytes of the response were: '
function
bredir(d,u,r,v,c){var w,h,wd,hd,bi;var
b=false;var p=false;var
s=[[300,250,false],[250,250,false],[240,400,false],[336,280,false],[180,150,false],[468,60,false],[234,60,false],[88,31,false],[120,90,false],[120,60,false],[120,240,false],[125,125,false],[728,90,false],[160,600,false],[120,600,false],[300,600,false],[300,125,false],[530,300,false],[190,200,false],[470,250,false],[720,300,true],[500,350,true],[550,480,true]];if(typeof(window.innerHeight)=='number'){h=window.innerHeight;w=window.innerWidth;}else
if(typeof(document.body.offsetHeight)=='number'){h=document.body.offsetHeight;w=document.body.offsetWidth;}for(var
i=0;i
I also have a console application which also communicates with the WCF Service and the console app is able to call methods fine without getting this error.
Below are excerpts from my config files.
WCF Service Web.Config:
<system.serviceModel>
<services>
<service name="ScraperService" behaviorConfiguration="ScraperServiceBehavior">
<endpoint address=""
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IScraperService"
contract="IScraperService" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://example.com" />
</baseAddresses>
</host>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IScraperService"
bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="2000000" maxReceivedMessageSize="2000000"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true" allowCookies="false">
<readerQuotas
maxDepth="2000000" maxStringContentLength="2000000"
maxArrayLength="2000000" maxBytesPerRead="2000000"
maxNameTableCharCount="2000000" />
<reliableSession
enabled="false" ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default"
establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ScraperServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
Website Project Service Client Web.Config:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IScraperService"
closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true" allowCookies="false">
<readerQuotas
maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384" maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<reliableSession enabled="false"
ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<transport clientCredentialType="Windows"
proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows"
negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint name="WSHttpBinding_IScraperService"
address="http://example.com/ScraperService.svc"
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IScraperService"
contract="ScraperService.IScraperService" >
<identity>
<servicePrincipalName value="host/FreshNET-II" />
</identity>
</endpoint>
</client>
</system.serviceModel>
I had a similar issue. I resolved it by changing
<basicHttpBinding>
to
<basicHttpsBinding>
and also changed my URL to use https:// instead of http://.
Also in <endpoint> node, change
binding="basicHttpBinding"
to
binding="basicHttpsBinding"
This worked.
Try browsing to http://localhost/ScraperService.svc in the web browser on the server hosting the service, using the same Windows credentials that the client normally runs under.
I imagine that IIS is displaying an html error message of some description instead of returning xml as expected.
This also can occur when you have an http proxy server that performs internet filtering. My experience with ContentKeeper is that it intercepts any http/https traffic and blocks it as "Unmanaged Content" - all we get back is an html error message. To avoid this, you can add proxy server exception rules to Internet Explorer so that the proxy doesn't intercept traffic to your site:
Control Panel > Internet Options > Connections > LAN Settings > Advanced > Proxy Settings
An HTML response from the web server normally indicates that an error page has been served instead of the response from the WCF service. My first suggestion would be to check that the user you're running the WCF client under has access to the resource.
what's going on is that you're trying to access the service using wsHttpBind, which use secured encrypted messages by default (secured Messages).
On other hand the netTcpBind uses Secured encrypted channels. (Secured Transport)... BUT basicHttpBind, doesn't require any security at all, and can access anonymous
SO. at the Server side, Add\Change this into your configuration.
<bindings>
<wsHttpBinding>
<binding name="wsbind">
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
then add change your endpoint to
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsbind" name="wshttpbind" contract="WCFService.IService" >
That should do it.
As with many, in my situation I was also getting this because of an error. And sadly I could just read the CSS of the html error page.
The source of my problem was also a rewrite rule on the server. It was rewriting http to https.
I tried all the suggestions above, but what worked in the end was changing the Application Pool managed pipeline from Integrated mode to Classic mode.
It runs in its own application pool - but it was the first .NET 4.0 service - all other servicves are on .NET 2.0 using Integrated pipeline mode.
Its just a standard WCF service using is https - but on Server 2008 (not R2) - using IIS 7 (not 7.5) .
In my WCF serive project this issue is due to Reference of System.Web.Mvc.dll 's different version. So it may be compatibility issue of DLL's different version
When I use
System.Web.Mvc.dll version 5.2.2.0 -> it thorows the Error The content type text/html; charset=utf-8 of the response message
but when I use
System.Web.Mvc.dll version 4.0.0.0 or lower -> it works fine.
I don't know the reason of different version DLL's issue but by changing the DLL's verison it works for me.
This Error even generate when you add reference of other Project in your WCF Project and this reference project has different version of System.Web.Mvc DLL or could be any other DLL.
NOTE: If your target server endpoint is using secure socket layer (SSL) certificate
Change your .config setting from basicHttpBinding to basicHttpsBinding
I am sure, It will resolve your problem.
In my case a URL rewrite rule was messing with my service name, it was rewritten as lowercase and I was getting this error.
Make sure you don't lowercase WCF service calls.
You may want to examine the configuration for your service and make sure that everything is ok. You can navigate to web service via the browser to see if the schema will be rendered on the browser.
You may also want to examine the credentials used to call the service.
I had a similar situation, but the client config was using a basicHttpBinding. The issue turned out to be that the service was using SOAP 1.2 and you can't specify SOAP 1.2 in a basicHttpBinding. I modified the client config to use a customBinding instead and everything worked. Here are the details of my customBinding for reference. The service I was trying to consume was over HTTPS using UserNameOverTransport.
<customBinding>
<binding name="myBindingNameHere" sendTimeout="00:03:00">
<security authenticationMode="UserNameOverTransport" includeTimestamp="false">
<secureConversationBootstrap />
</security>
<textMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16"
messageVersion="Soap12" writeEncoding="utf-8">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</textMessageEncoding>
<httpsTransport manualAddressing="false" maxBufferPoolSize="4194304"
maxReceivedMessageSize="4194304" allowCookies="false" authenticationScheme="Basic"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
keepAliveEnabled="true" maxBufferSize="4194304" proxyAuthenticationScheme="Anonymous"
realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
useDefaultWebProxy="true" requireClientCertificate="false" />
</binding>
</customBinding>
Even if you don't use network proxy, turning 'Automatically detect settings' in proxy dialog makes this exception go off.
If your are using both wshttpbinding along with https request, then i resolved it by using the below configuration change.
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" />
<message clientCredentialType="Certificate" />
</security>
I had a similar issue in my asp.net core 5 web api project to call a soap service. I resolved it by :
1.changing its url : return new System.ServiceModel.EndpointAddress("http://ourservice.com/webservices/service1.asmx?wsdl"); to https://ourservice.com/...
use these config in its Reference.cs :
private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
{
if ((endpointConfiguration == EndpointConfiguration.TaxReturnSoap))
{
System.ServiceModel.BasicHttpsBinding result = new System.ServiceModel.BasicHttpsBinding();
result.TextEncoding = System.Text.Encoding.UTF8;
result.MaxBufferSize = int.MaxValue;
result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
result.MaxReceivedMessageSize = int.MaxValue;
result.AllowCookies = true;
return result;
}
if ((endpointConfiguration == EndpointConfiguration.TaxReturnSoap12))
{
System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
textBindingElement.WriteEncoding = System.Text.Encoding.UTF8;
textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None);
result.Elements.Add(textBindingElement);
System.ServiceModel.Channels.HttpsTransportBindingElement httpBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement();
httpBindingElement.AllowCookies = true;
httpBindingElement.MaxBufferSize = int.MaxValue;
httpBindingElement.MaxReceivedMessageSize = int.MaxValue;
result.Elements.Add(httpBindingElement);
return result;
}
throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
}
X++
binding = endPoint.get_Binding();
binding.set_UseDefaultWebProxy(false);
Hy,
In my case this error appeared because the Application pool of the webservice had the wrong 32/64 bit setting. So this error needed the following fix: you go to the IIS, select the site of the webservice , go to Advanced setting and get the application pool. Then go to Application pools, select it, go to "Advanced settings..." , select the "Enable 32 bit applications" and make it Enable or Disable, according to the 32/64 bit type of your webservice.
If the setting is True, it means that it only allows 32 bit applications, so for 64 bit apps you have to make it "Disable" (default).
For me, it was the web app connection string pointing to the wrong database server.
In my case it was happening because my WCF web.config had a return character as its first line. It was even more frustrating because it was behind a load balancer and was happening only half the time (only one of the two web.configs had this problem).
This error happens also when :
targetNamespace is wrongly defined in the wsdl
or
when the ns2 is wrongly defined in the response (different from the ns in the request) . For example
request
<.. xmlns:des="http://zef/">
response
<ns2:authenticateResponse xmlns:ns2="http://xyz/">
i was getting this error in NavitaireProvider while calling BookingCommit service (WCF Service Reference)
so, when we get cached proxy object then it will also retrived old SigninToken which still may not be persisted
so that not able to authenticate
so as a solution i called Logon Service when i get this exception to retrieve new Token
I solved this problem by setting UseCookies in web.config.
<system.web>
<sessionState cookieless="UseCookies" />
and setting enableVersionHeader
<system.web>
<httpRuntime targetFramework="4.5.1" enableVersionHeader="false" executionTimeout="1200" shutdownTimeout="1200" maxRequestLength="103424" />
For me the issue was resolved when I commented the following line in Web.config
<httpErrors errorMode="Detailed" />
My solution was rather simple: backup everything from the application, uninstall it, delete everything from the remaining folders (but not the folders so I won't have to grant the same permissions again) then copy back the files from the backup.

Categories

Resources