Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide http interface for non-dotnet applications #2

Closed
xulihang opened this issue Sep 12, 2020 · 7 comments
Closed

Provide http interface for non-dotnet applications #2

xulihang opened this issue Sep 12, 2020 · 7 comments

Comments

@xulihang
Copy link

I want to integrate fiskmo in BasicCAT, a CAT tool based on Java. But java does not support net.tcp in wcf.

It would be great if fiskmo can serve as a http server.

@xulihang
Copy link
Author

I read the source again and I found I need to run it with admin privileges. I just need to find out how to use this in java.

@TommiNieminen
Copy link
Collaborator

If you don't want to run as admin, you can use netsh to reserve the http API port for Fiskmo (this is hardcoded to 8500 at the moment). The command would be something like netsh http add urlacl url=http:https://+:8500/MyUri user=DOMAIN\user.

@xulihang
Copy link
Author

I am tring to use wsimport to create java classes with this line of command: wsimport -d generated http:https://localhost:8500/MTService?wsdl. But I cannot get wsdl.

@TommiNieminen
Copy link
Collaborator

It seems that the HttpGetEnabled property wasn't set to true, so the API didn't generate a wsdl file. I've set the property to true in the latest commit of the develop branch, so if you compile that you should be able to get the wsdl at http:https://localhost:8500/?wsdl.

If you are using the latest build, this is the format of the requests you should use to get a translation: http:https://localhost:8500/MTRestService/Translate?tokenCode=&input=Example&srcLangCode=en&trgLangCode=fi&modelTag=

@xulihang
Copy link
Author

Thanks. The REST API is easy to use.

@xulihang
Copy link
Author

I have made a plugin for BasicCAT.

image

A post about this: https://www.basiccat.org/offline-machine-translation/

@TommiNieminen
Copy link
Collaborator

Looks good, that's a cool project you have there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants