Open .SVC in web browser - wcf

I have been given a URI for a WCF web service (something like http://some_uri:portnumber/someservice/service.svc) but I cannot open it via a web browser or postman. I tried to open it with cURL but nothing happened either. Is there a certain wat to open .svc file on ubuntu?

You can open this URI by web browser:
You can also open this URI through postman:
We can use svcutil to generate proxy classes to call the service. Please make sure that your WCF service is successfully deployed to IIS.
Feel free to let me know if the problem persists.

Related

Https WCF webservice giving Http 400 error while calling method from browser

I have created a wcf web service. When i run it for http it works fine and gives result in wcftestclient as well as browser.
But when i test for https by changing it fot https it gives result in wcftestclient but when i try to call method from url by passing parameters. i receive error.
HTTP 400 error
It’s not you, it’s this link (it appears to be broken).
I have changed configuration file for https. It is working in wcftestclient but not in browser. it gives wsdl file but error for method calling.
I call method as
https://my-pc/Service.svc/LogIn?a;a
Quick way is Goto project properties of your WCF Service Project in Visual studio, open Web tab/page and make sure IIS web server is selected and IIS Express not selected mention your web address like https://localhost/WcfService1 and if virtual directory is not created then Click on "Create Virtual Directory Button", visual studio will create with required SSL settings for you.
To verify open Internet Information Manager(inetmgr), select service virtual directory/website and verify binding in Actions pane on the right hand side.
It should have two browse links under Manage Application heading one for HTTP and one for HTTPS.
Hope this helps.

CXF Apache WSDL2Java set endpoint

In the beginning I have to warn that I'm not familar with web services, I want to simply generate what I need, and learn the basics of usage.
I recived .wsdl and .xsd files (stored localy). I have generated java code using Apache CXF WSDL2Java tool (I have generated a client). I also have an endpoint (as url without '?WSDL' on the end - whatever this endding means). How can I set this endpoint?
If I use:
Blachblach_Service ss = new Blachblach_Service(new URL(recived_url));
Blachblach port = ss.getBlachblachSOAP();
I get an exception. When I use soapUI to send XMLs to web services, everything works fine.
At first you need to initialize your web service client. See my answer over here how to make this work.
?WSDL ending means that you can see the web service WSDL file in your browser, you can access the web service through SOAP protocol by providing it with some valid request.
If you need to create your web service client using Spring. Here is very good example how to do this.
Yes usually we set params like end point URL on Service class object and retrieve port from it. and from port we invoke web service methods. can you please give details of exception you are getting?

How do I talk to a WCF service from a Firefox extension?

I wrote a simple WCF service and verified I could call it from an asp.net web application. Now i want to call the same service from a firefox extension.
Looking at the example here, http://dotnetbyexample.blogspot.com/2008/02/calling-wcf-service-from-javascript.html I figured if i get the javascript proxy in step 7, I will be able to call it from the javascript in my firefox extension.
But when i load firefox with the extension, it says "Type undefined" in the error console and points to the Type.registerNamespace line at the start of the javascript proxy.
Does the generated proxy only work from another .net application? How should I be going about this?
Update: https://developer.mozilla.org/en/SOAP_in_Gecko-based_Browsers talks about how to deal with calling a web service from Firefox. So if we have the wsdl for the wcf service we should be able to do this from the extension.
Use WCF to return plain xml (not SOAP) or JSON. JSON may be an excellent choice for sure, because you will be consuming from xul/JS..

WCF, Silverlight: clientaccesspolicy.xml not being found

I"m trying to connect my Silverlight application to a WCF service that I'm hosting myself. I've created a clientaccesspolicy.xml file, and placed it in the service host project's root, but when I try to hit the service, my http sniffer says it can't be found. Specifically the file it's looking for is http://localhost:8080/clientaccesspolicy.xml.
I'm running the server and the silverlight app in debug mode in Visual Studio 2010. Do I need to put the file somewhere else?
The clientaccesspolicy.xml file must be in the root of the domain where the service is hosted. You may already have it there but the virtual path of the web site or web application from the property page will need to be changed to "/"
See this page
for more information.
I did not understand how you're hosting your WCF service?
Is it hosted in a asp.net application or a windows host (self-hosting)? If the latter is the case, you may have to implement a clientaccesspolicy service that provides the content of the clientaccesspolicy.xml file on request.
For example like this.

Silverlight looking at wrong url for clientaccesspolicy file

i have a silverlight app connected to a webservice over https.
The webservice is hosted on mydomain.com (not localhost).
When i run the silverlight, it makes https calls to webservice on mydomain.com, but also tries to access "http://localhost/clientaccesspolicy.xml" and fails obviously. Why is my SL app looking for cal.xml in localhost? why is it not looking for cal.xml in the mydomain.com?
Appreciate your thoughts.
Thanks!
"Before allowing a connection to a network resource, the Silverlight runtime will try to download a security policy file from the domain that hosts the network resource. There are two different methods used to download the security policy that depend on whether the connection request was from a WebClient or HTTP class or whether the connection request was from sockets.
If the connection request was from a WebClient or an HTTP class to a cross-domain site, the Silverlight runtime tries to download the security policy file using the HTTP protocol. The Silverlight runtime first tries to download a Silverlight policy file with a name of "clientaccesspolicy.xml" at the root of the requested target domain using the HTTP protocol.
If the "clientaccesspolicy.xml" is either not found (the web request returns a 404 status code), returned with an unexpected mime-type, is not valid XML, or has an invalid root node, then the Silverlight runtime will issue a request for a for the Flash policy file with a name of "crossdomain.xml" at the root of the requested target domain, using the HTTP protocol."
http://msdn.microsoft.com/en-us/library/cc645032%28VS.95%29.aspx
What does the address look like inside your SL application?
Is the address coming from the ServiceReference.ClientConfig file? If so, make sure that it has a mydomain.com and not a localhost address there.