none
Endpoint exception while consuming WCF in SSIS script task. RRS feed

  • Question

  • I created a sample WCF and tried consuming it in the same solution in a different project. It worked fine in the same project. Now, I tried consuming the WCF in script component of WCF as a source. Script task compilation is success. But I am getting error when I am trying to run the script task in SSIS. I have hosted the service in IIS in both the cases. I am getting the below error in SSIS while executing the script task. I tried consuming it in a console application too. I worked fine there.

    [Script Component [2]] Error: System.InvalidOperationException: Could not find default endpoint element that references contract 'ServiceReference1.IService1' 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 contract could be found in the client element.
       at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.HandleUserException(Exception e)
       at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PrimeOutput(Int32 outputs, Int32[] outputIDs, PipelineBuffer[] buffers)
       at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostPrimeOutput(IDTSManagedComponentWrapper100 wrapper, Int32 outputs, Int32[] outputIDs, IDTSBuffer100[] buffers, IntPtr ppBufferWirePacket)

    Web.Config in the project where I have created WCF

    <service name="WcfService1.Service1" behaviorConfiguration="mexBehavior">
     <endpoint address="Service1" binding="basicHttpBinding" contract="WcfService1.IService1">          
     </endpoint>       
    <host>
    <baseAddresses>
    <add baseAddress="http://localhost:8080/"/>
    </baseAddresses>
    </host>
    </service>

    App.config in the SSIS script task.

     <system.serviceModel>
     <bindings>
     <basicHttpBinding>
    <binding name="BasicHttpBinding_IService1" />
    </basicHttpBinding>
    </bindings>
    <client>
    <endpoint address="http://localhost/WCFTest/Service1.svc/Service1"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
    contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
    </client>
    </system.serviceModel>

    Please help me with the issue. I am not able to figure out where the problem is.

    Tuesday, November 18, 2014 6:58 AM

Answers

  • Hi,

    For this scenario, first you need make sure the name in the contract attribute of the endpoint is the same as you’re Microsoft Visual Studio Service Reference name.

    http://www.roelvanlisdonk.nl/?p=735

    Besides, the client endpoint address should be the specified WCF service url, which means that the address property should be:

    <client>
    
    <endpoint address="http://localhost/WCFTest/Service1.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
    contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
    </client>
    

    Regards

    Wednesday, November 19, 2014 3:21 AM
    Moderator

All replies

  • Hello SujeethKumar,

    Your configuration looks good so my guess is the app.config is not being picked up.

    Take a look at this post .  My opinion is it is often simpler to set the binding and address in code rather than from configuration when dealing with platform like SSIS or BizTalk.  Take a look at this post.


    Jeff

    Tuesday, November 18, 2014 9:52 PM
  • Hi,

    For this scenario, first you need make sure the name in the contract attribute of the endpoint is the same as you’re Microsoft Visual Studio Service Reference name.

    http://www.roelvanlisdonk.nl/?p=735

    Besides, the client endpoint address should be the specified WCF service url, which means that the address property should be:

    <client>
    
    <endpoint address="http://localhost/WCFTest/Service1.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
    contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
    </client>
    

    Regards

    Wednesday, November 19, 2014 3:21 AM
    Moderator
  • So I am in the same boat as Sujeeth. However in my case the WCF consumption is wrapped into a separate assembly. I am referencing the assembly in an embedded C# script within my SSIS package.

    When I make the helper class call to the webservice , I get the exact same error. 

    Keep in mind I am running this from VS 2012 IDE and did the following to make sure the WCF call works:

    1. Googled and found that you need to have config entries in DtsDebugHost.exe.config file. But it still did not work

    2. Had the same entries in the associated app.config file for C# script but it still did not work.

    It seems like SSIS is very fragile w.r.t consuming WCF entires in a config file.

    Attached is the current config entries:

    <configuration>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="ITransactionProcessor">
              <security mode="TransportWithMessageCredential" />
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor" binding="basicHttpBinding" bindingConfiguration="ITransactionProcessor" contract="CyberSource.ITransactionProcessor" name="portXML" />
        </client>
      </system.serviceModel>
    Any perspective from anyone??


    SM

    Friday, December 12, 2014 5:56 PM