Play framework use SOAP web services - scala

I'm trying to implement SOAP web service client in Play Framework. I found play-soap lib but I cannot find repository:
https://github.com/playframework/play-soap
http://downloads.typesafe.com/rp/play-soap/SbtWsdl.html
When I add sbt plugin addSbtPlugin("com.typesafe.play" % "play-soap-sbt" % "1.0") it returns:
Error:Unresolved dependencies: com.typesafe.play#play-soap-sbt;1.0: not found
How can I implement SOAP webservices in Play Framework (Scala)?

Go here and follow the install instructions. This is the open-sourced version of the plugin, and from the documentation it looks identical to the one in the official Play docs.
Essentially, add this to your project/plugins.sbt
resolvers += Resolver.url("play-sbt-plugins", url("https://dl.bintray.com/playframework/sbt-plugin-releases/"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.typesafe.sbt" % "sbt-play-soap" % "1.1.3")

Related

How to create a Play project with a specific version?

How can I create a new play project for a specific version?
using sbt new playframework/play-scala-seed.g8 it will always create a project pointing to the last version of Play (in this case 2.7).
The thing is that there isn't support for that version in gradle yet and I don't want to use sbt.
How can I specify version 2.6.6?
In your /project/plugins.sbt file you can specify which version of play you want to use.
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.6.6")
Reference : https://www.playframework.com/documentation/2.6.x/BuildOverview#Play-plugin-for-sbt-(/project/plugins.sbt)

How to add Swagger to a Play framework project

I have a Play project and need to add Swagger to it. Started following this guide: play-swagger and even did thealternative setup steps, but the swagger page is empty. Just a header appears on the page. Where should I look for mistakes or did I miss something?
Also, there is another guide: Swagger UI and Play Framework, but the sbt cannot resolve the given dependency. Does it need a specific resolver?
I've added this dependency:
"org.webjars" % "swagger-ui" % "2.2.0"
and this sbt plugin:
addSbtPlugin("com.iheart" %% "sbt-play-swagger" % "0.7.5")
(Play version 2.6, sbt version 1.x, Scala version 2.12.x)
There is a swagger.yml file in the conf folder. The contents of the Swagger UI dist folder is in the public/swagger folder. The routes file contains these lines:
### NoDocs ###
GET /docs/swagger-ui/*file controllers.Assets.at(path:String="/public/lib/swagger-ui", file:String)
### NoDocs ###
GET /assets/swagger.json controllers.swagger.ApiSpecs.specs
from alternative setup and the controller class specified in the same guide is also present. The Swagger UI index.hml contatins this line:
url: "http://localhost:9000/assets/swagger.json"

Play 2.4 Mailer

I am using play framework 2.4 and i am trying to send an email using play mailer plugin but keep getting this error:
[ClassNotFoundException: play.api.libs.mailer.CommonsMailerPlugin]
I asm using this dependenct:
"com.typesafe.play" %% "play-mailer" % "3.0.1"
And this plugin:
1500:play.api.libs.mailer.CommonsMailerPlugin
Any idea how to fix that?
I removed these lines in play.plugins file and clean the project (delete target and project folders) and it works for me.

How install and use scalaj-http

I have an assignment to use some http client. I am planning to use scalaj-http for that. The installation page for that https://github.com/scalaj/scalaj-http, it says:
Installation
in your build.sbt
libraryDependencies += "org.scalaj" %% "scalaj-http" % "1.1.4"
But nothing is clearly mention, where do i need to do and what needs to be done? Is it command, or we have to paste this somewhere.
Can someone explain in detail?
You need to create an SBT project and add that library dependency in your build file. This link should help you to get started: http://www.scala-sbt.org/0.13/tutorial/Hello.html

How to use JavaCV from SBT (Simple Build Tool) in Scala?

how to use JavaCV from SBT (Simple Build Tool) in Scala? I need to use JavaCV so I can write a Scala application using this.
Simple Build Tool is here: http://www.scala-sbt.org/
JavaCV is here: http://code.google.com/p/javacv/
Add the following to your build.sbt file.
resolvers += "JavaCV maven repo" at "http://maven2.javacv.googlecode.com/git/"
libraryDepedencies += "com.googlecode.javacv" % "javacv" % "0.2"
This should pull down javacv for you, as well as any dependencies. Note you will still need to have all the native libraries set up like javacv details, this only gets the jars for your project.
I created an SBT plugin that solves most of this for you in 1 line; no need to set up native libraries etc because this will do it all for you.
https://github.com/lloydmeta/sbt-opencv
Usage:
Add the following in project/plugins.sbt:
addSbtPlugin("com.beachape" % "sbt-opencv" % "1.2")