Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import com.typesafe.config.ConfigFactory
val c = ConfigFactory.load().getConfig("gs")
import com.mcl.recipesearch.service._
val gsConf = GroceryServerConf(true, new java.net.URI(c.getString("endpoint")), c.getString("clientId"), c.getString("clientApiKey"))
import play.api.libs.ws.WSClientConfig
import play.api.libs.ws.DefaultWSClientConfig
import play.api.libs.ws.ssl.SSLConfig
import play.api.libs.ws.ning.NingAsyncHttpClientConfigBuilder
val clientConfig = new DefaultWSClientConfig()
val secureDefaults:com.ning.http.client.AsyncHttpClientConfig = new NingAsyncHttpClientConfigBuilder(clientConfig).build()
val builder = new com.ning.http.client.AsyncHttpClientConfig.Builder(secureDefaults)
builder.setCompressionEnabled(true)
val secureDefaultsWithSpecificOptions:com.ning.http.client.AsyncHttpClientConfig = builder.build()
implicit val implicitClient = new play.api.libs.ws.ning.NingWSClient(secureDefaultsWithSpecificOptions)
import play.api.libs.ws._
val wsClient: WSClient = implicitClient
import scala.concurrent.ExecutionContext.global
import concurrent._
import concurrent.duration._
val newConf = gsConf.copy(endpoint = new java.net.URI("http://meredith.groceryserver.com/"))
val gss = new GroceryServiceService(wsClient, newConf, global)
val res = gss.getLocalOffersForRecipe("1057", "64.25.209.197")
Await.result(res, 2.seconds)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment