My situation is: I have a wsdl from a webservice (soap). With the Apache CXF i managed to geneate a client. That gives me a huge .js file, in theory a usable client to access from javascript and call the services.
The problem is: There is no information about how to use this client, neither which methods call to start a SOAP process.
If anyone has experience with this, or knows how to initiate the process, or even know any handfull tool to consume Soap based webservices from javascript would be really nice!
Thanks a lot.
Apache CXF has a sample about js client. You can check it out.
http://cxf.apache.org/docs/javascript-client-samples.html
If you need help specific to your webservice, then share its WSDL.
Related
I have a local site like no server no nothing just the html, css, javascript files and i need to send data from an app in my phone created with android studio and display it on the site.I read that you can have a webserver and send data with the android/java tcp client to it but i cant find how to do it.So how can i approach this?
This is possible using server-side programming languages.
You can receive data using Api and display it on your web pages after saving it in the database.
To start, I suggest learning Php - Mysql , it's easier to understand and easier to implement
you can send data from your android mobile to the server by using API such as REST and SOAP but you have to any of the server-side scripting languages like node PHP etc.. Please refer the tutorial point to get better ideas
https://www.tutorialspoint.com/android/android_php_mysql.htm
this question have been asked numerous times, I know and I'm sorry if by ignorance I didn't get the answers.
I have a hosting plan which doesn't allow me to install django, which was really nice to call an rest api easily with the routing settings.
What I want is to be able to call a python function from javascript code doing a get/post (I'm using AngularJs, but it would be the same making an ajax get/post.)
Let's say I have a js controller 'Employee' and a view 'CreateEmployee'.
From my javascript view, I can call my CreateEmployee() on the js controller, now my question is, how can I call a specific function (let's say) def CreateEmployee(params...) on my .py file?
All I found is making a get/post on my .py file, but didn't find how to invoke a specific function.
I probably don't get the python and client/server communication paradigm, I've been coding on asp.net WebForms for a long time, and since I can't use frameworks like Django I'm stuck.
Thanks
It doesn't have much to do with Python, really. Your javascript code is executed on the client's brower, and all it can do is issuing HTTP requests (synchronous or asynchronous). At this point which webserver / technology / language is used to handle the HTTP request is totally irrelevant. So, from the client javascript code POV, you are not "calling a Python function", you are sending an HTTP request and handling the HTTP response.
If your web host doesn't let you run django (or any wsgi-compliant script) then you'll probably have to either use plain CGI (warning: very primitive techno) or migrate to PHP (no comment). Or find another hosting that doesn't live in the past ;)
You must have a way to communicate over HTTP with your server side Python code. This could help.
When you do, you communicate over HTTP. You will not invoke Python functions directly.
I was wondering if there would be a technical solution to calling a SOAP webservice that is using client authentication via certificates (xwss ; digital signatures over body, timestamp, binarysecuritytoken) from javascript. This means a keystore should be available and accessible, outgoing connection should be allowed,...
Any library exists for this? If needed a browser extension could be used?
Thanks for your thoughts.
Cheers.
There is no such thing as far as I know. Chrome extensions are very limited in what they can do.
The possible solution would be to make an extension that would do requests to web-services and then call a native messaging host to do XML digital signature verification in C++/C#/whatever.
For extension you will need a SOAP client in Javascript. I had to write my own implementation of SOAP client in Javascript to fulfill the task but there are some free libraries out there. See, for example, this one.
I want to connect to a Java Restful webservice that uses SSL from a Javascript client.
I could write standalone Java client that connects to the keystore and imports the certificates and could connect successfully.
How can I achieve the same thing using Javascript, XMLHttpRequest.
Thanks in advance for any pointers.
I'm not entirely sure I understand your question. But, to make a SSL asynchronous request against a server with JavaScript, the only change you need to make is to use https in your RESTful target URL instead of http.
Why is it not a good idea to use SOAP for communicating with the front end? For example, a web browser using JavaScript.
Because it's bloated
Because JSON is natively understandable by the JavaScript
Because XML isn't fast to manipulate with JavaScript.
Because SOAP reinvents a lot of the HTTP wheel in its quest for protocol-independence. What's the point if you know you're going to serve the response over HTTP anyway (since your client is a web browser)?
UPDATE: I second gizmo's (implied) suggestion of JSON.
If the web browser is your only client then I would have to agree that SOAP is overkill.
However, if you are going to have multiple types of front end clients on running on different platforms then SOAP may be appropriate. The nice part about SOAP is that there are a lot of tools out there that will generate code for you to handle sending, receiving, and parsing of SOAP based on the WSDL file.
For example, if you wanted to develop a C++ front end client then all you need is the WSDL file and Microsoft's tools will generate all the C++ code to generate the SOAP request based on a data structure, send the request, receive the response, and parse the response into a return data structure.
There are tools to do this both on the client and server side.
It could be done. Just remember that SOAP is not the fastest way to exchange information as there is a big overhead (big XMLs have to be sent back and forth) - that's probably why you don't see it used that often