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();
As you mentioned that the WCF service didn't return data for remote client. What's the exact behavior, it timeout or return an error? I think we need to figure out the exact error (network or service code/config specific). I'd suggest you try using fiddler
to watch the HTTP request on the remote client machine to see whether it did correctly send out and reach the server and what is the raw HTTP response it get(for the response).
For server-side, the WCF service trace is what you can enabled in case there is any error occured in the service code(though I think the problem here tend to be network related)
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
HostingASPNe...
All-Star
15882 Points
2977 Posts
Re: Not getting response after hosting on IIS 7.0
Feb 23, 2012 05:18 AM|LINK
Hello,
Can you access the service by tyting your IP - 206.120.193.39? Make sure to enable external connections on port 57296 in your firewall settings.
Regards
Free ASP.NET Examples and source code.
Afreen_IT
Member
30 Points
67 Posts
Re: Not getting response after hosting on IIS 7.0
Feb 23, 2012 06:03 AM|LINK
Thanks for the respnse.
Yes I am able to access the service by the URL.
How can I enable for external connections?
Regards,
Afreen
Topspy
Contributor
3785 Points
806 Posts
Re: Not getting response after hosting on IIS 7.0
Feb 24, 2012 05:43 AM|LINK
There would be a place to edit from your firewall. Just check around or read the official docs.
Asp.net Hosting | Windows Hosting | SQL Server Hosting
Steven Cheng...
Contributor
4199 Points
548 Posts
Microsoft
Moderator
Re: Not getting response after hosting on IIS 7.0
Feb 28, 2012 12:04 PM|LINK
Hi Afreen,
As you mentioned that the WCF service didn't return data for remote client. What's the exact behavior, it timeout or return an error? I think we need to figure out the exact error (network or service code/config specific). I'd suggest you try using fiddler to watch the HTTP request on the remote client machine to see whether it did correctly send out and reach the server and what is the raw HTTP response it get(for the response).
#Fiddler2 - Installation Information
http://www.fiddler2.com/fiddler2/version.asp
For server-side, the WCF service trace is what you can enabled in case there is any error occured in the service code(though I think the problem here tend to be network related)
#Service Trace Viewer Tool (SvcTraceViewer.exe)
http://msdn.microsoft.com/en-us/library/ms732023.aspx
Feedback to us
Microsoft One Code Framework