Error while consuming wcf service - c#

I created a wcf application library with no modification from the original example and I hosted it in IIS. It's on a remote computer and using chrome i can see that the service is up and running but if i try to create a config file using
svcutil.exe http://IP_HERE/serv/WcfServiceLibrary1.Service1.svc?wsdl
i receive the following error.
I think that it has something to do with the application pool. What do you think?
My default config: http://pastebin.com/a355LcWp

After checking your service config file I found that you are hosting service on port 8733 which is mentioned in base address value. You need to make sure that you include this port number while accessing wsdl.

Related

The socket connection was aborted while consuming wcf service in windows service

I created wcf service library with duplex communication and hosting using windows service, and one more project for clinet i.e, inside windows service I added wcf service reference and trying to consume service. when I try to call wcf service callback method I m getting "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 '00:00:59.9390000'".
This error I m getting when I try to consume wcf service from remote system within the network.From same sytem I am able to access the service callback flow.
I tried increasing service timeout and MaxBufferSize, MaxBufferPoolSize, MaxReceivedMessageSize, MaxArrayLength sizes also, but no luck. Icreated sample service and client n uploaded in below link.
Sample Applications link
App1 :- WCFService(winhosting).zip: consists of two pojects one is wcf service library project with callbacks and second project is windows service to hosting wcf service
App2 :- WCFClient(WinService) (2).zip : consists of one project i.e, windows service added wcf service reference here.
I haven't looked at the downloads yet but you sound like you've looked around a good bit so the only thing I can think of is that you run your service as administrator. This was my problem, it would not send the packets and I got the same error as you, all due to the service not running as administrator. Right click your service -> Properties -> Log On -> Make sure you tick "This account" and then type in the administrator credentials and try it :)

Why can't my test client connect to my WCF rest service?

I have a simple wcf rest service. I can test it ok using the WCF Test Client.
I created a test client of my own via svcutil.exe. This builds and runs. However, it always gives this exception when instantiating the service object:
Could not find default endpoint element that references contract
'IBookService' in the ServiceModel client configuration section. This
might be because no configuration file was found for your application,
or because no endpoint element matching this contract could be found
in the client element.
I'm basically following the tutorial here:
http://www.codeproject.com/Articles/571813/A-Beginners-Tutorial-on-Creating-WCF-REST-Services
I also cannot access the endpoints via a url when running it locally. It's unclear to me why this tutorial has a .svc file in the url when trying to access the service from a browser though. I have no .svc files anywhere.
The WCF Test Client is for testing SOAP-based services (those services using any binding other than webHttpBinding in WCF).
The WCF Test Client however is NOT capable of working with REST services.
For REST, use something like Fiddler instead.

Is it possible to create a DLL of WCF Service which having webHttpBinding

I have searched over internet but did not get any specific answer or i say a satisfied answer that how can we make DLL of a WCF Service which is having webHttpBinding in its web.Config file.
I have a WCF Service which i want to deploy on client's server but i dont want them to see my code as if i host this service on their server they will able to see my code and i don't want that.
This Service responses in JSON Format which can be access only through URL.
so how to create a dll of this service and then host this on Server.
1) A DLL does not have a web.config or any other .config.
2) Deploying a Service as a DLL does not prevent anyone from seeing the (disassembled) code.
3) You may be able to configure your service in code, but only when it's self-hosting. Which would usually be as an EXE, a DLL needs something else to host it.

WCF Service Hosted in Windows Service over net tcp

In my project I have one WCF Service which is hosted in a Windows Service. I hosted the WCF Service in Windows Service over netTCPBinding and Installed Windows Service. To access WCF service in my silverlight project I have added service reference of wcf.
But, when I am calling a method in WCF Service am getting the following error :
Could not connect to
net.tcp://localhost:8732/WCFHost/.
The connection attempt lasted for a time
span of 00:00:03.2951885.
TCP error code 10013: An attempt was made to
access a socket in a way forbidden by
its access permissions..
This could be
due to attempting to access a service
in a cross-domain way while the
service is not configured for
cross-domain access. You may need to
contact the owner of the service to
expose a sockets cross-domain policy
over HTTP and host the service in the
allowed sockets port range 4502-4534.
Please help me out.
For same-machine connections rather make use of Named Pipe bindings.
It might help if you showed us your service and client side endpoint configurations.
EDIT: After reading up a bit on the error you're getting (here among other sites), try changing the port number from 8732 to something between 4502-4534 as the error message suggests.
Keep same protocols at both the server and client end. May be your are calling the service with different protocols. Also check if your are using nettcp, your are having access to the machine where service is hosted.
use basicHttpBinding instead of netTCPBinding

how to access webservice deployed in remote server

Please help me , how to add web service which is deployed in remote server. externally i unable to access that service..in that remote server only that service will run but we don't have Ms.net Environment to add service to my application in that server.
So please guide me how to add that web service to my application ,not accessig externally that service URl, internally Executing that URl.
How can i add that service to my application on my developer PC ?
To add a web reference you need to have access to the WSDL file.
You need to do this in 2 steps:
First add a web reference to your project based on the WSDL
Then change the URL of the web reference to match the address of the external service
You can move service URL to web config please refer here.
http://forums.asp.net/p/1268077/2388602.aspx
But if your IP address changes too often (Dynamic IP) I think better your remote network configuration should be changed to have some sort of redirection to your Dynamic IP via a Static IP in your outside network so you can give that Static IP as service URL.
So you don't have to change the web config even too often.
Anyway you Should get advice from a network administrator.

Categories