locked
WCF service works with WCF Test Client but not with WP7 app RRS feed

  • Question

  • Hello,

    I've been trying to figure out what is wrong with my WCF configuration files for days now wihtout a solution....I need your help! :)
    I have a WCF in a server being hosted through IIS. The Web Service works fine from the WCF Test Client...I can use every function and returns the wanted result without a problem.. But when I try to use it from my WP7 App I get the following exception:

    "There was no endpoint listening at http://server ip address/tradenowServicio/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details."

    *********************** HERE IS MY WP7 CONFIG FILE (CLIENT): ******************************


    ?xml version="1.0" ?>
    configuration>
    system.serviceModel>
    bindings>
    basicHttpBinding>
    binding name="BasicHttpBinding_IService1" maxBufferSize="2147483647"
    maxReceivedMessageSize="2147483647">
    security mode="None" />
    /binding>
    /basicHttpBinding>
    /bindings>


    client>
    endpoint address="http://server ip address/tradenowServicio/Service1.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
    contract="ServiceReference1.IService1" name="BasicHttpBinding_IService1" />
    /client>

    /system.serviceModel>
    /configuration>


    ****************************** HERE IS MY SERVER WEB CONFIG FILE: **********************************


    ?xml version="1.0" encoding="utf-8"?>
    configuration>
    system.web>
    compilation debug="true" targetFramework="4.0">
    assemblies>
    add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    /assemblies>
    /compilation>
    pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
    /system.web>


    system.serviceModel>
    serviceHostingEnvironment>
    serviceActivations>
    add relativeAddress="Service1.svc" service="TradeNowWCF.Service1" />

    /serviceActivations>
    /serviceHostingEnvironment>

    bindings>
    basicHttpBinding>

    binding name="tradenowBasicHttpBinding" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647">
    readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647"

    maxStringContentLength="2147483647" /> /binding>

    /basicHttpBinding>
    /bindings>

    services>

    service name="TradeNowWCF.Service1" behaviorConfiguration="tradenowBehavior">
    endpoint binding="basicHttpBinding" bindingConfiguration="tradenowBasicHttpBinding"
    contract="TradeNowWCF.IService1" />
    endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

    /service>
    /services>

    behaviors>
    serviceBehaviors>
    behavior name="tradenowBehavior">
    serviceDebug includeExceptionDetailInFaults="True" httpHelpPageEnabled="True" />
    serviceMetadata httpGetEnabled="True" />
    dataContractSerializer maxItemsInObjectGraph="2147483647" />

    /behavior>
    /serviceBehaviors>
    /behaviors>
    /system.serviceModel>

    system.webServer>
    modules runAllManagedModulesForAllRequests="true"> /modules>
    /system.webServer>
    connectionStrings>
    add name="tradenowEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection
    string="Data Source=server ip address\tradenowexpress;Initial Catalog=tradenow;User ID=username;Password=password;MultipleActiveResultSets=True""
    providerName="System.Data.EntityClient" />
    /connectionStrings>
    /configuration>


    ****************************** Can someone review my Config files and let me know what I'm missing?? Thank you!!! :) *****************************************




    ******************************** For your reference here is the WCF Test Client config file, in case it may be of any help: ******************************************


    ?xml version="1.0" encoding="utf-8"?>
    configuration>
    system.serviceModel>
    bindings>
    basicHttpBinding>
    binding name="BasicHttpBinding_IService1" 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://server ip address/tradenowServicio/Service1.svc"
    binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1"
    contract="IService1" name="BasicHttpBinding_IService1" />
    /client>
    /system.serviceModel>
    /configuration>
    Sunday, September 4, 2011 8:36 PM