locked
SSIS Script Component destinantion to WCF service RRS feed

  • Question

  • Hi

    I have been struggling to find a sensible answert to this issue.

    Using VS2008, we have a package attempting to use a WCF service which has some basic functionality to post user notes to a table.  The service has been proven to work outside of the SSIS call.

    When calling in a script component destination the below error is received.  Any direction would be appreciated.  So far we have tried various changes to the app.config, including fully qualifying the contract name.

    Could not find default endpoint element that references contract 'DataService.VanquisDataService' 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 System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)

    at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)

    at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)

    at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName)

    at System.ServiceModel.EndpointTrait`1.CreateSimplexFactory()

    at System.ServiceModel.EndpointTrait`1.CreateChannelFactory()

    at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)

    at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()

    at System.ServiceModel.ClientBase`1..ctor()

    at SC_51f3bcd084854b96b8cd4e20323a03d1.csproj.DataService.VanquisDataServiceClient..ctor()

    at ScriptMain.Input0_ProcessInputRow(Input0Buffer Row)

    at UserComponent.Input0_ProcessInput(Input0Buffer Buffer)

    at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.ProcessInput(Int32 inputID, PipelineBuffer buffer)

    Thursday, November 11, 2010 2:51 PM

Answers

  • Hi parody1,

    Based on the error "Could not find default endpoint element that references contract 'DataService.VanquisDataService' 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." and the callstack, the issue is caused by the service binding is invalid.

    To solve the issue, please follow these steps:

    1. Open the script in code designer mode.
    2. In the Project Explorer, please open the app.config.
    3. Check the binding settings. Below is a sample for your reference:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <bindings>
          <wsHttpBinding>
            <binding name="WSHttpBinding_IService1" 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="65536"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
              <security mode="Message">
                <transport clientCredentialType="Windows" proxyCredentialType="None"
                  realm="">
                  <extendedProtectionPolicy policyEnforcement="Never" />
                </transport>
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" establishSecurityContext="true" />
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://server:10000/Service1.svc"
            binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1"
            contract="ServiceReference2.IService1" name="WSHttpBinding_IService1">
            <identity>
              <dns value="localhost" />
            </identity>
          </endpoint>
        </client>
      </system.serviceModel>
    </configuration>
    

    Additionally, please test the service in Visual Studio, make sure the service works fine.

    For more information about invoking WCF service in Script Component, please see:
    http://blogs.msdn.com/b/dbrowne/archive/2010/07/08/how-to-configure-an-ssis-package-to-access-a-web-service-using-wcf.aspx

    If you have any more questions, please feel free to ask.

    Thanks,
    Jin Chen


    Jin Chen - MSFT
    • Proposed as answer by Todd McDermid Thursday, November 18, 2010 3:42 PM
    • Marked as answer by Raymond-Lee Monday, November 22, 2010 2:23 AM
    Friday, November 12, 2010 9:46 AM

All replies

  • Check your web.config (of the web service). It must have an incorrect entry in it.
    Arthur My Blog
    By: TwitterButtons.com
    Thursday, November 11, 2010 2:59 PM
  • The service works fine when called outside of SSIS, so I doubt its web.config has any issues?  If so can you elaborate?

    We have this working from SSIS using a .net 2 web reference, but get this error when using a .net 3.5 service reference in the script component.

    Thursday, November 11, 2010 4:38 PM
  • Hi parody1,

    Based on the error "Could not find default endpoint element that references contract 'DataService.VanquisDataService' 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." and the callstack, the issue is caused by the service binding is invalid.

    To solve the issue, please follow these steps:

    1. Open the script in code designer mode.
    2. In the Project Explorer, please open the app.config.
    3. Check the binding settings. Below is a sample for your reference:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.serviceModel>
        <bindings>
          <wsHttpBinding>
            <binding name="WSHttpBinding_IService1" 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="65536"
              messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
              allowCookies="false">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <reliableSession ordered="true" inactivityTimeout="00:10:00"
                enabled="false" />
              <security mode="Message">
                <transport clientCredentialType="Windows" proxyCredentialType="None"
                  realm="">
                  <extendedProtectionPolicy policyEnforcement="Never" />
                </transport>
                <message clientCredentialType="Windows" negotiateServiceCredential="true"
                  algorithmSuite="Default" establishSecurityContext="true" />
              </security>
            </binding>
          </wsHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://server:10000/Service1.svc"
            binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1"
            contract="ServiceReference2.IService1" name="WSHttpBinding_IService1">
            <identity>
              <dns value="localhost" />
            </identity>
          </endpoint>
        </client>
      </system.serviceModel>
    </configuration>
    

    Additionally, please test the service in Visual Studio, make sure the service works fine.

    For more information about invoking WCF service in Script Component, please see:
    http://blogs.msdn.com/b/dbrowne/archive/2010/07/08/how-to-configure-an-ssis-package-to-access-a-web-service-using-wcf.aspx

    If you have any more questions, please feel free to ask.

    Thanks,
    Jin Chen


    Jin Chen - MSFT
    • Proposed as answer by Todd McDermid Thursday, November 18, 2010 3:42 PM
    • Marked as answer by Raymond-Lee Monday, November 22, 2010 2:23 AM
    Friday, November 12, 2010 9:46 AM
  • Thanks Jin, The app.config looks correct, however the link you provided includes some code in the pre-execute which we do not have.

    I will take a look at this next week and get back.

    Friday, November 12, 2010 4:11 PM
  • Jin, looking at your example I am not sure how Script Component works for me. I created a temp table with the exact cols that needs to be passed to WCF Service as XML string but don't see how to do that ??

    Any help is appreciated.

    Tuesday, December 4, 2012 11:27 PM
  • tomsbenefits, consider making your own post that also describes in more details what exactly is an issue

    Arthur My Blog

    Wednesday, December 5, 2012 4:37 PM
  • Actually I did but found this thread since I was not getting an answer for mine. I am totally new to SSIS and i am trying to accomplish the following.

    1. I created a table via a SP with the exact cols I need to feed a WCF Service.
    2. Feed the table into a 'For Each Loop' and somehow invoke the WCF Service and pass the cols from the above table as variables.
    3. I found some blogs indicating to do this via Script Component but unable to find any examples.

    Thank you and any help is appreciated.

    Wednesday, December 5, 2012 6:52 PM