Tuesday, 27 November 2012

BizTalk: Publishing Schema as WCF Endpoint Error


While working with Schema published as WCF service, after publishing schema as WCF endpoint when I tried to consume the service in client application I got the following error
“There was a failure executing the receive pipeline: "Custom.XmlReceive, Custom.BT.Pipelines, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bf32dc0ac0a61497" Source: "ConsumConfig" Receive Port: "" URI: "/Custom/Test.svc" Reason: Could not find default endpoint element that references contract 'TrimProxy.ITriming' 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”
My process flow is as follow
WCF service (Schema Endpoint) hosted on IIS server, calling BizTalk application. I was using some custom pipeline component for XMLReceive, This custom pipeline component was consuming few services, endpoint defined in  BTSNTSvc.exe.config file.
Now I got this error as my WCF Service is not able to find service endpoint setting used for Pipeline component, which is defined in BTSNTSvc.exe.config file.
Now question is “Why my WCF service is not able to read my   BTSNTSvc.exe.config file setting required for custom pipeline component?”
Answer:
As BizTalk uses two different Host process
·         BizTalkServerApplication : this host is used by all BizTalk application , This process read all required config setting from BTSNTSvc.exe.config
·         BizTalkServerIsolatedHost: All web/wcf service use this host, Know only web.config file.
As the WCF service which we have published run under BizTalkServerIsolatedHost ,This process read all configuration setting from local web.config file, When I tried to consume the published endpoint at run time it gave me above specified error, as the service is not able to find Endpoint setting required for Custom Pipeline component. And hence throw an error related to endpoint.
Solution for Error:
Just copy your required configuration setting from BTSNTSvc.exe.config and put it in Web.Config file of WCF service (IIS Virtual Directory).This will resolve your issue.

No comments:

Post a Comment