A scripting language for web services apis for handling documents? [closed] - web-services

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm investigating using a scripting language in order to call a web service that handles documents in a repository database. I'm thinking about powershell or perl, but I don't have much experience with using scripts to call web services.
As far as the api's, they are mostly just get/put operations for the files and the files are xml based.
We are looking at scripts as something that would be easy to use, compact code, portable, and rapid implementation.
The script has to run on windows boxes, XP I think, and the document file transfers are going to be very large due to embeded graphics in the documents, like around 10gbs.
Does anyone have any experience with this and has a recommendation, based on the above items?

I'm a bit biased because I'm a Java developer, but you ought to consider Groovy. It works seamlessly with the rest of the Java stack, but has dynamic syntax. If you are doing REST you can do something like this (GET example):
def response = "FULL_URL_STRING_WITH_PARAMS".toURL().text
That will take a string, convert it to a URL, fetch it and put the response in a string named response in a single line. Groovy has a lot of things like that for handling networking code and its XML and JSON APIs are really slick. For example, this is how you would parse a XML response (using RSS as an example):
def rssFeed = new XmlSlurper().parseText(response)
rssFeed.channel.item.each { item ->
println "${item.title} ${item.pubDate}"
}
The JsonSlurper works the same way with raw JSON output.

Related

How to automatically detect bugs in a web application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a web application in Vaadin. It has got some forms, search fields, buttons, etc and supported by a SQL database. I have been using Selenium, Sahi Open Source and some other tools for automated GUI testing.
Problem is: With recording GUI actions for automated testing isn't really useful because it seems more manual work than automated because I need to record the tests manually anyway.
Question is: Is there any better way to test a Web Application? How do you test your web application? Is there any free tool which automatically detects bugs in my web application?
This won't be possible unless someone will invent sentient AI and even that might not be enough. In our company we have separate QA department (they're intelligent human beings) and they keep asking questions like "how we're supposed to test this flow" and "is this the expected response".
Without test that is aware of the business flow that you're limited to what bots do - randomly crawl trough site and try to get "500 page" and that is not enough. If you're tired of writing tests you can:
Use static code analysis tool (like jshint) to check if your code is written in "best practices" way
Use your users as testers (have streamlined release process, and mechanism of reporting error so you can address production bug as quickly as possible)
Hire someone to write the test for you
There are lots of ways to test software. None of them are fully automatic; they all require that actual behavior be compared against expected behavior, and expected behavior cannot be automatically inferred by a machine but must instead be prescribed and defined by humans, and then translated to a language that a machine can understand and use to determine whether it matches the actual behavior.
Here is a starting point to start reading about other ways to test your software:
https://en.wikipedia.org/wiki/Software_testing

Saving data into file at free host [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have created an app (some kind of "client" app) that will have a "bug report" feature. The feature consists with pure text area from which the text should be sent and saved to a text file on the free host. Is it possible? If so, which c++ library could give me such ability?
EDIT:
In my intentions it had to be a simple application that a user has on his own computer. After finding some bug in my app there should be the "bug report" feature that will allow him to send the data (pure text) to some place that only I could reach. I was just thinking about free hosting (because it's... free), and save the data into a text file there. I'm sorry if my question wasn't appropriate.
If your free hosting permits it (and you should check that) you might code a CGI program, or a fastCGI application. There are several C++ libraries which might help, like libcgicc etc.
If you can afford a web server, there exist C++ libraries providing HTTP service, in particular Wt or (in C) Onion etc.
You could also consider other technologies, like OpaLang or Ocsigen (but I would not recommend PHP, even if it is a lot used).
MAybe your hosting enable ssh so you could use scp ....
And if your application is free software (e.g. GPL licensed), several free software hosting (freecode, sourceforge, github, gitorious ...) may offer also a bug database facility.

How can z/OS call a web service? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have a COBOL program that needs to get data from a web service. Without using CICS what are my best options? I thought that a C program could read the web service and save it to a file, then the COBOL could read that file. Can COBOL call a web service? The data is about 300mb in size.
Use the IBM TCP/IP 'EZASOKET' modules
I work for a company with a z/OS system running mostly COBOL, batch (JCL) and CICS. To call webservices, we wrote a module to implement HTTP 1.0 using TCP/IP. With modules
EZASOKET
GETHOSTBYNAME
SOCKET
CONNECT
WRITE
FCNTL
READ
CLOSE
SELECTEX
supplementary modules:
EZACIC04 translates EBCDIC to ASCII
EZACIC05 translates ASCII to EBCDIC
EZACIC06 convert character to bit mask
EZACIC08 decode IP address
Since I wrote this for my company, I can't just give out the code. But for reference, it took me 3 days to write the module, and that was with an example to start with that did a partial hacky way of doing it.
You'll need to read through IBM's references to know how to use the EZA modules.
http://publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.halc001/sampcs.htm
It is possible to call java from COBOL programs on z/os.
We have done it in our company.
You have to specify that it is RECURSIVE
You have to import the classes
Class HelloJ is
"com.ibm.zos.batch.container.test.HelloJ"
Class JavaException is "java.lang.Exception"
Class BCDTranHelper is
"com.ibm.batch.spi.UserControlledTransactionHelper".
The you have to include JNI.
LINKAGE SECTION.
COPY JNI
***Then you can invoke java from COBOL in your PROCEDURE DIVISION with:
Invoke HelloJ "sayHello"
Also look at Java Exception Check * to see how to handle the exceptions.
This is very useful if you want to invoke a web service from your COBOL program on z/os.
see this link for more details.
http://pic.dhe.ibm.com/infocenter/zos/v1r13/index.jsp?topic=%2Fcom.ibm.zos.r13.iean500%2Fcodeexm.htm
Maybe have a look at this article. It suggests creating a C/C++ wrapper interace to the web service. Although this article is for iSeries, you might be able to implement something very similar under zSeries using BPXBATCH
Basically, they suggest using a C wrapper between your COBOL code and the C++ code that interfaces with the web service. This solution allows COBOL to call a C function in a relatively straight forward way. The C function mimics C++ behavior by implementing the call to the Web service using a C++ proxy.
If you can use Java at your site calling Java from a cobol program to access the web service may be an option. Assuming your using Enterprise cobol check out section 6.44 of Java Stand-alone Applications on z/OS Volume II
Use the z/OS client web enablement toolkit if you are at z/OS 2.1 or above.
Look at the sample in SYS1.SAMPLIB(HWTHXCB1) for Cobol.
If your Cobol is running under DB2 DSN command, you can also use SOAPHTTP* scalar functions.

How to write a good program for blocking unwanted / harmful websites [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I intend to write a simple application that will block network traffic (HTTP and HTTPS) with unwanted / malicious web sites.
Assumptions:
At the beginning the logic will be simple. After entering in the browser the address from the "black list" my logic should take control under communication and send defined by me site contents
Later I want to add some logic that will search web body looking for unwanted / harmful words
The program will be written in C++
I do not want to use existing libraries (open source etc.) only write all from scratch. J just want to learn windows network mechanism and layers
Unfortunately, I am a layman when it comes to play with the network layer in Windows.
Where do I start?
Where and how should I inject my filtering logic?
You should look into Windows Filtering Platform. This API gives you access to the network stack at a very low level.
You have at least 2 options:
Build your own proxy that filters traffic and replace unwanted content and setup this proxy in browser settings.
Create NDIS filter driver. You can start reading about NDIS here. You can also find sample driver in WDK.
I would prefer the first option.
I a working on something similar in my spare time(as if I had any).
It's not very easy.
It depends a lot on the OS version.
There's LSP(Layered Service Provider) but as I understand it it doesn't work on Win 7 or later. There is an implementation of something similar to what you are trying to achieve here.
For Win 7 and above there is the filter driver alternative but I tested it and if the site is using SSL you won't see anything. You have to somehow handle this either within the driver itself or redirect the traffic to a man-in-the-middle proxy. I didn't get that far yet.
Anyway this is M$'s official sample. And you might also be interested in this.

Any latex web services with an API? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
Is there a web service API that takes this type of a latex http-request:
http://some_web_service/texfile?texfile=
\new\documentclass[12pt]{article}
\begin{document}
bla
\end{document}
and returns:
bla.pdf
the Online LaTeX Equation Editor is perfect for this.
EG:
uses the following markup:
![equation using Online Equation Editor]
(https://latex.codecogs.com/gif.latex?x&space;=&space;\frac{4}{5}+\pi\Omega\int_{2\pi}^{\infty}{5\left\(\frac{\tau+3}{2}\right\)d\omega})
note that you will need to escape parentheses with a backslash, eg: \left\( stuff \right\)
If you look through the editor API documentation you might figure out that you can change the format from gif to png by changing the api url endpoint from /gif.latex to /png.latex.
There's also options to set a white background by using \bg_white:
![equation using Online Equation Editor]
(https://latex.codecogs.com/gif.latex?\bg_white&space;x&space;=&space;\frac{4}{5}+\pi\Omega\int_{2\pi}^{\infty}{5\left\(\frac{\tau+3}{2}\right\)d\omega})
See also this meta.stackexchange answer and this tex.stackexchange answer. I'm sure there are many more answers that point to this tool and implement it in different ways. IE: instead of using the url to generate a gif or png using markdown notation, or you could use html markup and bypass markdown or you could just drag the image over to your post.
I'm looking for the same thing and Latex Online seems to be the closest thing to what we need.
You just need to setup the server by yourself.
EDIT
I've written my own little Sinatra app for this: https://github.com/codegestalt/sinatratex
ScribTeX has a CLSI API, you can send CLSI requests from any platform to compile LaTeX.
I blogged some time ago about this along with a CLSI client written in F#.
The Common LaTeX Service Interface (CLSI) is a web service interface and implementation that exposes common LaTeX related capabilities (such as compiling LaTeX documents to different formats):
http://code.google.com/p/common-latex-service-interface/
(This interface is one of the ways that latexlab.org can compile latex)
Fundamentally, this shouldn't be any different than a build server like you see for lots of open source projects (along the lines of Koji for example). Ultimately, you would just hook into pdflatex instead of gcc.
Were you to be able to install software on your local server this wouldn't be too hard. Some combination of Perl / TT / latexmk along with a LaTeX system (e.g. TeXLive or MiKTeX).
I don't know about latexlab mentioned above. The closest thing I know of is http://www.tlhiv.org/ltxpreview/ , which perhaps you could wrap to do what you need (or even write a howto for your users).
Just for completeness:
GitHub or docker might do the trick.
It's basically a micro service implemented in java/spring boot, which is wrapping pdflatex. Urls are immutable and the pdfs are stored on disk/distributed storage. You'll have to host it on your own though. The code is pretty simple and you're able/allowed to customize it to your needs. See the "Scaling the service" section in readme for more details about setting up a production environment.