I'm trying to call a WCF Webservice, from a dll I have made, running inside our CAD Software. I cannot get it to work though.
When I try to establish my proxy, I get the following error:
Could not find endpoint element with name 'BasicHttpBinding_IAxaptaService' and contract 'AxaptaProxy.IAxaptaService' 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 name could be found in the client element.
I have searched around abit, and I assume the problem is due to my DLL running inside another program. There was some articles about copying EndPoint configuration from the app, to the service, but I didn't quite catch, what I was supposed to do.
Anyone have an idea, as to how I can make this work?
The App.Config, created by my client is this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAxaptaService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:4726/LM/AxaptaService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAxaptaService"
contract="AxaptaProxy.IAxaptaService" name="BasicHttpBinding_IAxaptaService" />
</client>
</system.serviceModel>
</configuration>
I have tried to merge this into my web.config, on the site that hosts the web-service, as this:
<system.serviceModel>
<bindings>
<customBinding>
<binding name="GetStream.customBinding0">
<binaryMessageEncoding/>
<httpTransport/>
</binding>
</customBinding>
<basicHttpBinding>
<binding name="BasicHttpBinding_IAxaptaService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="AutoCompletionAspNetAjaxBehavior">
<enableWebScript/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
<services>
<service name="AutoCompletion">
<endpoint address="" behaviorConfiguration="AutoCompletionAspNetAjaxBehavior" binding="webHttpBinding" contract="AutoCompletion"/>
</service>
<service name="GetStream">
<endpoint address="" binding="customBinding" bindingConfiguration="GetStream.customBinding0" contract="GetStream"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<client>
<endpoint address="http://localhost:4726/LM/AxaptaService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAxaptaService"
contract="AxaptaProxy.IAxaptaService" name="BasicHttpBinding_IAxaptaService" />
</client>
</system.serviceModel>
There are a couple of other stuff in there already. I can remove them, if that makes it easier. I've left them in, incase they have some influence on it.
So I tested the service, from a stand-alone winform application, and it works fine. Could it be because of the App.config? Does my config get loaded, for the .dll?