Web Service Error "There was no endpoint listening at..." Firewall Concern - asp.net

So I have a web service service reference that works localhost and can be pinged from its production url but I can't get access to it via the Service Reference call in production. I believe the issue is my firewall . I have two websites on the same server each with their own dedicated IP address. I am trying to call the web service on the second website from the first website. If I open a browser on my production server I cannot navigate to either website.
Error Description:There was no endpoint listening at http://[209.112.245.103]/Services/OfferService.asmx that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Inner Exception:Unable to connect to the remote server
The calling website is on the same server (different IP of course) and is calling the web service via a service reference:
Dim offerService As New ServiceReferenceOffer.OfferServiceSoapClient("OfferServiceSoap")
offerService.BroadcastOfferChange(offer.PropertyID, offer.OfferID, offer.ResultResponse)
And my web.config contains the following service endpoint information:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="OfferServiceSoap" />
<binding name="ConversationServiceSoap" />
</basicHttpBinding>
<customBinding>
<binding name="OfferServiceSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
<binding name="ConversationServiceSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://209.112.245.103/Services/ConversationService.asmx"
binding="basicHttpBinding" bindingConfiguration="ConversationServiceSoap"
contract="ServiceReferenceConversation.ConversationServiceSoap"
name="ConversationServiceSoap" />
<endpoint address="http://209.112.245.103/Services/ConversationService.asmx"
binding="customBinding" bindingConfiguration="ConversationServiceSoap12"
contract="ServiceReferenceConversation.ConversationServiceSoap"
name="ConversationServiceSoap12" />
<endpoint address="http://209.112.245.103/Services/OfferService.asmx"
binding="basicHttpBinding" bindingConfiguration="OfferServiceSoap"
contract="ServiceReferenceOffer.OfferServiceSoap" name="OfferServiceSoap" />
<endpoint address="http://209.112.245.103/Services/OfferService.asmx"
binding="customBinding" bindingConfiguration="OfferServiceSoap12"
contract="ServiceReferenceOffer.OfferServiceSoap" name="OfferServiceSoap12" />
</client>
</system.serviceModel>

Your configurations are correct. I just accessed your server and everything went fine (so it's not code related).
Since the site and the website are in the same server, you may need to use a different IP or address to access the wcf (try 127.0.0.1, localhost or an internal server ip).

Related

How to start 2660 port in IIS for Tridion Core Service connection using netTcp

I am trying to connect to Tridion using core service script, here is my code:
public static SessionAwareCoreServiceClient Client;
Client = new SessionAwareCoreServiceClient("netTcp_2011");
Client.ClientCredentials.Windows.ClientCredential = new NetworkCredential(user, password);
web.Config has following:
<system.serviceModel>
<!-- Default/example WCF settings for Core Service. These settings should be copied into the host application's configuration file. -->
<bindings>
<!-- Default Core Service binding settings are provided here. These can be used as a starting point for further customizations. -->
<basicHttpBinding>
<binding name="basicHttp" maxReceivedMessageSize="10485760">
<readerQuotas maxStringContentLength="10485760" maxArrayLength="10485760"/>
<security mode="TransportCredentialOnly">
<!-- For LDAP or SSO authentication of transport credentials, use clientCredentialType="Basic" -->
<transport clientCredentialType="Windows"/>
</security>
</binding>
<binding name="streamDownload_basicHttp" maxReceivedMessageSize="209715200" transferMode="StreamedResponse" messageEncoding="Mtom" sendTimeout="00:15:00">
<security mode="TransportCredentialOnly">
<!-- For LDAP or SSO authentication of transport credentials, use clientCredentialType="Basic" -->
<transport clientCredentialType="Windows"/>
</security>
</binding>
<binding name="streamUpload_basicHttp" maxReceivedMessageSize="209715200" transferMode="StreamedRequest" messageEncoding="Mtom" receiveTimeout="00:15:00">
<security mode="None"/>
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding name="netTcp" transactionFlow="true" transactionProtocol="WSAtomicTransaction11" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647"/>
</binding>
<binding name="streamDownload_netTcp" maxReceivedMessageSize="2147483647" transferMode="StreamedResponse" sendTimeout="00:20:00"/>
<binding name="streamUpload_netTcp" maxReceivedMessageSize="2147483647" transferMode="StreamedRequest" receiveTimeout="00:20:00"/>
</netTcpBinding>
</bindings>
<client>
<!--Dev 2013 -->
<endpoint name="netTcp_2011" address="net.tcp://localhost:2660/CoreService/2011/netTcp" binding="netTcpBinding" bindingConfiguration="netTcp" contract="Tridion.ContentManager.CoreService.Client.ISessionAwareCoreService"/>
<endpoint name="streamDownload_netTcp_2011" address="net.tcp://localhost:2660/CoreService/2011/streamDownload_netTcp" binding="netTcpBinding" bindingConfiguration="streamDownload_netTcp" contract="Tridion.ContentManager.CoreService.Client.IStreamDownload"/>
<endpoint name="streamUpload_netTcp_2011" address="net.tcp://localhost:2660/CoreService/2011/streamUpload_netTcp" binding="netTcpBinding" bindingConfiguration="streamUpload_netTcp" contract="Tridion.ContentManager.CoreService.Client.IStreamUpload"/>
<!-- -->
</client>
</system.serviceModel>
Still I get this Error:
Could not connect to net.tcp://localhost:2660/CoreService/2011/netTcp. The connection attempt lasted for a time span of 00:00:01.0520000. TCP error code 10061: No connection could be made because the target machine actively refused it localhost:2660.
Note: localhost can also be an IP of a CMS instance.
Can anyone help?
Okay, so Over the time I educated myself and can clearly say that the error target machine actively refused it localhost:2660 clearly says that the port is not open for you to use.
So do these two things to be sure:
Make sure you have allowed net.tcp in IIS
And the port 2660 open in the windows firewall?
run a netstat -tan to see whether anything is running on 2660, if not then you can not access it.
Also If you are running your code form local system or from another server, in case netTcp is not working, try to use wsHttp or BasicHttp (provided you have these bindings in your server core service's web.config)
The Core Service runs as a Windows Service, not from IIS. Open Windows Services and make sure that the Tridion Content Manager Service Host is running.

Could not find a base address that matches scheme https. wcf on visual studio localhost

I am trying to use wcf on both https and http.
I manage to config the web.config to work on the server both http and https.
the problem is that wcf not working on the visual studio localhost(doesn't have ssl).
the web.config look like this
<webHttpBinding>
<binding name="webBinding">
<security mode="Transport">
</security>
</binding>
<binding name="webBindingNotSecure">
<security mode="None">
</security>
</binding>
</webHttpBinding>
and then 2 endpoint for http and https:
<service name="Website.WebServices.ddPoplute">
<endpoint behaviorConfiguration="Website.WebServices.ddPopluteAspNetAjaxBehavior"
binding="webHttpBinding" bindingConfiguration="webBinding" contract="Website.WebServices.ddPoplute">
</endpoint>
<endpoint behaviorConfiguration="Website.WebServices.ddPopluteAspNetAjaxBehavior"
binding="webHttpBinding" bindingConfiguration="webBindingNotSecure" contract="Website.WebServices.ddPoplute" />
</service>
as mention above in the server that has https everything just fine, but on localhost that doesn't have the ssl I am getting error:
Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http]
If I delete the endpoint with security mode="Transport" the wcf work on the localhost but not on https(in server).
ant idea what to do?
Thnaks
Baaroz
visual studio doesn't support https and ssl and the error return because the protocol doesn't exist.
for solving the problem you should install iis express and use it in visual studio.
check here for learn how to use iis express
http://joel.net/setting-up-visual-studio-2010-and-iis-express

Adding an ASMX web service as a service reference generates multiple endpoints

Lately in all my new web applications I have been adding web services as service references rather than web references. Most of our web services were designed as asmx web services.
After adding the service reference my web.config always looks like this:
<bindings>
<basicHttpBinding>
<binding name="UserSoap" />
</basicHttpBinding>
<customBinding>
<binding name="UserSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="{{service URL}}" binding="basicHttpBinding"
bindingConfiguration="UserSoap" contract="User.UserSoap"
name="UserSoap" />
<endpoint address="{{service URL}}" binding="customBinding"
bindingConfiguration="UserSoap12" contract="User.UserSoap"
name="UserSoap12" />
</client>
Then my application gives this error when I try to consume it:
An endpoint configuration section for contract 'User.UserSoap' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.
I have been manually removing one of the endpoints, but now I want to know how to fix this.
Any ideas on how I can prevent this from happening, or why is this happening?
If you want to remove SOAP 1.2 support for your service, you would include the following in your web.config:
<configuration>
<system.web>
<webServices >
<protocols>
<remove name="HttpSoap12"/>
</protocols>
</webServices>
</system.web>
</configuration>
Add or remove SOAP 1.2 for ASMX services
Otherwise, you'll need to access with endpoint name.
var service = new User.UserSoapClient("UserSoap")

Asp.Net wcf service endpoint

I have a set of services in an asp.net service project. I have configured the endpoints for them in web.config.
This is how I setup the endpoints in web.config:
<bindings>
<basicHttpBinding>
<binding name="GeneralBindingConfig" maxBufferSize="524288" maxBufferPoolSize="524288" maxReceivedMessageSize="6553600">
<readerQuotas maxDepth="32" maxStringContentLength="100000" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="TeamTravel.Cloud.Services.ServiceContracts.AccountServices">
<endpoint address="/Services" binding="basicHttpBinding" bindingConfiguration="GeneralBindingConfig" contract="TeamTravel.Cloud.Services.ServiceContracts.Interfaces.IAccountServices" />
</service>
<service name="TeamTravel.Cloud.Services.ServiceContracts.JourneyServices">
<endpoint address="/Services" binding="basicHttpBinding" bindingConfiguration="GeneralBindingConfig" contract="TeamTravel.Cloud.Services.ServiceContracts.Interfaces.IJourneyServices" />
</service>
<service name="TeamTravel.Cloud.Services.ServiceContracts.JourneyTrackerServices">
<endpoint address="/Services" binding="basicHttpBinding" bindingConfiguration="GeneralBindingConfig" contract="TeamTravel.Cloud.Services.ServiceContracts.Interfaces.IJourneyTrackerServices" />
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
In IIS i mounted the website under this binding: www.teamtravel.com
I also added the entry in my hosts file so that I can access the website locally from that url.
So based on the configuration I should be able to access a service like this:
www.teamtravel.com/Services/AccountServices.svc
AccountServices.svc are asp.net wcf services.
But I get redirected to an error path:
http://teamtravel.com/default.aspx?aspxerrorpath=/Services/AccountServices.svc
When hosting WCF service on IIS, the virtual directory where your service exists defines your service endpoint's address, so you can just leave this property empty:
<endpoint address="" ... />
And you service will be reachable from www.teamtravel.com/<YourIISVirtualDirectory>/AccountServices.svc.
Address property may be used to add endpoints with addresses relative to that address:
<endpoint address="anotherEndpoint" .../>
so this endpoint will be reachable from www.teamtravel.com/<YourIISVirtualDirectory>/AccountServices.svc/anotherEndpoint
For reference, read Deploying an Internet Information Services-Hosted WCF Service from MSDN.

Error on Silverlight WCF access via https

From my silverlight 4.0 application. I can access the WCF File easily but when moved to https, I can't access the WCF Service. The error details are following:
An unknown error occurred. Please contact your system Administrator for more information.
An exception occurred during the operation, making the result invalid. Check InnerException for exception details.
at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at FileSearch.SearchServices.GetTypeofFileDetailedCompletedEventArgs.get_Result()
at FileSearch.Home.<SearchButton_Click>b__0(Object s, GetTypeofFileDetailedCompletedEventArgs ea)
at FileSearch.SearchServices.SearchServiceClient.OnGetTypeofFileDetailedCompleted(Object state)
I have seen different posts regarding this issue, but nothing is pointing me in a proper direction.
Here are the details regarding my web.config file for the web application that hosts the silverlight application as well as the WCF Service.
<services>
<service name="FileSearch.Web.Services.SearchService">
<endpoint address="" binding="customBinding" bindingConfiguration="FileSearch.Web.Services.SearchService.customBinding0" contract="FileSearch.Web.Services.SearchService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
and here is the servicerefernce.clientconfig file:
<configuration>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_SearchService">
<binaryMessageEncoding />
<httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="../Services/SearchService.svc"
binding="customBinding" bindingConfiguration="CustomBinding_SearchService"
contract="SearchServices.SearchService" name="CustomBinding_SearchService" />
</client>
</system.serviceModel>
</configuration>
UPDATE:
I've received answers to run the service in the https mode only. I want to run the service in both http and https modes.
any ideas regarding this ?
Specify two endpoints one with secured transport and one without it.
try adding
<security mode="Transport" />
in you service config file. this should be nested inside the binding node.
Check out the security mode configuration section in this article.
For supporting Https scheme, you'd need to change transport to <httpsTransport>. I see you're using <httpTransport>.

Resources