Note that there are some explanatory texts on larger screens.

plurals
  1. POException has been thrown by the target of an invocation
    primarykey
    data
    text
    <p>I want create dynamic WCF service channel in VS-2010 using ChannelFactory as follows.</p> <p>I have one WCF service which is calling another WCF service using ChannelFactory as follows,</p> <pre><code>BasicHttpBinding myBinding = new BasicHttpBinding(); EndpointAddress myEndpoint = new EndpointAddress(_endpointConfigurationName); using (ChannelFactory&lt;IService&gt; factory = new ChannelFactory&lt; IService &gt;(myBinding)) { factory.Open(); object[] parameters = new object[1]; parameters[0] = _documentId; IService proxy = factory.CreateChannel(myEndpoint); if (proxy == null) return; MethodInfo mi = proxy.GetType().GetMethod("DoExecute"); if (mi == null) return; var serviceResult = mi.Invoke(proxy, parameters); factory.Close(); } </code></pre> <p>“Web.config” file of called service as follows,</p> <pre><code>&lt;services&gt; &lt;service name="IService.Service"&gt; &lt;endpoint address="ws" binding="wsHttpBinding" name="wsHttpBinding_IFTPUploaderService" contract="Service.IService "&gt; &lt;identity&gt; &lt;dns value="localhost" /&gt; &lt;/identity&gt; &lt;/endpoint&gt; &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="http://localhost:8752/Service/" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;/service&gt; &lt;/services&gt; </code></pre> <p>factory and proxy is working fine but when “Invoke” method is executed it gives error as follows</p> <p>There was no endpoint listening at <code>http://localhost:81/IService.Service.svc?wsdl</code> that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details</p> <p><strong>Server stack trace</strong>: </p> <pre><code>at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) </code></pre> <p><strong>Exception rethrown at [0]</strong>: </p> <pre><code>at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type) at SchedulerService.Service.IService.DoExecute(String id) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload