Questions tagged [playframework-webservice]

8 questions
2
votes
1 answer

Converting WebSockets in Play framework from version 2.4 to 2.6

I'm trying to convert this code, that uses the Play version 2.4 to the current version (2.6) and I'm having some issues because I'm still a noob in Scala. def wsWeatherIntervals = WebSocket.using[String] { request => val url =…
1
vote
2 answers

scala future null pointer match error

New to scala futures I try to call a web service like wsClient.url(baseUrl + url).withHeaders("Content-Type" -> "application/json").post(dataForR).flatMap(parseOutlierResponse) using ply-ws library I validate & map the response as follows…
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
1
vote
1 answer

Get images from other website

I am trying to get images, but the problem is that the thing I am getting are not all images and some images are too small to see. def webService(url: String) = Action.async { implicit request => WS.url("http://" + url).get().map { response => …
Govind Singh
  • 15,282
  • 14
  • 72
  • 106
0
votes
1 answer

Play 2.4.2 JavaWs giving null

I am trying to use JavaWs in play 2.4 for that I have added javaWs to dependence then added @Inject static WSClient ws; to my controller. But the problem is that if I do Logger.info(ws); inside my controller method its printing null in console. I…
0
votes
1 answer

Set content length header in java play framework http request

I am using play 2.5.x ws library for a file upload to an internal server. I have sample code working with apache http/curl/postman. But when I try to use ws library some how its failing. I don't have access to the internal server and its not…
0
votes
1 answer

Scala Play framework points multiple trust managers at the PEM file using Play WS

I want to use Play WS to invoke multiple other services in my application. Given this docs, https://www.playframework.com/documentation/2.4.x/WSQuickStart I know how to point trust manager at the PEM file. But question here is how about I want to…
ttt
  • 3,934
  • 8
  • 46
  • 85
0
votes
2 answers

PlayFramework. How to upload a photo using an external endpoint?

How do I upload a photo using a URL in the playframework? I was thinking like this: URL url = new URL("http://www.google.ru/intl/en_com/images/logo_plain.png"); BufferedImage img = ImageIO.read(url); File newFile = new…
0
votes
1 answer

posting form data with javaws in play

Hy, I want to do calls to a different rest api from my play application. I'm using the javaws included library. The specific call requires that I send form data. However I have no idea how I can send the correct data along with my request. As far…
genz
  • 35
  • 2
  • 6