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..
Related
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.
I've created a WCF service with a method GetTestValue. I've also created a test application to test this service.
When I add this WCF service with connected service to the test application I can only call GetTestValueAsync, there is no GetTestValue method. Somehow this add process add this async thing behind the method name. So in this test application, the WCF call works fine when I call GetTestValueAsync. I get the result back.
Then I've created a Xamarin cross application app where I added this WCF service too, and when I call the GetTestValueAsync from this application I get the following error:
Error in deserializing body of request message for operation 'GetTestValue'. OperationFormatter encountered an invalid Message body. Expected to find node type 'Element' with name 'GetTestValue' and namespace 'http://tempuri.org/'. Found node type 'Element' with name 'GetTestValueAsync' and namespace 'http://tempuri.org/'
Somehow strange in the test project it works fine, and in the Xamarin cross application not.
Did someone have the same problem?
Why is this connected service always this Async to my method name?
How can I stop this Async being added to the method name?
Thanks for any help.
At the moment Xamarin apps aren't compatible with the Task-based asynchronous WCF proxy methods that the WCF Web Service Reference connected service provider generates (bugzilla.xamarin.com Bug 51959).
One way to generate an older, compatible style of WCF proxy methods is to run SvcUtil.exe with the /async and /tcv:Version35 switches in a Developer Command Prompt. That will generate synchronous proxy methods, Begin/End style Asynchronous Programming Model (APM) callback proxy methods, and event-based proxy methods, all of which are compatible with Xamarin apps.
(Note: If you leave out the /async switch, SvcUtil.exe will generate the newer, incompatible Task-based proxy methods.)
Duplicate: By chance, I replied on a more recent duplicate of this question first:
How to use WCF services in .netstandard with Xamarin.Forms project?
I know this is old, but I had the same problem and searched a while. When you are adding the Reference in your project, you can check "generate synchronized operations" and the "Async"-suffix aren't generated anymore. My VS runs in german language, so I just translated the options. If your adding new methods the setting will be considered too.
Greetings from germany.
Could you tell me how to access a web service method from a web browser? I need it to call a webservice from a database using only TSQL
I have a simple web service running on my local JBoss server.
I have found an information that a wsdl file is easily accessed by calling an URL:
http://localhost:8081/webserviceName?wsdl
I would like to invoke a method "simpleMethod". As I learned from reading tutorials I should call:
http://localhost:8081/webserviceName/simpleMethod
but it simply does not work. I have received an error that the requested resource is not available.
In received wsdl file there is a statement:
<wsdl:definitions name="DataServiceImplService" targetNamespace="http://services.test.com/">
Does it make any difference? Should I use that information to call a Web Service?
The main idea behind my question was to find a way to call a webservice from a database (and that is why I needed web service URL).
So I have found a web that explains how to do it entirely in SQL:
http://www.vishalseth.com/post/2009/12/22/Call-a-webservice-from-TSQL-%28Stored-Procedure%29-using-MSXML.aspx
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?
I tried to call a web service from iphone. I used wsdl2objc to generate the stub. To make the web service call really work, I had to manually modify the soap message. Any better framework for ios soap?
I've had success with SudzC in recent projects, which will read a WSDL and generate a complete set of Objective-C (or Actionscript, or Javascript) classes, with supporting frameworks and an Xcode project, for working with your web service. Is that what you're looking for?