Cannot obtain Metadata when using WCFTestClient tool - wcf

I have a WCF service https://payments.acompany.com/WebBridge10/WebBridge10.svc?.
I can open it in the browser, now I want to test it with WCFTestClient tool. After I add the wsdl path to it, I got:
Error: Cannot obtain Metadata from https://payments.acompany.com/WebBridge10/WebBridge10.svc?wsdl If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: https://payments.acompany.com/WebBridge10/WebBridge10.svc?wsdl Metadata contains a reference that cannot be resolved: 'https://payments.acompany.com/WebBridge10/WebBridge10.svc?wsdl'. An error occurred while making the HTTP request to https://payments.acompany.com/WebBridge10/WebBridge10.svc?wsdl. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server. The underlying connection was closed: An unexpected error occurred on a send. Authentication failed because the remote party has closed the transport stream.HTTP GET Error URI: https://payments.acompany.com/WebBridge10/WebBridge10.svc?wsdl There was an error downloading 'https://payments.acompany.com/WebBridge10/WebBridge10.svc?wsdl'. The underlying connection was closed: An unexpected error occurred on a send. Authentication failed because the remote party has closed the transport stream.
Also I added the service reference to the Visual Studio project, the node(ValidateBTNandProceePayment) shows a + sign on the left. But the other services are showing a locker icon. See the image below.
Why?

Finally, because it is a https service. We need to set up tls 1.2 in Fiddler. So the solution is download Fiddler and click "Tools"=>"Fiddler options"=>"https".

This question seems to have been self answered already, but for anyone who doesn't want use Fiddler as workaround this solution might be relevant: https://stackoverflow.com/a/53503187/593617

Related

Is it possible to use Azure Custom Vision in a VB project?

I'm trying to include CustomVision features in an existing VB.NET application. When I try to call any of the functions to create a project or add tags etc., I get the following HttpRequestException:
System.Net.Http.HttpRequestException: 'An error occurred while sending the request.'
WebException: The underlying connection was closed: An unexpected error occurred on a send.
IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
SocketException: An existing connection was forcibly closed by the remote host
I've been able to successfully connect using a test project in C# so I know my keys and endpoints are correct. Is it possible to use Custom Vision with VB or is it just incompatible?
As soon as you can execute HTTP request from VB, there is no reason that it should not work.
The exception you are facing might be due to network configuration from where you are executing it. Can you add more details / a sample code to reproduce locally?

The underlying connection was closed: An unexpected error occurred on a send in SOAP webservice

I have a reference to a webservice which uses SOAP to process the searches and starting today morning i am receiving the following error:
The underlying connection was closed: An unexpected error occurred on a send.
This will not happen for few requests if the application is restarted and will start receiving these errors after a some time say like 5 minutes and if we restart as said the services are re-processed without any issues.
I have read: https://support.microsoft.com/en-us/kb/915599
but those methods will not work for my case. Anyone else have faced similar problem???
I don't have enough information to guarantee this will work, but this has happened to me before and the following solved the issue:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3
Note that this will force SSL3 instead of TLS. If the site you're hitting doesn't handle TLS well it could solve your problem. Note that all other HTTP/ServicePoint objects will then use SSL3 instead of TLS unless you change it back (including others in the same AppPool if this is IIS hosted).
The Web Service host has changed their certificates and that was causing the web service to fail when trying to access the service. The host has provided me with the latest certificates and now the problem is resolved.
Its weird that that initial connection and subsequent requests worked once i restart the application until the connection is closed and then when the application re-tries to connect, that's when the error message is popping up.

Showing error message from Project server 2010 wcf service

I implemented a web application that connects to a ProjectServer.svc web service. The application works on a project environment server, but returns an error in the production server. Unluckly, due to security settings the text and code of the exception taking place on the server is not shown, instead I get this message:
The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs
I modified the wcf settings in the web config of project server to make the web service return the error...but nothing happened, because probably Project server overrides the web config wcf settings.
How can I get the error message, so I can understand what is wrong with the server configuration?
Sometimes ULS log may help - when Project server process accepted your call and error somewhere inside of the process.
I touched the configs only once to create Proxy assembly and that time it worked... maybe the same approach will help you to find proper config. Here is a link http://msdn.microsoft.com/en-us/library/office/ff621594(v=office.14).aspx
Don't forget iisreset after you change the config

consuming WCF method via web service getting error only in IIS not in IDE

I have added http://ws.hipcricket.com/api/EndUser.svc as a service reference in a my web service. I am able to consume the methods from the IDE but while hosting the same in IIS I'm getting the following errors:
Error 1:
Could not connect to the (please refer the above url). TCP error code 10060: 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 69.20.116.221:80.
Error 2:
There was no endpoint listening at (please refer the above url) that could accept the message. This is often caused by an incorrect address or SOAP action. See Inner Exception, if present, for more details
Maybe you have a firewall blocking communication from your webserver? When developing on your local machine communications through the proxy may most likely be using your credentials, while the user that the application pool that your application is running under on your IIS server most probably does not have the correct rights.

unable to use WCF service in c# project - MetaData Error

Service Location:
http://1.1.1.1:5670/Test_Service/Service.SearchService.svc
Error:
The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'http://mycompany.com/Test_Service/Service.SearchService.svc?xsd=xsd2'.
- The remote name could not be resolved: 'mycompany.com'
Metadata contains a reference that cannot be resolved: 'http://1.1.1.1:5670/Test_Service/Service.SearchService.svc?wsdl'.
There was no endpoint listening at http://1.1.1.1:5670/Test_Service/Service.SearchService.svc?wsdl that could accept the message.
This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
The remote server returned an error: (404) Not Found.
If the service is defined in the current solution, try building the solution and adding the service reference again.
This only happens when i am not on the VPN. If i am on the VPN things work well. Also mycompany.com is only availalbe internally.
I can view the WSDL when not connected to the VPN
Your VPN probably gives you an ip address in the 1.1.1.* subnet (internal to your company's network). So, when you are connected to VPN, you can reach the server and when you are not connected, you cannot (because you are outside the company's network without VPN).
There is likely no resolution to this issue unless your company is willing to expose that server externally. Just use your VPN.
Per comment: Yes and you can see the WSDL like this http://1.1.1.1:5670/Test_Service/Service.SearchService.svc?wsdl but you will need to be VPN'd in. :)