I have hosted a WCF service on IIS 7.0 for the following URL http://localhost:57296/ApplicationDataService.svc. I am able to access it from IE and also able to browse the WSDL from IE.
I have created a client for the same service and called exposed method.
************* Client Code *******************
ServiceReference4.ApplicationDataServiceClient client = new ServiceReference4.ApplicationDataServiceClient();
Afreen_IT
Member
30 Points
67 Posts
Not getting response after hosting on IIS 7.0
Feb 23, 2012 03:46 AM|LINK
Hi,
I have hosted a WCF service on IIS 7.0 for the following URL http://localhost:57296/ApplicationDataService.svc. I am able to access it from IE and also able to browse the WSDL from IE.
I have created a client for the same service and called exposed method.
************* Client Code *******************
ServiceReference4.ApplicationDataServiceClient client = new ServiceReference4.ApplicationDataServiceClient();
client.Open();
ServiceReference4.getApplicationResponseData[] arr;
arr = client.GetApplicationData(ServiceReference4.applicationNames.SLS, System.DateTime.Now, 15);
******************************************
************ Web.Config code ***************
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceTypeBehaviors">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ApplicationDataService" closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:20:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" algorithmSuite="Default"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="ApplicationDataService.ApplicationDataService" behaviorConfiguration="MyServiceTypeBehaviors">
<endpoint address="http://localhost:57296/ApplicationDataService.svc" binding="basicHttpBinding" contract="IApplicationDataService">
<identity>
<dns value="206.120.193.39:57296"/>
<!--<dns value="localhost"/>-->
</identity>
</endpoint>
<!--<endpoint address="" binding="basicHttpBinding" contract="IApplicationDataService">
</endpoint>-->
<endpoint address="mex" binding="mexHttpBinding" name="ApplicationDataService_Meta" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="http://206.120.193.39:57296/" />
</baseAddresses>
</host>
</service>
<service name="ApplicationDataService.ApplicationDataService1" behaviorConfiguration="MyServiceTypeBehaviors">
<endpoint contract="IApplicationDataService" binding="mexHttpBinding" address="mex"/>
</service>
</services>
</system.serviceModel>
**********************************************************
Everything went well, no error, but its not giving the response.
I tried the same thing by creating the client in the same solution and it is working fine and giving the perfect reponse in arr.
I dont know what I did wrong in hosting the service.
Can anyone please help me in sorting the problem.
Thanks in advance.
Regards,
Afreen