WCF web service method dying on https, works on http - vb.net

I have an old WCF web service method which execute 10-20 minutes.
It's written on vb.net 4.0
I use SoapUI application to test it, and self written vb.net app which consume it.
On my localhost when I run it in Debug mode with IIS Express, I'm getting results back in both application.
But on QA web server, under https, I'm getting error back:
SoapUI error: Error getting response; java.net.SocketException: Connection reset.
From my web client: "An error occurred while receiving the HTTP response to https://qa.organization.com/services/Blah.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details." Inner Exception: The underlying connection was closed: An unexpected error occurred on a receive. Inner Exception: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
Web engineer run trace on web server, got and error "An operation was attempted on a nonexistent network connection".
Please advise what else I can check in order to fix this issue?
From web service web.config:
<binding name="Blah_1"
closeTimeout="00:12:00"
openTimeout="00:12:00"
receiveTimeout="00:30:00"
sendTimeout="00:30:00"
allowCookies="false"
bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
messageEncoding="Text"
textEncoding="utf-8"
transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="1000"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" />
<security mode="Transport">
<transport clientCredentialType="None"
proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName"
algorithmSuite="Default" />
</security>
</binding>

Add the protocol mapping in the config file:
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>

Related

WCF The HTTP request is unauthorized with client authentication scheme 'Negotiate'

I have a WCF service hosted on IIS with Windows Aut, I am able to connect to the service from my client application (WPF) on my local machine, but when I try to access the service from some other machine I get the following error
The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
I checked the providers in my IIS and there "Negotiate" is the first one and then the "NTLM". I also tried removing "NTLM" but that also did not help.
I have following configuration in my App.config
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding" maxReceivedMessageSize="2147483647"
receiveTimeout="00:30:00" sendTimeout="00:30:00"
openTimeout="00:10:00" closeTimeout="00:10:00">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="20971520" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
You may need to enable anonymous access in IIS.

wsDualHttpBinding error in Win7

I have one server/client app where server is hosted in IIS server, and many clients will connect to that IIS server, Dual binding is use to broadcast message from server to clients.
I am develop in my Vista machine which has no error, however when we test the client app on client PC, which is using Windows 7, I got error.
First time I have this error:
HTTP could not register URL
http://+:80/Temporary_Listen_Addresses/cc6f2e30-ff08-4bfc-8397-d67630337a9c/
because TCP port 80 is being used by another application. Exception
handled on main UI thread 1.
according to solution from internet, I have added a clientBaseAddress in client config file (No change and never add clientBaseAddress in server config), now I get second error:
HTTP could not register URL http://+:91/NightlyBuild/NonVer/Communication/. Your
process does not have access rights to this namespace (see
http://go.microsoft.com/fwlink/?LinkId=70353 for details). Exception
handled on main UI thread 1.
Ok I found some comments said need to run the client app in administrator mode, I do that as well, I do not get the previous two errors, but this time I get timeout error after the screen freeze for 5 minutes.
Timeout error
The open operation did not complete within the allotted timeout of
00:05:00. The time allotted to this operation may have been a portion
of a longer timeout. Exception handled on main UI thread 1.
Below is the client config that I am using when I hits second error.
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_ICommunicationService"
closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:05:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="0" maxReceivedMessageSize="2147483647"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
clientBaseAddress="http://remote-server:8001/Communication/">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<!--<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
</security>-->
<security mode="None" />
</binding>
Endpoint in client config:
<client>
<endpoint address="http://remote-server:90/Communication/CommunicationService.svc" binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_ICommunicationService" contract="CommunicationService.ICommunicationService" name="WSDualHttpBinding_ICommunicationService">
</endpoint>
</client>
Really run out of idea, any comments?
The client "HTTP could not register..." error occurs because the specified url is not registered to the user you run the process under.
To solve this temporarily, you can use the HTTPNamespaceManager.exe program to modify the list of URL access reservations on the local computer. Get it here: PaulWh's Tech Blog

WCF cannot connect to endpoint after successfully adding service reference

I've successfully published a WCF service on our production server. I can navigate to the page and see the default WCF page.
I can add the service via "Add Service Reference" to a client on my computer. I can also "Update Service Reference" with no problems what so ever.
The service was confirmed to work on my local computer with and without the client by running the default debugger that comes with VS2010.
When trying to call a service method (from the server hosted service), I receive this exception..
There was no endpoint listening at that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
InnerException...
{"The remote server returned an error: (404) Not Found."}
I've also tried running a client on the server itself to see if I can connect but I get the same error.
I even tried just deploying the basic WCF service that's created for you when you create a WCF service library (very basic), changed nothing, deployed successfully, and get the same error.
What am I doing wrong? I've went down the road of IIS configurations, SSL certificates, etc but nothing seems to fix it. I feel as though I'm missing something very basic here.
EDIT CLIENT CONFIG...
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" 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" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://SERVER_NAME.DOMAIN_NAME.com/TestService/TestService.Service1.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>
Some pitfalls to check:
1) Check if the service URL is correct on your configuration files. This includes the protocol. It happened to me recently: the .config file had "http://" and the webserver was only accessible through HTTPS.
2) Disable the "required client certificate" setting on IIS.
3) If your service is inside an asp.net application, check if there are any restrictions of Authentication / Authorization in place. Allow anonymous access to your .SVC

How to resolve WCF CommunicationException was unhandled

I have some problems.
the issue is CommunicationException error.
error message is
An error occurred while receiving the
HTTP response to
http://localhost:18080/WCFServices/TestService.
This could be due to the service
endpoint binding not using the HTTP
protocol. This could also be due to an
HTTP request context being aborted by
the server (possibly due to the
service shutting down). See server
logs for more details.
I wrote below source code.
TestServiceClient client = new TestServiceClient();
TestSettings[] voltages = client.GetTestSettings();
Error message appears above tilt word.
I want to synchronize Main Application and Client Application.
Above error is Client Application.
My app.config file is
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_ITestService" 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="209715200"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:18080/WCFServices/TestService"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITestService"
contract="TestServiceReference.ITestService"
name="WSHttpBinding_ITestService" />
</client>
</system.serviceModel>
</configuration>
ps. TestService is modified that is temporarily
please anyone.
thanks.
oh sorry, error occurred on "voltage"
I tried to increase maxsize and length.
but, it didn`t resolve this issue.
somebody help me.
Without seeing your server side config it's going to be hard to help you troubleshoot.
Having said that, one of the things you can do to get the real underlying exception (you're not seeing what's really going on) is to configure WCF Tracing. Just drop that config snippet in the config file on your server side, and look through the logs generated. That should point you to the real problem. Make sure to take it back out when you're finished.

TCP Error Code 10060 when sending request to Oracle Service Registry from Windows WCF Client

Hi All I get below error when sending request to OSR (Oracle Service Registry) from a Windows WCF Client.
"Could not connect to http://xxxx:xx/registry/uddi/inquiry TCP error code 10060: A Connection attempt failed vecause the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond HostIPAddress:Port."
the inner exception is:
An exception of type 'System.ServiceModel.EndpointNotFoundException' occured in method 'handleReturnMessage' of class 'realProxy'.
Env Details:
WCF Client installed on mutiple remote computers connected via broadband.
OSR installed on Linux box ( I don't have any control on this).
WCF Client details:
.NET Framewrok 3.5 Win Form app.
Client config file showing OSR endpoint and binding details.
<basicHttpBinding>
<binding name="basHTTPBinding" 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" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
<client>
<endpoint binding="basicHttpBinding" bindingConfiguration="basHTTPBinding" contract="XXXX" name="OSR" />
</client>
Please let me know any of your thoughts on why this error occurs. Please note that this occurs intermitently.
Thanks.
The reason most likely for this error could be network issue over VPN. We need to monitor the network availability on the prod site if we face such kind of issues.