views:

18

answers:

1

Hello, I am trying to consume an ASMX web service from my WCF service. Here is what I did and i get the following error. "There was no endpoint listening at "http://... " that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

Please help me. Where I am doing wrong? What I am missing?

I created a WCF Service Library and added a reference to the ASMX web service with the help of the WSDL file provided to me.

  namespace WCFClueClient
{
        public class Service1 : IService1
    {
        public string GetData(string value)
        {
         ClueClientServiceReference.InteractiveOrderHandlerClient client = new WCFClueClient.ClueClientServiceReference.InteractiveOrderHandlerClient();
            string response = client.handleInteractiveOrder(value);
            return string.Format("You entered: {0}", response);
        }

           }   

I have a console application which has refernce to my WCF service

  namespace CLUE
{
    class Program
    {
        static void Main(string[] args)
        {

            CLUETestServiceReference.Service1Client client = new CLUE.CLUETestServiceReference.Service1Client();

           string response =  client.GetData("JOHN DOE");

                }
    }
}
  

my app.config file

 <system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="InteractiveOrderHandlerBinding" 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>
  <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="" />
        <message clientCredentialType="Windows" negotiateServiceCredential="true"
          algorithmSuite="Default" establishSecurityContext="true" />
      </security>
    </binding>
  </wsHttpBinding>
</bindings>
<client>
  <endpoint address="http://alalppnc079.choicepoint.net:8280/CPRules-rfCommunicationEJB/InteractiveOrderHandlerURI"
    binding="basicHttpBinding" bindingConfiguration="InteractiveOrderHandlerBinding"
    contract="ClueClientServiceReference.InteractiveOrderHandler"
    name="InteractiveOrderHandlerPort" />
  <endpoint address="http://localhost:8731/Design_Time_Addresses/WCFClueClient/Service1/"
    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService1"
    contract="WCFCLUETEstServiceReference.IService1" name="WSHttpBinding_IService1">
    <identity>
      <dns value="localhost" />
    </identity>
  </endpoint>
</client>
<services>
  <service name="WCFClueClient.Service1" behaviorConfiguration="WCFClueClient.Service1Behavior">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8731/Design_Time_Addresses/WCFClueClient/Service1/"   />
      </baseAddresses>
    </host>
    <!-- Service Endpoints -->
    <!-- Unless fully qualified, address is relative to base address supplied above -->
    <endpoint address=""  binding="wsHttpBinding" contract="WCFClueClient.IService1">
      <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.
      -->
      <identity>
        <dns value="localhost"/>
      </identity>
    </endpoint>
    <!-- Metadata Endpoints -->
    <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> 
    <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="WCFClueClient.Service1Behavior">
      <!-- To avoid disclosing metadata information, 
      set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="True"/>
      <!-- To receive exception details in faults for debugging purposes, 
      set the value below to true.  Set to false before deployment 
      to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>
</behaviors>

A: 

Hey, in this post there is a cool explanation of that problem:Stackoverflow post

And if you don't get the trouble ... just press F5 on your solution and standup the website ... then go to your console app build file (inside debug folder) and execute the .exe. It seems that you are trying to work with your webservice host and client at the same debugger.

Hope it helps!

Darkxes
Hi Darkxes,Thank you. I tried as you said. But my commad prompt gets closed immediately after I enter the input.
BumbleBee
Here is what i am doing in my console WCFServiceReference.Service1Client client = new CLUE.WCFServiceReference.Service1Client(); Console.WriteLine("Enter the name :"); string name = Console.ReadLine(); Console.WriteLine(client.GetData(name)); Console.Read();
BumbleBee
Darkxes, Could you please help me to resolve this problem. I need to get it done ASAP. Thanks
BumbleBee