I created a windows service that is hosting WCF web service on port 3000 and web socket on port 8800. The site using these services is also hosted on the port 3000. The communication between the site and the WCF web services works very fine and I'm able to call them.
However, the site is developped with angular2 and I'm using "socket.io-client" to connect to the web socket (implemented using websocket-sharp) and when I do this, I get:
GET
http://dev-sp-build.sfpd.fgov.be:8800/socket.io/?EIO=3&transport=polling&t=LeEF_1J
501 (Not Implemented)
Suivi de
XMLHttpRequest cannot load
http://dev-sp-build.sfpd.fgov.be:8800/socket.io/?EIO=3&transport=polling&t=LeEG3vq. No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://dev-sp-build.sfpd.fgov.be:3000' is therefore
not allowed access. The response had HTTP status code 501.
The second error seems to indicate an issue with CORS. However, I have no idea how to define the correct header as the web socket is hosted in a Windows Service.
The first error is also quite weird, I don't get why I get a "501 Not implemented". It looks like a .NET error in a virtual method that should be overriden but I checked the documentation of "websocket-sharp" and didn't find anything about that...
Related
I have a WCF Service hosted as a Windows Service in the server.
The endpoint is net.tcp endpoint. We are accessing the endpoints from a Silverlight application.
Problem is when we are trying to access the service from the web app while browsing the Silverlight application using HTTP it works fine. But when we try to do so removing HTTP binding from the Silverlight app from IIS and browse the app using HTTPS the service endpoints are unavailable and gets access permission error from Sockets. I am attaching the error screenshot below:
Could not connect to service. The connection attempt lasted for a time span of 00:00:01.0865926. TCP error code 10061: No connection could be made because the target machine actively refused it. 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.
I'm trying to test out a simple outbound message workflow that will insert a contact record into an external database when the contact is created in Salesforce.
I've created my web service using (C#.NET) VisualStudio 2008 and have tested it successfully directly from the browser from my localhost URL. So, the web service works and inserts the values I pass into the method and insert into my database.
I've also created the workflow in my salesforce development org with the outbound message action. I'm pointing the EndPoint URL value to the localhost URL of my web service.
If I understand correctly, I need to create a listener so that when the workflow fires and sends the outbound message, my web service knows what to do. This is where I'm stumbling.
Can anyone help on how to make that connection? How do I create the listener and make the handshake between the outbound message and the web service?
Thanks for any help.
There are is a comprehensive example in Creating an Outbound Messaging Notification Service with CSharp and .Net Framework 2.0
This important parts are:
Export the outbound message WSDL and have your web service implement the interface. It will be SomethingSomething.INotificationBinding
Have your web service return an ACK on successful processing or a NACK if there is an error or exception.
Ensure your web service is exposed on a public IP address. Salesforce will need to be able to call it.
As above, add your web service to the Remote Sites so that Salesforce is allowed to call out to it.
Incidentally, salesforce.stackexchange.com is a great place to ask Salesforce specific questions.
I have a WCF service which works fine when accessed internally. The WCF link is
.
I requested the network team at our organization to expose this WCF to outside world since public websites will access this WCF. I gave the network team DNS as somewebsite.com and IP address of the server on which WCF is hosted.
After getting the confirmation from Network team (they use Juniper network ) that they have made the required settings to make the WCF available to outside world I tested it as an external user.
If I type in http://somewebsite.com/LookUp.svc on address bar I get http 404 page not found error. However if I replace http with httpS as then I see the WCF information. To further test it , I added a simple html file to the root of the website and opened as
http://somewebsite.com/test.html. The Test.html does not open when http is used. However it I use httpS as then Test.html page is displayed to outside users.
The WCF is hosted to windows 2008 R2 and is communicating over port 80 and I have also added the site binding as somewebsite.com with Type as Http and port as 80.
Any idea why WCF caanot be accseed over http ?. I want it to be accessed over http only ?. The WCF uses basicHttpBinding
Is the setting wrong on server on which WCF is hosted ?
Any suggestion is greatly appreciated..
If the service worked before over http before your network guys opened the firewalls I would suggest that they have only enabled the firewall for https traffic.
Sounds like a firewall/routing problem to me...
HTH
I get the following error on my asp.net website, while trying to invoke a wcf service method:
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 77.XXX.XX.XX:809
And then more in detail, I get a socketexception, webexception and also this endpointnotfoundexception:
There was no endpoint listening at
http://77.XXX.XX.XX:809/RemoteSyncService/ that could accept the
message. This is often caused by an incorrect address or SOAP action.
The wcf service (RemoteSyncService) is hosted in a .net application on the 77.XXX.XX.XX server. The binding used is basicHttpBinding.
The endpoint address, used in the asp.net site web.config is:
http://77.XXX.XX.XXX:809/RemoteSyncService
// this is the same on the remote server
The service code for the asp.net website was automatically generated, by using the 'add service reference' feature in VS2010 (on this address: http://77.XXX.XX.XXX:809/RemoteSyncService/mexHttp, as described in the other remote server).
All works perfectly on the dev machine..
What I tried and works:
running/debugging the asp.net locally, and invoking methods
trying to contact the wcf service with wcf test client
the asp.net site can contact the other server, because a ftp transfer from my asp.net site to the remote server was successful
pinging the remote server
Will provide code if needed..
make sure your production server isn't firewalling you.
The situation is that we have some SOAP (asmx) services that are version dependent upon a 3rd party software. These services reside on domainA.
We are in the process of migrating to a new version of the 3rd party software where the existing SOAP services will not be able to reside because of a version incompatibility. Currently the upgraded stuff lives on temp.domainA.
We are developing new services to replace the old SOAP services and will plug in wcf routing or something to save us from the next 3rd party version upgrade party.
Ideally, once temp.domainA is all ready to go we will switch that dns to be domainA and change the old domainA to be old.domainA there for breaking all existing applications referencing the soap services.
I've been fooling around with IIS and ARR matching on a common naming convention that the soap services have and trying to have those requests routed. This works very well for Get requests but not so well for POST requests which is what soap uses.
I set up a little test by having 2 identical services running, one on a test server and one on my local machine. The one on my local machine returns different data than the one on the test server so I can tell which one is being invoked.
I set up ARR's proxy in my local iis to be a reverse proxy to the service on the test server. I set up a url rewrite rule to inspect the incoming requests based on the naming convention of the soap service url.
If I browse to the soap endpoint via a browser and httpget's everything works as planned. I get a response from the remote test server with the request originating from localhost.
When I run the test app which makes the same call except as a post with soap I get this error
exception.message: There was no endpoint listening at http://localhost/webservice/Default.asmx that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
exception.InnerException: The remote server returned an error: (404) Not Found.
my settings
and then for Proxy Type i have
use url rewrite to inspect checked
enable ssl offloading checked
and reverse proxy: set to remote.test.server