SSL Negotiation Failure in WCF Service

Hi,
I have a WCF service hosted in IIS that is making a call to another cloud hosted service using HTTPS, however I get the error 
'The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel'.
I have checked the following so far to diagnose this problem:
- The remote certificate has not expired
- The remote certificate trust chain is valid on my server up to the root trusting authority, and this root authority certificate is in my servers Trusted Root Certification Authorities
store
- The HTTPS connection from my service to the cloud service works for 1 hour after an IIS Reset, and then it fails and doesn't start working again until another IIS Reset is done.
- I have enabled verbose logging for  System.Net and can see the SSL negotiation starting, and my service receives the remote certificate and prints the cert info, and it all looks
valid.
The next messages in the log are
System.Net Information: 0 : [5832] SecureChannel#10559359 - Remote certificate was verified as invalid by the user.
    ProcessId=3264
    DateTime=2014-09-02T20:27:30.4279756Z
System.Net.Sockets Verbose: 0 : [5832] Socket#18356823::Dispose()
    ProcessId=3264
    DateTime=2014-09-02T20:27:30.4279756Z
System.Net Error: 0 : [5832] Exception in HttpWebRequest#41735743:: - The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel..
- This issue only occurs on the production server.  The same service installed on 3 other servers works flawlessly
- I have compared the IIS configuration for production and the 3 other servers and there are no obvious differences that could cause this issue.
- My service is running on Windows Server 2008 R2, IIS 7.0, .NET Framework 4.0
I'd appreciate any advice on what I can try to understand why the SSL negotiation is failing.
Thanks

Try post to cloud service forum.

Similar Messages

  • BizTalk Tracking Profile Editor not tracking the data and how to implement the Orchestration as wcf service over SSL

    Hi Ashwinprabhu,
    thank you very much for your answer.
    i have one more query, I have orchestration published as wcf service in IIS and internally orchestration calling one more service , it means orchestration sending a request and getting response back from the service.
    actually we are implementing the copy of that called service through biztalk orchestration for system automatic and tracking failed messages and n/w failures.
    But tracking profiler not tracking the Data.
    And we need to develop the http service as https(Over SSL), we implemented in iis using self 
    signed certificate, it is working just browser for wsdl(in browser), we are not able to test the service in wcf test client, it is giving wsdl error, in wsdl schema reference showing with HTTP only,
    please help me how to resolve the issue.
    Teegala

    First things first, I think it's best to publish only schemas as WCF service for dependency management reasons. That said - WSDL availability is covered in the WCF adapter under the behaviors. If you're using HTTPBasic this may be hard to modify, but using
    WCFCustom allows you to add the WSDL behavior and specify that it should be available via HTTPS.
    As to the BAM, are you using TPE within the orchestration or at the port level?  I'd imagine your TPE tracks the start and end events of your orchestration using the Orchestration Schedule.  If you're fairly confident that the TPE is correct and
    yet don't see BAM data 1) make sure your SQL Agent is running healthy and all jobs look OK and 2) check the TDDS tables in both the message box and the BAMPrimaryImport databases.  These will show you if there has been some sort of sync issue. There's
    even a TDDS errors tables - so check that out.
    Kind Regards,
    -Dan
    If this answers your question, please Mark as Answer

  • WCF service fronted with SSL enabled NGINX load balancer shows HTTP based WSDL url instead of HTTPS

    Hi,
    I have WCF service hosted using IIS 8.5 on application server. And application servers are fronted with NGINX load balancer with SSL enabled. Backend communication protocol between NGINX to application server is http. 
    When customer visits public domain url (https://xxx.com/service.svc), they can see the WSDL url with http://xxx.com/service.svc?wsdl. 
    What change should I make so that WSDL url will have https instead of http ? 
    This is service side configuration.
    <system.serviceModel>
        <services>
          <service name="Service.IService">
            <endpoint address="" binding="basicHttpBinding" bindingNamespace="http://xyz.com/Service" name="Service_Endpoint" contract="Service.IService" />
          </service>
        </services>
        <bindings>
          <basicHttpBinding />
        </bindings>
        <client />
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <serviceThrottling maxConcurrentCalls="5000" maxConcurrentInstances="2147483647" maxConcurrentSessions="5000" />
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
    Thanks in advance !!

    Hi,
    For this scenario, you could just enable SSL in IIS to get HTTPS endpoints. If your service is exposed at https then you configure the same using “httpsGetEnabled”:
    <behaviors>
    <serviceBehaviors>
    <behavior
    name="MyServiceTypeBehaviors"
    >
    <serviceMetadata
    httpGetEnabled="true"
    />
         </behavior>
    </serviceBehaviors>
    </behaviors>
    For more information, you could refer to:
    http://www.codeproject.com/Articles/327260/What-s-new-in-WCF-Automatic-HTTPS-endpoint-for
    http://blogs.msdn.com/b/brajens/archive/2007/04/26/accessing-description-metadata-wsdl-of-wcf-web-service.aspx
    Regards

  • BizTalk published WCF service throwing HTTP 404 error using ISA reverse proxy settings

    I have published my schemas as a WCF service from BizTalk 2010 "Publish WCF Service" wizard. I used Wcf-basicHTTP adapter in receive port. I am able to run the service successfully on localhost IIS and I tested my biztalk solution by sending request using SOAP UI and got response successfully.... Now: Actually, I need to give this service endpoint to my vendor who will send request from outside my company's network i.e. internet. In my infrastrucrue BizTalk is behind the firewall so, we setup a REVERSE proxy server at DMZ layer and it is configured properly. I have tested a simple WCF service by replacing the localhost with Proxy server configured address <DNSName> and it worked absolutely fine. But when I change localhost in my BizTalk schema based published WCF service it is not working and I am getting following error. Really strugling to get it resolved. I wasted a whole 3 days....very upset. Please help me out by giving the detailed step solution. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested URL: /BizTalkServiceInstance/MyService.svc I am surprized why other c# code based WCF services are working fine with reverse proxy settings. Server Error in '/' Application. The resource cannot be found.Is there any special things to consider Biztalk exposed wcf servcie over ssl in IIS cluster with ISA

    Hi Singam :)
    First I would start by browsing any other files (files other than the one from WCF) just to ensure that the reverse-proxy’s redirection rules are set correctly. If you get the same 404 error when you try to access other service/files “through reverse-proxy”,
    then it’s an issue in the redirection rule(s) in reverse-proxy.
    If others are fine i.e. no issue in reverse-proxy setup as such, then try the following for WCF service's web.config file. I have seen this issue in WCF service (not just BizTalk’s artifacts exposed as service in reverse-proxy). Add serviceHostingEnvironment
    config as show with in serviceModel section.
    <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    </system.serviceModel>
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Root element is missing - Response from a WCF service - WCF-Custom adapter

    hi BizTalk experts,
    In the production environment, as soon as the response is getting subscribed by the orchestration, the orchestration instance is getting suspended and the error that shows up in console is 
    "Root element is missing".
    I have checked the actual response message in the console it is a well formed xml. This is happening only for a few responses from the WCF services. A majority of them are getting processed successfully. I have tried getting the parsing the response in a
    pipeline (using custom pipeline component, the production one uses xml receive) and pass it to the orchestration, but it fails giving the same error.
    Thanks in advance.

    Do you have any mapping done on the response message from the WCF service . ?
    If so Better to copy the suspended message coming from the WCF service and validate against the custom response Schema you have created.
    Note : You can try running fiddler tool to check the response from from the web service incase of failure.
    Also try logging the message in the event viewer or any debug tool.
    Thanks
    Abhishek

  • WCF service setup with certificate authentication error

    I have a WCF service setup and I need to use a certificate with it and are getting numerous errors when I attempt to browse it. The 1st error I get is "Security settings for this service require 'Anonymous' Authentication but it is not enabled for
    the IIS application that hosts this service."
    This sounds like a straightforward error message and setting the authentication method in IIS to anonymous resolves being able to browse the service. But I need to use a certificate and setting authentication to anonymous is obviously not right since we
    only want those with the proper certificate to access the service. I have all authentication methods in IIS set to disabled when I get the above error message. I have the SSL settings in IIS for the service set to require a certificate as well. I am using
    IIS 8.5 as well.
    Here is my config file in hoping someone could point me in the correct direction. The service should only work over HTTPS since we are using a certificate and I need the meta data exposed as well hence the mexHttpBinding. I have searched the web but no solution
    is working. Any help is appreciated.
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
    <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <section name="HEALookupProxy.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
    </configSections>
    <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
    </appSettings>
    <system.web>
    <compilation targetFramework="4.5.1" />
    <httpRuntime targetFramework="4.5.1" />
    <authentication mode="None"></authentication>
    </system.web>
    <system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true">
    <baseAddressPrefixFilters >
    <add prefix="https"/>
    </baseAddressPrefixFilters>
    </serviceHostingEnvironment>
    <services>
    <service name="HEALookupProxy.HEALookupService" behaviorConfiguration="HEALookupServiceBehavior">
    <endpoint address="" binding="wsHttpBinding" contract="HEALookupProxy.IHEALookupService" bindingConfiguration="HEALookupConfig" />
    <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
    </service>
    </services>
    <bindings>
    <wsHttpBinding>
    <binding name="HEALookupConfig">
    <security mode="TransportWithMessageCredential">
    <transport clientCredentialType="Certificate"/>
    </security>
    </binding>
    </wsHttpBinding>
    </bindings>
    <behaviors>
    <serviceBehaviors>
    <behavior name="HEALookupServiceBehavior">
    <serviceMetadata httpsGetEnabled="true"/>
    <serviceDebug includeExceptionDetailInFaults="false" />
    <serviceCredentials>
    <serviceCertificate x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My" findValue="certnameremoved" />
    </serviceCredentials>
    </behavior>
    </serviceBehaviors>
    </behaviors>
    </system.serviceModel>
    <system.webServer>
    <modules runAllManagedModulesForAllRequests="true" />
    <!--
    To browse web app root directory during debugging, set the value below to true.
    Set to false before deployment to avoid disclosing web app folder information.
    -->
    <directoryBrowse enabled="false" />
    <security>
    <authorization>
    <remove users="*" roles="" verbs="" />
    <add accessType="Allow" users="user1, user2" />
    </authorization>
    </security>
    </system.webServer>
    </configuration>

    Hi spark29er,
    >>The service should only work over HTTPS since we are using a certificate and I need the meta data exposed as well hence the mexHttpBinding.
    For creating the HTTPS WCF service, first please change the mexHttpBinding to
    mexHttpsBinding as following:
    <endpoint contract="IMetadataExchange" binding="mexHttpsBinding" address="mex" />
    For more information, please try to refer to:
    #Seven simple steps to enable HTTPS on WCF WsHttp bindings:
    http://www.codeproject.com/Articles/36705/simple-steps-to-enable-HTTPS-on-WCF-WsHttp-bindi .
    Then please try to check the following article about how to do the certificate authentication on HTTPS WCF Service:
    http://blogs.msdn.com/b/imayak/archive/2008/09/12/wcf-2-way-ssl-security-using-certificates.aspx .
    Besides, setting the
    includeExceptionDetailInFaults as false can give us more detailed error information.
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Cannot connect to the Service Manager portal WCF service...again

    I've ran into this error a few times now, but I have usually been able to fix it. This time its being more stubborn. 
    This is a brand new 2012 R2 portal running on a brand new SharePoint 2010 SP1 two server farm. The web content server is installed on both of the webservers just like Travis has it in this blog: http://blogs.technet.com/b/servicemanager/archive/2012/05/04/how-to-configure-the-self-service-portal-sharepoint-site-or-the-web-content-server-for-load-balancing.aspx 
    We have it F5 load balanced with a 3rd party cert which is working fine. We get to the site and the app loads, but instead of seeing the only catalog item I have published, I see the red error at the bottom stating that it cannot connect to the WCF service.
    I've double checked all my bindings in IIS and the web.config. When I look in the web server event log I see this:
    System.ServiceModel 3.0.0.0 Event ID 3
    WebHost failed to process a request. Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/37916227 Exception: System.Web.HttpException: The service '/ServiceHost/Services/DataAccessService.svc' does not exist. ---> System.ServiceModel.EndpointNotFoundException: The service '/ServiceHost/Services/DataAccessService.svc' does not exist.   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath)   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()   --- End of inner exception stack trace ---   at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)   at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) Process Name: w3wp Process ID: 3004
    The SMPortalTrace.log isnt being very helpful, but heres a copy of it:
    Error,2014-06-20 13:19:22.8784441,System.Reflection.TargetInvocationException: [Arg_TargetInvocationException]
    Arguments:
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.30214.00&File=mscorlib.dll&Key=Arg_TargetInvocationException ---> System.ServiceModel.CommunicationException: [HttpWebRequest_WebException_RemoteServer]
    Arguments: NotFound
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.30214.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer ---> System.Net.WebException: [HttpWebRequest_WebException_RemoteServer]
    Arguments: NotFound
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.30214.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer ---> System.Net.WebException: [HttpWebRequest_WebException_RemoteServer]
    Arguments: NotFound
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.30214.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer
    at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
    at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassa.<EndGetResponse>b__9(Object sendState)
    at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)
    --- End of inner exception stack trace ---
    at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
    at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
    --- End of inner exception stack trace ---
    at Microsoft.EnterpriseManagement.ServiceManager.Portal.ServiceCatalogSilverlightModule.Models.DataProvider.<>c__DisplayClass1.<FetchAllServiceOfferings>b__0(Object sender, AsyncDataCommandCompletedEventArgs`1 e)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.AsyncDataCommandBase`2.<>c__DisplayClass2.<CompleteCommand>b__0(Object )
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Delegate.DynamicInvokeImpl(Object[] args)
    at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, Boolean useFastPath, Delegate d, Object[] args)
    at System.Windows.Threading.DispatcherSynchronizationContext.Send(SendOrPostCallback d, Object state)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.AsyncDataCommandBase`2.CompleteCommand(Object sender, AsyncDataCommandCompletedEventArgs`1 e)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.AsyncDataCommandBase`2.OnCommandCompleted(Object sender, Exception exception)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.DataGatewayBase.CompleteAsyncDataCommandWithError(AsyncDataCommand command, Exception exception)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.ProxyDataGateway.ProxyExecuteCompletedHandler(Object sender, ExecuteCompletedEventArgs e)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.ProxyDataGateway.<>c__DisplayClass4.<GetClientProxy>b__3(Object sender, ExecuteCompletedEventArgs args)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.Proxy.ServiceReference.DataAccessServiceClient.OnExecuteCompleted(Object state)
    Error,2014-06-20 13:23:12.7295391,System.Reflection.TargetInvocationException: [Arg_TargetInvocationException]
    Arguments:
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.30214.00&File=mscorlib.dll&Key=Arg_TargetInvocationException ---> System.ServiceModel.CommunicationException: [HttpWebRequest_WebException_RemoteServer]
    Arguments: NotFound
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.30214.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer ---> System.Net.WebException: [HttpWebRequest_WebException_RemoteServer]
    Arguments: NotFound
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.30214.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer ---> System.Net.WebException: [HttpWebRequest_WebException_RemoteServer]
    Arguments: NotFound
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.30214.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer
    at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
    at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClassa.<EndGetResponse>b__9(Object sendState)
    at System.Net.Browser.AsyncHelper.<>c__DisplayClass4.<BeginOnUI>b__1(Object sendState)
    --- End of inner exception stack trace ---
    at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
    at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
    at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteGetResponse(IAsyncResult result)
    --- End of inner exception stack trace ---
    at Microsoft.EnterpriseManagement.ServiceManager.Portal.ServiceCatalogSilverlightModule.Models.DataProvider.<>c__DisplayClass1.<FetchAllServiceOfferings>b__0(Object sender, AsyncDataCommandCompletedEventArgs`1 e)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.AsyncDataCommandBase`2.<>c__DisplayClass2.<CompleteCommand>b__0(Object )
    --- End of inner exception stack trace ---
    at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Delegate.DynamicInvokeImpl(Object[] args)
    at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, Boolean useFastPath, Delegate d, Object[] args)
    at System.Windows.Threading.DispatcherSynchronizationContext.Send(SendOrPostCallback d, Object state)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.AsyncDataCommandBase`2.CompleteCommand(Object sender, AsyncDataCommandCompletedEventArgs`1 e)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.AsyncDataCommandBase`2.OnCommandCompleted(Object sender, Exception exception)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.DataGatewayBase.CompleteAsyncDataCommandWithError(AsyncDataCommand command, Exception exception)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.ProxyDataGateway.ProxyExecuteCompletedHandler(Object sender, ExecuteCompletedEventArgs e)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.ProxyDataGateway.<>c__DisplayClass4.<GetClientProxy>b__3(Object sender, ExecuteCompletedEventArgs args)
    at Microsoft.EnterpriseManagement.Presentation.DataAccess.Proxy.ServiceReference.DataAccessServiceClient.OnExecuteCompleted(Object state)
    Any ideas?
    - Get on the floor, do that dinosaur

    For me I can reach it via the direct server name,
    https://Server:444/ServiceHost/Services/DataAccessService.svc works and displays a page
    But it fails when trying to go to the load balanced name:
    https://SelfService.blah.com:444/ServiceHost/Services/DataAccessService.svc Fails
    When I use IE11 and do a network check it shows its getting a 404 error on /ContentHost/ClientBin/ServiceCatalogSilverlightModule.xap.
    Network guys who configured the F5 can't see any network issues blocking the request. The F5 isn't doing SSL offloading, certificate is on the software portal server.

  • Exposing other classes (as well as the EF Model) from a WCF Service?

    Hello,
    I have been following some of the tutorials on the Oracle.Net development centre, such as creating a Data Service for the Entity framework:-
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/EntityFrameworkWCF/WCFEntityFramework.htm
    This is good - However, I have written a number of extra classes as part of my model i.e. buddy classes for data annotations/meta data (for strongly typed views) and various extra classes that contain LINQ statements looking at the EF Entity classes.
    Can anyone explain how I go about moving all my classes to the WCF data service, such as above ?
    I tried to alter the *.svc file (as created in above example like) to include more than one entity, but it's not keen:-
    E.g.
    public class TasService : DataService < TasEntities >  *: DataService < OrganisationService>* //<-- this bit doesn't work
          public static void InitializeService(DataServiceConfiguration config)
                config.SetEntitySetAccessRule("*", EntitySetRights.All);
                config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
    }I can find other example of creating a WCF library and hosting out services with I.P addresses stored in an App.config file, but the above example only stored a web.config file.
    Thus, I have tried created a WCF Data Service and WCF Library, but still cannot successfully expose all my model classes + Entity Framework Model.
    Does anyone have a solid example OR has anyone managed to achieve this task ? Someone must be in the know... please don't hold out on us mere mortals ......
    Thanks,
    Graeme
    Edited by: user4487499 on 21-Apr-2011 03:24
    Edited by: user4487499 on 21-Apr-2011 03:25

    Do you have any mapping done on the response message from the WCF service . ?
    If so Better to copy the suspended message coming from the WCF service and validate against the custom response Schema you have created.
    Note : You can try running fiddler tool to check the response from from the web service incase of failure.
    Also try logging the message in the event viewer or any debug tool.
    Thanks
    Abhishek

  • Error: "Cannot connect to the Service Manager portal WCF service on SSP" SCSM 2012

    I have the SSP installed on a Sharepoint 2010 server.  The web portal is installed on the SCSM 2012 management server.  When opening the SMPortal I get an error message at the bottom
    "Cannot connect to the Service Manager portal WCF service.  Please contact your helpdesk or UT administrator for further help."
    I have manually modified the web.config on the portal for SSL and the Application Settings in Sharepoint IIS per the guidance of others.  I'm able to open the service in a browser.  Assistance is greatly appreciated.

    Http and https is bound on both the content server and the portal. That didn't work. Same error message:
    Cannot connect to the Service Manager portal WCF service. Please contact your helpdesk or IT administrator for further help.
    Here's the IIS log for the content server
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/ServiceCatalogSilverlightModule.xap - 443 - 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 401 2 5 2078
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/ServiceCatalogSilverlightModule.xap - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 140
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/Instrumentation.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 46
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/BaseSilverlightModule.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 31
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/AdvancedResources.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 15
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/DataAccess.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 31
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/Core.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 46
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/BasicResources.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 46
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/BuildConstants.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 15
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/CustomControls.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 31
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/WizardResources.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 46
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.ComponentModel.DataAnnotations.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 15
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/ToolkitResources.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 46
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.Windows.Controls.Data.Input.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 31
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.Windows.Controls.Navigation.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 31
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.ComponentModel.Composition.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 62
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.Windows.Controls.Input.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 31
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.Windows.Controls.Data.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 140
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.Windows.Controls.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 218
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/en/Settings.xml - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 404 0 2 15
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.Windows.Controls.Toolkit.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 218
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.Xml.Serialization.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 234
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.Windows.Data.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 234
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/System.Xml.Linq.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 250
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/en/SilverlightModule_StringResources.resx.xml - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 234
    2012-01-10 21:10:01 X.X.X.X GET /ContentHost/ClientBin/Settings.xml - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 203
    2012-01-10 21:10:20 X.X.X.X POST /ServiceHost/Services/DataAccessService.svc - 443 - 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 401 2 5 17598
    2012-01-10 21:10:28 X.X.X.X POST /ServiceHost/Services/DataAccessService.svc - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 404 0 0 8580
    2012-01-10 21:11:01 X.X.X.X GET /ContentHost/ClientBin/en/Settings.xml - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 404 0 2 0
    2012-01-10 21:11:01 X.X.X.X POST /ServiceHost/Services/DataAccessService.svc - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 404 0 0 203
    2012-01-10 21:11:06 X.X.X.X GET /ContentHost/ClientBin/RequestOfferingSilverlightModule.xap - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 171
    2012-01-10 21:11:06 X.X.X.X GET /ContentHost/ClientBin/FormControls.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 125
    2012-01-10 21:11:06 X.X.X.X GET /ContentHost/ClientBin/en/Settings.xml - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 404 0 2 0
    2012-01-10 21:11:06 X.X.X.X GET /ContentHost/ClientBin/Microsoft.Practices.ServiceLocation.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 234
    2012-01-10 21:11:06 X.X.X.X GET /ContentHost/ClientBin/Microsoft.Practices.Unity.Silverlight.zip - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 304 0 0 234
    2012-01-10 21:11:08 X.X.X.X POST /ServiceHost/Services/DataAccessService.svc - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 404 0 0 203
    2012-01-10 21:12:36 X.X.X.X GET /ContentHost/ClientBin/en/Settings.xml - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 404 0 2 0
    2012-01-10 21:12:37 X.X.X.X POST /ServiceHost/Services/DataAccessService.svc - 443 domain\user 2002:4acb:cb4f:8000:0:5efe:X.X.X.X Mozilla/5.0+(compatible;+MSIE+9.0;+Windows+NT+6.1;+WOW64;+Trident/5.0) 404 0 0 203

  • Same WCF service endpoint to multiple topic/subscriptions

    I have a WCF endpoint that I would like to subscribe to multiple topic/subscriptions with the same interface. 
    Then once it gets to the .svc, route based on the brokered message properties. 
    (This is sort of how we have it set up in Neuron ESB with service connectors). 
    This is so we don’t need a .svc file for every subscription in our setup.
    When I try to add 2 endpoints in the web config, it throws:
    The value could not be added to the collection, as the collection already contains an item of the same type: 'Microsoft.ServiceBus.TransportClientEndpointBehavior'. This collection only supports one instance of each type.
    Here is my config:
    <service
    name ="SBWcfService2.TopicService">
    <endpoint
    name =
    "TopicService"
    listenUri="sb://localservicebus:10354/ServiceBusDefaultNamespace/wcftopic1/Subscriptions/Wcf2Sub"
    address ="sb://localservicebus:10354/ServiceBusDefaultNamespace/wcftopic1"
    binding="netMessagingBinding"
    bindingConfiguration="messagingBinding"
    contract="SBMessage.IMessageTopicContract"
    behaviorConfiguration="endpointBehavior"/>
    <endpoint
    name =
    "TopicService2"
    listenUri="sb://localservicebus:10354/ServiceBusDefaultNamespace/wcftopic2/Subscriptions/Wcf2Sub2"
    address ="sb://localservicebus:10354/ServiceBusDefaultNamespace/wcftopic2"
    binding="netMessagingBinding"
    bindingConfiguration="messagingBinding"
    contract="SBMessage.IMessageTopicContract"
    behaviorConfiguration="endpointBehavior"/>       
    </service>
    So I took out the behaviorConfiguration in 1 of the 2 endpoint configs, this allowed me to hit the endpoint like every other time. 
    When it doesn’t work it gave me a 404 server error saying resource cannot be found. 
    Event viewer shows:
    There was no channel actively listening at 'http://{{ServerName}}/SBWcfService2/TopicService.svc'. This is often caused by an incorrect address URI
    If I change localservicebus to my computer name, I can hit the endpoint without the resource failure, but I can’t receive messages.
    Searching online I couldn’t find much, the below link it the closest I could find with a similar problem:
    http://stackoverflow.com/questions/25668693/system-argumentexception-while-browsing-wcf-service-with-multiple-azure-service
    Any help would be greatly appreciated
    Thanks,
    -Nick N

    This is one way to do it according to Microsoft
    http://azure.microsoft.com/en-us/documentation/articles/service-bus-dotnet-how-to-use-topics-subscriptions/
    The key point is: You don't listen to specific subscription, you listen to the service bus.
    Here is a brief description of key steps
    connectionString to your servicebus
    Endpoint=sb://yourServiceNamespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedSecretValue=yourKey
    Suppose Topics in your servicebus is Topic1
    Suppose Subscriptions to your Topic1 are Sub1, Sub2
    To receive messages from Topic1 for Sub1, Sub2
    SubscriptionClient Client =
        SubscriptionClient.CreateFromConnectionString
                (connectionString, "Topic1", "Sub1"); //or change to Sub2
    Client.Receive();
    // Continuously process messages received from Sub1 (or Sub2) subscription
    while (true)
       BrokeredMessage message = Client.Receive();
       if (message != null)
    The web.config that listens to the topic for subscriptions looks like this
        <services>
          <service name="aaaaa">
            <endpoint address="sb://xxxxx.servicebus.windows.net/yyyyy"
                      behaviorConfiguration="sharedSecretClientCredentials"
                      binding="netTcpRelayBinding"
                      contract="wwwww"/>
          </service>
        </services>
        <behaviors>
          <endpointBehaviors>
            <behavior name="sharedSecretClientCredentials">
              <transportClientEndpointBehavior>
                <tokenProvider>
                  <sharedSecret issuerName="owner" issuerSecret="zzzz"/>
                </tokenProvider>
              </transportClientEndpointBehavior>
            </behavior>
          </endpointBehaviors>
        </behaviors>
    Frank

  • Changing identity under which the WCF service

    Yes second one. I'm asking about changing identity under which the WCF service runs on sever side.
    When add reference to the WCF service, VisualStudio automatically add following lines into the config file:
    <identity>
        <userPrincipalName value="xxx/xxx" />
    </identity>
    If this doesn't match with the identity used sever side, the app will throw exception when running. I tried debug in VisualStudio. It reports:
    An exception of type 'System.ServiceModel.Security.SecurityNegotiationException' occurred in System.ServiceModel.dll but was not handled in user codeAdditional information: SOAP security negotiation with 'http://<host>:<port>/xxx.svc' for target 'http://<host>:<port>/xxx.svc' failed. See inner exception for more details.
    The inner exception is:
    Security Support Provider Interface (SSPI) authentication failed. The server may not be running in an account with identity 'host/<machinename>'. If the server is running in a service account (Network Service for example), specify the account's ServicePrincipalName as the identity in the EndpointAddress for the server. If the server is running in a user account, specify the account's UserPrincipalName as the identity in the EndpointAddress for the server.
    Any idea?

    Yes second one. I'm asking about changing identity under which the WCF service runs on sever side.
    When add reference to the WCF service, VisualStudio automatically add following lines into the config file:
    <identity>
        <userPrincipalName value="xxx/xxx" />
    </identity>
    If this doesn't match with the identity used sever side, the app will throw exception when running. I tried debug in VisualStudio. It reports:
    An exception of type 'System.ServiceModel.Security.SecurityNegotiationException' occurred in System.ServiceModel.dll but was not handled in user codeAdditional information: SOAP security negotiation with 'http://<host>:<port>/xxx.svc' for target 'http://<host>:<port>/xxx.svc' failed. See inner exception for more details.
    The inner exception is:
    Security Support Provider Interface (SSPI) authentication failed. The server may not be running in an account with identity 'host/<machinename>'. If the server is running in a service account (Network Service for example), specify the account's ServicePrincipalName as the identity in the EndpointAddress for the server. If the server is running in a user account, specify the account's UserPrincipalName as the identity in the EndpointAddress for the server.
    Any idea?
    Please open a new thread for your second question.
    I sale myself ONLY half CNY!

  • How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file?

    How can we send only one message to a WCF service at a time? How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file? Can we do it by Host throttling?

    Hi Pawan,
    You need to use WCF-Custom adapter and add the ServiceThrottlingBehavior service behavior to a WCF-Custom Locations.
    ServiceThrottlingBehavior.MaxConcurrentCalls - Gets or sets a value that specifies the maximum number of messages actively processing across a ServiceHost. The MaxConcurrentCalls property specifies the maximum number of messages actively
    processing across a ServiceHost object. Each channel can have one pending message that does not count against the value of MaxConcurrentCalls until WCF begins to process it.
    Follow MSDN-
    http://msdn.microsoft.com/en-us/library/ee377035%28BTS.10%29.aspx
    http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentcalls.aspx
    I hope this helps.
    Rachit
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Consuming Orchestration Exposed WCF service On remote system.

    Hello All ,  I am new to BizTalk, so bear with me 
    I have created an orchestration for Insert operation to DB and Exposed it as WCF service, finally deployed in IIS fine.
    but whenever I am trying browse wsdl of service its prompting as : Network Error (dns_unresolved_hostname)  
     Your requested host "DomainName" could not be resolved by DNS.
    url : http://domainName/Biztalk_PaymentTransaction_Process_PaymentTransaction_Port_RcvTransaction.svc?singleWsdl .
    I just replaced that domainName and put IP there I am able to browse my service, worked fine on Local system.
    but while trying with same url replacing domainname with
    IP on remote system, its throwing Exception as below
    There was no endpoint listening at http://DomainName/Biztalk_PaymentTransaction_Process_PaymentTransaction_Port_RcvTransaction.svc
    that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
    please Explain what I need to do to resolve this,
    Do I'm missing something or what extra I need to DO...
    Thanks to all.

    Associate the domain name and the IP of the server where the service is hosted in the host file.
    Goto the server where the service is hosted.
    Goto the server’s host file in %SystemRoot%\system32\drivers\etc\hosts
    Take a backup of the host file before you edit it.
    Add the following entry as the last line in the host file, replacing in it with the actual IP Domain name.
    xxx.xxx.xxx.xxx YourdomainName.com
    where xxx.xxx.xxx.xxx = IP and YourdomainName.com = domain name
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Error while creating an external content type using wcf service.

    Hi!
      I have been asked to create a wcf service to expose sql data and populate them in a list using external content type.i have created the service but while creating the content type it gives me error. Can anyone suggest me about which url should
    be used in service metadata url and service endpoint url.
    Thanks in advance.

    You can refer these links, may be helpful
    https://msdn.microsoft.com/en-us/library/office/jj163810.aspx
    https://msdn.microsoft.com/en-us/library/office/gg318615(v=office.14).aspx
    http://www.dotnetcurry.com/showarticle.aspx?ID=799
    http://www.c-sharpcorner.com/UploadFile/Roji.Joy/connecting-to-a-web-service-using-business-connectivity-serv/
    Thanks
    Ganesh Jat [My Blog |
    LinkedIn | Twitter ]
    Please click 'Mark As Answer' if a post solves your problem or 'Vote As Helpful' if it was useful.

  • No transport error while consuming WCF service in a REST way

    Hi,
    Here is a small article on when we usually face No Transport error and how to get rid of it.
    I recently worked on a sample application using “app for Office” (New in Visual Studio 11.0)
    What is “app for Office”?
    An app for Office is basically a webpage that is hosted inside an Office client application. You can use apps to extend the functionality of a document, email message, meeting request, or appointment. Apps
    can run in multiple environments and clients, including rich Office desktop clients, Office Web Apps, mobile browsers, and also on-premises and in the cloud.
    What can an app for Office do?
    An app for Office can do pretty much anything a webpage can do inside the browser, such as the following:
    Provide an interactive UI and custom logic through      JavaScript. (Develop UI using HTML and JavaScript)
    Use JavaScript frameworks such as jQuery.
    Connect to REST endpoints and web services via      HTTP and AJAX.
    Run server-side code or logic, if the page is      implemented using a server-side scripting language such as ASP or PHP.
    As “app for Office” doesn’t have an option to write server side scripting (unlike code behind or in-line coding feature in ASP.NET/MVC) we will have to go for web service or WCF service and consume the service
    using any JavaScript framework like Jquery.
    I wrote a simple WCF service to hook up with server side code and consumed the service using Jquery as follows
    $(document).ready(function () {
    $.ajax({
    type: "GET",
    url: "http://localhost/MyService.svc/rh/data?id=" + $('#sampleType').val(),
    processData: false,
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    crossDomain: true,
    success: function (data) {
    alert(data)
    error: function (xhr, status, error) {
    alert(error);
    I encountered an error saying “No Transport” when I executed the client application.
     I did some investigation on this and found out the root cause that cross-domain request was disabled. But I was really not sure whether it was at my WCF service end or “app for Office” client end. I added
    Client Access policy and Cross-domain-policy xml files to WCF service in order to enable cross-domain request 
    so that service will accept any type requests sent form different domains.
    Client Access policy
    <?xml version="1.0" encoding="utf-8" ?>
    <access-policy>
    <cross-domain-access>
    <policy>
    <allow-from http-request-headers="*">
    <domain uri="*"/>
    </allow-from>
    <grant-to>
    <resource include-subpaths="true" path="/"/>
    </grant-to>
    </policy>
    </cross-domain-access>
    </access-policy>
    Cross-domain-policy
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <allow-http-request-headers-from domain="*" headers="*"/>
    </cross-domain-policy>
    Both the policies should be in different XML files
    But this didn’t solve my problem. After a little bit more investigation I found exactly where and how to enable-cross domain requests.
    Solution
    We need to enable cross-domain requests in environments that do not support cross-domain requests.
    “Cors is equal to true if a browser can create an XMLHttpRequest object and if thatXMLHttpRequest
    object has a withCredentials property. To enable cross-domain requests in environments that do not support cors yet but do allow cross-domain XHRrequests (windows gadget, etc), set $.support.cors = true;”
    You just have to add jQuery.support.cors = true; in your client scripting and it works perfectly fine.
    [Cors- Cross-Origin Resource Sharing]
    A simple example:
    $.support.cors = true;
    $(document).ready(function () {
    $.ajax({
    type: "GET",
    url: "http://localhost/MyService.svc/rh/data?id=" + $('#sampleType').val(),
    processData: false,
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    crossDomain: true,
    success: function (data) {
    alert(data)
    error: function (xhr, status, error) {
    alert(error);
    Hope this will be helpful.
    Thanks

    This is very good technich to resolve the problem. but this is not working in Google chrome or Firfox . can any one help me.

Maybe you are looking for