You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then I create the file src/main/scala/Test.scala with this content:
import generated._
import scala.concurrent._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
object Test extends App {
val authenticateService =
new WOKMWSAuthenticateServiceSoapBindings with
scalaxb.Soap11ClientsAsync with
scalaxb.DispatchHttpClientsAsync {}
.service
val authenticateFutureResponse: Future[AuthenticateResponse] = authenticateService.authenticate()
val authenticateResponse = Await.result(authenticateFutureResponse, 5 seconds)
println(authenticateResponse)
val searchService =
new WokSearchLiteServiceSoapBindings with
scalaxb.Soap11ClientsAsync with
scalaxb.DispatchHttpClientsAsync {}
.service
val queryParameters = QueryParameters(databaseId = "WOS", userQuery = "DO='10.1126/science.1227970'", queryLanguage = "en")
val retrieveParameters = RetrieveParameters(firstRecord = 1, count = 5, Seq(SortField(name = "RS", sort = "D")))
val searchFutureResponse = searchService.search(queryParameters, retrieveParameters)
println("AAA1")
val searchResponse = Await.result(searchFutureResponse, 5 seconds)
println("AAA2")
println(searchResponse)
}
This works well on the first call to authenticateService.authenticate(), but it fails on searchService.search, between printing AAA1 and AAA2, with:
AuthenticateResponse(Some(R15ACHlb2emby3TZZZZ))
AAA1
Exception in thread "main" java.util.NoSuchElementException: head of empty list
at scala.collection.immutable.Nil$.head(List.scala:428)
at scala.collection.immutable.Nil$.head(List.scala:425)
at scalaxb.Soap11Fault.$anonfun$asFault$1(soap11_async.scala:6)
at scala.Option.map(Option.scala:146)
at scalaxb.Soap11Fault.asFault(soap11_async.scala:5)
at generated.XMLProtocol$WokSearchLiteServiceSoapBindings$WokSearchLiteServiceSoapBinding.$anonfun$search$2(xmlprotocol.scala:796)
at scala.concurrent.Future.$anonfun$transform$3(Future.scala:240)
at scala.concurrent.Future.$anonfun$transform$1(Future.scala:240)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:140)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.pollAndExecAll(ForkJoinPool.java:1021)
at java.util.concurrent.ForkJoinPool$WorkQueue.execLocalTasks(ForkJoinPool.java:1046)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1058)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Any idea?
Does this look like scalaxb bug, or a web server bug, or a bug on my code?
I am trying to call the Web of Science SOAP web service using scalaxb wsdl, as follows:
then I create the file
src/main/scala/Test.scala
with this content:This works well on the first call to
authenticateService.authenticate()
, but it fails onsearchService.search
, between printingAAA1
andAAA2
, with:Any idea?
Does this look like
scalaxb
bug, or a web server bug, or a bug on my code?Question posted in stackoverflow: https://stackoverflow.com/questions/47187224/scalaxb-soap-client-fails-with-a-strange-exception
The text was updated successfully, but these errors were encountered: