I'm currently experiencing an issue using WCF streaming to return a large set of serialized objects over the internet while hosted through IIS. I'm not sure if it is a network issue or a WCF issue, but the symptoms are hard for me to justify as network issues, as I'll describe below.
The objects are a variety of different objects sent over the one stream, most of which are small but there are also jpegs in there which range from 10k->500k per object. The different cases that I can't really reconcile are:
If we run it over our internal network it works perfectly, even if we increase the data transferred 10-fold higher than the real case so we're sending gigabytes of data.
If we run it on the servers hosting the solution we get an error (detailed below) after a few minutes and a few hundred megabytes transferred.
If we run it on the servers but remove the photos (Sending only the other data) it succeeds and sends roughly 40mb over a longer time period than the failure takes (The longer time is because it takes longer to process the other data, so that's expected).
We have tested simply downloading a 1GB file off the webserver (Significantly more than any of the tests other than the ones we tried on our local network) and it succeeded multiple times without issue.
The error we receive client-side is (Note: We went nowhere near the 3 hour timeout we have set):
System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. --->
System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '03:00:00'. --->
System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. --->
System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
And server-side we see:
System.ServiceModel.CommunicationException,
System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 The remote host closed the connection. The error code is 0x80070016.
The WCF binding setup is (With a little anonymizing):
<system.serviceModel>
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix="http://anonymous"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<bindings>
<basicHttpBinding>
<binding name="StreamedHttpBindingConfig" transferMode="StreamedResponse" maxReceivedMessageSize="2147483647" maxBufferSize="8388608" sendTimeout="01:00:00">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" maxDepth="2147483647" />
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="wsHttpBindingBehaviour" name="AnonymousName">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="StreamedHttpBindingConfig" name="wsHttpBinaryBindingEndpoint" contract="Service.IAnonymous" />
<endpoint address="mex" binding="mexHttpBinding" name="mexHttpBindingEndpoint" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://anonymous/Service" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="wsHttpBindingBehaviour">
<serviceThrottling maxConcurrentCalls="160" maxConcurrentSessions="100" maxConcurrentInstances="100" />
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
And the service contract is (Method/param names changed to anonymize, but types the same):
System.ServiceModel.Channels.Message GetData(System.ServiceModel.Channels.Message request);
Which looks like a network issue to me, but I can't imagine why it would succeed on the longer time-period with smaller data if it was intermittent network issues and I can't see why downloading a large file would've been unaffected if this was the case. Does anyone know a potential cause for this, or any idea what the next step of diagnosing it is?
CommunicationException is genericized and does not reveal the underlying exception. In the future, when reporting errors, I'd recommend turning on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, and then report the nested exception you get in Detail.
For example:
<behaviors>
<serviceBehaviors>
<behavior
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
It's hard to tell from what is going wrong at all. Here is some more things I suggest, which I also suggested in another post:
Enable tracing on the service side and the client side, generate tracing logs, and analyze with SvcTraceViewer. To do this, follow the instructions at this MSDN article on using the service trace viewer.
Turn on debug exceptions. This is done by turning in includeExceptionDetailInFaults, which you can do by following the instructions here.
Use Fiddler to monitor the wire traffic on both the client side and the service side.
Generally, once you do this, you should plenty of more info on what's going funky at the service side and can diagnose the issue pretty quickly. Try it, and please report back! :)
I was looking for a solution for a very long time and added every configuration I found to increase the amount of data. what helped me eventually was this line under <behavior> tag in web.config that in server side:
<dataContractSerializer maxItemsInObjectGraph ="2147483647"/>
and making sure I have the same behavior in the client side.
Related
I don't have enough experience with WCF and its configuration and I don't know how to approach this problem. So I am sorry for this, possibly dumb, question.
I have virtual machine with windows service that hosts WCF. I want to communicate with this WCF from client running on local machine that runs this virtual machine. I can run the service locally with no problem, but when it comes to communicate with service on virtual machine I have really hard time to configure it properly. I want to use TCP connection without the use of IIS.
I tried to specify address of VM, alternate addresses and endpoints with no success. Can you advice me what is correct configuration?
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBindingConfiguration">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="WCFHostBehaviour" name="TestRunnerWCF.Service">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="NetTcpBindingConfiguration"
name="WCFHostNetTcpEndpoint" contract="TestRunnerWCF.IService" />
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
name="WCFHostMexTcpEndpoint" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://192.168.10.25/Service" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WCFHostBehaviour">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
UPDATE 1:
I don't know how to add service reference in my client. If I use localhost I run service on my local machine and that is not desired.
Virtual machine runs in Hyper-V and have address 192.168.10.25. I can ping it from local machine. I don't use any port forwarding.
I can run client on virtual machine with this config:
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="WCFHostNetTcpEndpoint">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://192.168.10.25/Service" binding="netTcpBinding"
bindingConfiguration="WCFHostNetTcpEndpoint" contract="ServiceReference1.IService"
name="WCFHostNetTcpEndpoint">
</endpoint>
</client>
</system.serviceModel>
But when I try to run client on local machine I can't connect to my virtual machine.
Error: Cannot obtain Metadata from net.tcp://192.168.10.25/Service If this
is a Windows (R) Communication Foundation service to which you have access,
please check that you have enabled metadata publishing at the specified
address. For help enabling metadata publishing, please refer to the MSDN
documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata
Exchange Error URI: net.tcp://192.168.10.25/Service Metadata contains
a reference that cannot be resolved: 'net.tcp://192.168.10.25/Service'.
Could not connect to net.tcp://192.168.10.25/Service. The connection attempt
lasted for a time span of 00:00:21.0324561. TCP error code 10060: A
connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond 192.168.10.25:808. A connection
attempt failed because the connected party did not properly respond after a
period of time, or established connection failed because connected host has
failed to respond 192.168.10.25:808
As Reniuz point out, firewall in VM was blocking my connection.
Original comment:
So you need to specify VM's ip address. But first you need to ensure you can access it. Try to connect whit telnet . If you can't connect, first thing what you can do is to add inbound rule in VM's firewall (new rule-> select port->next-> enter wcf service port -> finish). Most likely the firewall is blocking in coming connection on your VM wcf port. – Reniuz
I'm getting the following exception The operation has timed out when calling my WCF REST service.
I basically have a WCF Web Service project and a web site which references the compiled WCF assembly. The web service works a charm, so my problem is not down to having an incorrect binding, endpoint or service definition in my web.config.
The problem only occurs if I try to insert a large amount of data.
The web.config contains the following info:
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<httpRuntime enable="true" executionTimeout="100000"
maxRequestLength="2147483647"/>
</system.web>
<bindings>
<webHttpBinding>
<binding maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
receiveTimeout="00:10:00"
sendTimeout="00:10:00">
<readerQuotas maxStringContentLength="2147483647"/>
</binding>
</webHttpBinding>
</bindings>
My WCF web service is not referenced in the the project (windows service) as I'm using a wrapper (sdk) which takes care of making all the relevant http request and convert object to json and vice versa. All http request are made via the WebClient which is called the sdk. In this instance:
byte[] returnBuffer = await client.UploadDataTaskAsync(uriString,
"POST", requestBuffer);
While this is happening on a live site (Yikes!!), I can easily reproduce the problem by putting a breakpoint in my web service and letting it hang for 90 seconds or so, then if I try to continue stepping through, the specific error is generated and while it's attempting to continue to run the remaining of the code within the function, the exception is returned back to the client.
I've been googling this problem for hours now but I'm not getting anywhere with this. My web service still times out the default 90 seconds.
Another thing I'm wondering about. I've been reading a lot of various article saying mentioning that the client app, in my case my windows service should have binding, endpoint, etc... information in the app.config. I have none, nor have I ever needed one up to now. Should I look into this?? It really does appear that the timeout is happening on the web service rather than the client end.
Any ideas?
Thanks.
UPDATE:
I've added additional info about my web.config (i.e. service & behaviour definitions):
<services>
<service name="MyCompany.Web.Services.WebDataService"
behaviorConfiguration="WebDataServiceBehaviour">
<endpoint address="" binding="webHttpBinding"
contract="MyCompany.Web.Services.IWebDataService"
behaviorConfiguration="webBehaviour">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WebDataServiceBehaviour">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="webBehaviour">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
I would say this was due to a client-side timeout setting. Do you have a client-side config or some other way to configure the wrapper?
It's hard to say as I don't quite know how your wrapper works but you would want to increase the timeouts on your bindings. e.g.
<binding openTimeout="00:10:00"
closeTimeout="00:10:00"
sendTimeout="00:10:00"
receiveTimeout="00:10:00">
See here for more details
I'm going to answer my own question as I wanted to clarify a few things:
This has nothing to do with having invalid settings in the web.config as the problem was client-side related. It is easy to assume that the problem is server side related but this was not the case in this instance.
There is no point setting the ServiceModel (address, binding, contract) configuration in the app.config on the client-side as I'm calling the WebClient object which as far I'm aware is totally unaware of type of service I'm calling and these settings are quite specific to WCF and while my service is a WCF REST web service and does require a ServiceModel settings on the server end, the WebClient object is totally unaware of these.
The answer to my problem was found in the article How can I change the time limit for webClient.UploadData()?. After making the relevant changes, I test this thoroughly and it's also been deployed on the live site that were having the timeout problem and the problem has definitely been resolved when uploading a large amount of data.
Thanks.
I am having an issue debugging my WCF service when I set the WCF service to SSL Required in my local IIS. I am able to hit the URL correctly for my service under http/https but I cannot debug and step through the code. I received a popup box with the following text:
Unable to start debugging on the web server. The web server is not configured correctly.
When I make the service not SSL Required I am able to step through my code as expected. I am new to dealing with IIS and have gone through a number of tutorials with the same result. Any help would be awesome
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="sslBehaviorConfiguration">
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpsGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="sslBindingConfiguration">
<security mode="Transport" />
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="SslWCFProject.Service1" behaviorConfiguration="sslBehaviorConfiguration">
<endpoint binding="wsHttpBinding" bindingConfiguration="sslBindingConfiguration" contract="SslWCFProject.IService1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<!--<protocolMapping>
<add binding="wsHttpBinding" scheme="https"/>
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>-->
1) First, I recommend checking the IIS logs. They are usually located in the following directory: C:\inetpub\logs\LogFiles. Just go into the W3SVC prefixed folder whose modification date most closely matches when you received the error. Open the log for the correct day and see the error details.
2) If that reveals nothing, then check out the Windows Application log in your Event Viewer.
3) Do you have a certificate (e.g. self signing certificate) on your computer? Is there a trusted site issue here?
I believe I found my answer. It looks like the checkbox in IIS for the website for Require SSL is associated the client certificate and requiring a client certificate to access the service instead of the section which is below it (although I will need to select required in the future). For the post I found When this is checked off I cannot debug the service but I can attach to the process in order to debug it.
http://blogs.msdn.com/b/vijaysk/archive/2007/10/18/visual-studio-debugging-websites-that-require-client-certificates.aspx
If I am wrong please let me know. If I come across anything else I'll update this question again with my progress just to keep in documented.
i wrote a wcf service and deployed it on a local iis without any problems.
local system:
windows 7 x64
iis 7.5
now i try to deploy my service on a remote system with iis server.
i copyed the service.svc, web.config and the bin directory to a folder of the other system.
after that i added a new application to the default website and linked it to the folder containing my files. i opend the browser an tryed to reach the svc file.
file is displayed correct with both wsdl links, but whene i click the links the url changes but the site dont change. tryed this on the remote system and on local client. same beavior on both systems.
remote system:
windows server 2012 r2 x64
iis 8.5
what ive done:
added a service behavior which enables service metadata
set the httpGetEnabled=True on that service metadata behavior to allow http browsing to that metadata
added mex endpoint on my service
here my web.config:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MetadateBehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service
behaviorConfiguration="MetadateBehavior"
name="ServerLib.Handler.WcfReciveHandler">
<endpoint
address=""
binding="wsDualHttpBinding"
contract="Common.Contracts.IServerContract" />
<endpoint
address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
i found a similar post here but with no answer to my problem. (WCF hosting: Can access svc file but cannot go to wsdl link).
i enabled tracing on my service but no logs are created so far. so i think the service is not running. on my local system togs are created.
i tryed to add a service reference to my client project with the url of the svc file, but this ends with an error:
There was an error downloading '\http://dev.develop.local/asd/Service.svc/_vti_bin/ListData.svc/$metadata' The request failed with HTTP status 404: Not Found. Metadata contains a reference that cannot be resolved:
followed by html document - think the file that is displayd whene i access the svc file.
ive checked my application eventlog on the remote system and noticed following error that seems to be written whene i tryed to add the service reference:
WebHost failed to process a request.
Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/24984138
Exception: System.Web.HttpException (0x80004005): There was no channel actively listening at 'https://dev.develop.local/asd/Service.svc/mex'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening. ---> System.ServiceModel.EndpointNotFoundException: There was no channel actively listening at 'https://dev.develop.local/asd/Service.svc/mex'. This is often caused by an incorrect address URI. Ensure that the address to which the message is sent matches an address on which a service is listening.
at System.ServiceModel.Activation.HostedHttpTransportManager.HttpContextReceived(HostedHttpRequestAsyncResult result)
i hope that someone can help.
You are missing the configuration section for the connection binding for "wsDualHttpBinding". You need to add a bindingConfiguration attribute to your endpoint element and point it to a binding configuration element.
It should look something like this (this is for wsHttpBinding not wsDualHttpBinding):
<bindings>
<wsHttpBinding>
<binding name="wsHttpBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:30:00" sendTimeout="00:30:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="524288"
messageEncoding="Text" textEncoding="utf-8"
useDefaultWebProxy="true">
<reliableSession enabled="true" ordered="true"/>
<readerQuotas maxDepth="32" maxStringContentLength="52428800" maxArrayLength="52428800"
maxBytesPerRead="52428800" maxNameTableCharCount="52428800" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="None" algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
thanks toadflakz. i finally got it.
there have been several problems. your answer helps with one (point 2) of them.
the server and website i published the service only accepted https and my service dont provide the metadata via https. solution was to add httpsGetEnabled to my serviceMetadata.
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
that was the main problem of the wsdl file that was not loaded correctly. after adding this all went fine but communication failed - recived exceptions that point to a authentication problem - > thats point 2
wsDualHttpBinding requires as toadflakz said a bindingConfiguration. at least the information that no security mode is required. my binding config looks like this.
<wsDualHttpBinding>
<binding name="wsHttpDual">
<security mode="None">
<message clientCredentialType="None" algorithmSuite="Default" />
</security>
</binding>
</wsDualHttpBinding>
after that i added a new website for my service listening to http requests on a very high port. client seems to do something but recived a timeout. i added the port to incoming connections on server firewall but it was not enough - brings me to problem 3.
my communication was blocked by the client firewall. i added the server ip clientside - working fine now.
Restarting the visual studio solved my problem, I know its weird, but for someone who has tried everything and still failed , just try restarting visual studio. Hope it helps some one.
I'm building an ASP.NET website - it's a solution with a few projects, a data base and a web service. Everything worked fine, but last time I tried to run the project, I got the following error:
There was no endpoint listening at http://localhost:[number]/BooksWS.svc that could accept the
message. This is often caused by an incorrect address or SOAP action. See InnerException,
if present, for more details.
The inner exception says:
Unable to connect to the remote server
This error sort of came out of the blue, so I'm not sure what additional information I should provide. Does anyone have any idea why this could happen?
I suppose even a general answer could help, the only info I found about this error in the web concerned WCF.
go to webconfig page of your site, look for the tag endpoint, and check the port in the address attribute, maybe there was a change in the port number
Another case I just had - when the request size is bigger than the request size set in IIS as a limit, then you can get that error too.
Check the IIS request limit and increase it if it's lower than you need.
Here is how you can check and change the IIS request limit:
Open the IIS
Click your site and/or your mapped application
Click on Feature view and click Request Filtering
Click - Edit Feature Settings.
I just found also another thread in stack
IIS 7.5 hosted WCF service throws EndpointNotFoundException with 404 only for large requests
An another possible case is make sure that you have installed WCF Activation feature.
Go to Server Manager > Features > Add Features
I had this problem when I was trying to call a WCF service hosted in a new server from a windows application from my local. I was getting same error message and at end had this "No connection could be made because the target machine actively refused it 127.0.0.1:8888". I donot know whether I am wrong or correct but I feel whenever the server was getting request from my windows application it is routing to something else. So I did some reading and added below in Web.config of service host project. After that everything worked like a magic.
<system.net>
<defaultProxy enabled="false">
</defaultProxy>
</system.net>
Short answer but did you have Skype open? This interferes specifically with ASP.NET by default (and localhosts in general) using port:80.
In Windows: Go to Tools -> Options -> Advanced -> Connection and uncheck the box "use port 80 and 443 as alternatives for incoming connections".
Try this:
Delete the service instance.
Create a new instance of the service.
Sometimes the port is changed and generated error.
I tried a bunch of these ideas to get HTTPS working, but the key for me was adding the protocol mapping. Here's what my server config file looks like, this works for both HTTP and HTTPS client connections:
<system.serviceModel>
<protocolMapping>
<add scheme="https" binding="wsHttpBinding" bindingConfiguration="TransportSecurityBinding" />
</protocolMapping>
<services>
<service name="FeatureService" behaviorConfiguration="HttpsBehavior">
<endpoint address="soap" binding="wsHttpBinding" contract="MyServices.IFeature" bindingConfiguration="TransportSecurityBinding" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="HttpsBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="TransportSecurityBinding" maxReceivedMessageSize="2147483647">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
If you are using custom binding, please make sure that you are putting the same name for both custom binding (Server and Client)in config files
<bindings>
<customBinding>
<binding name="BufferedHttpServerNoAuth" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00">
<gzipMessageEncoding innerMessageEncoding="textMessageEncoding" MaxArrayLength="10485760" MaxBytesPerRead="31457280" MaxStringContentLength="102400000" />
<httpsTransport hostNameComparisonMode="StrongWildcard" manualAddressing="False" maxReceivedMessageSize="31457280" authenticationScheme="Anonymous" bypassProxyOnLocal="True" realm="" useDefaultWebProxy="False" />
</binding>
</customBinding>
</bindings>
the binding name "BufferedHttpServerNoAuth" should be same in both.
Hope this would help someone
This is ancient history but I just ran into this issue and the fix for me was recycling the application pool of the website in IIS. Easy fix, for once.
I changed my website and app bindings to a new port and it worked for me. This error might occur because the port the website uses is not available. Hence sometimes the problem is solved by simply restarting the machine
-Edit-
Alternative (and easier) solution:reference
Get PID of process which is using the port
CMD command-
netstat -aon | findstr 0.0:80
Use the PID to get process name -
tasklist /FI "PID eq "
Open task manager, find this process and stop it.
(Note- Make sure you do not stop Net.tcp services)
I solved it by passing the binding with endpoint.
"http://abcd.net/SampleFileService.svc/basicHttpWSSecurity"
Click on Service which you have created right click on it then select update references after this rebuild the application it will work