restcomm

Send SMS with RestComm-Connect Issue


I tried to send SMS using restcomm http api, it was successful when sent with Media_Type="application/x-www-form-urlencoded" from SOAPUI.

But while trying it with "application/json" it throws following error

01:00:22,439 SEVERE [com.sun.jersey.spi.container.ContainerRequest] (http-/127.0.0.1:8080-1) A message body reader for Java class javax.ws.rs.core.MultivaluedMap, and Java type javax.ws.rs.core.MultivaluedMap<java.lang.String, java.lang.String>, and MIME media type application/json was not found.

The registered message body readers compatible with the MIME media type are:
*/* ->
  com.sun.jersey.core.impl.provider.entity.FormProvider
  com.sun.jersey.core.impl.provider.entity.MimeMultipartProvider
  com.sun.jersey.core.impl.provider.entity.StringProvider
  com.sun.jersey.core.impl.provider.entity.ByteArrayProvider
  com.sun.jersey.core.impl.provider.entity.FileProvider
  com.sun.jersey.core.impl.provider.entity.InputStreamProvider
  com.sun.jersey.core.impl.provider.entity.DataSourceProvider
  com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$General
  com.sun.jersey.core.impl.provider.entity.ReaderProvider
  com.sun.jersey.core.impl.provider.entity.DocumentProvider
  com.sun.jersey.core.impl.provider.entity.SourceProvider$StreamSourceReader
  com.sun.jersey.core.impl.provider.entity.SourceProvider$SAXSourceReader
  com.sun.jersey.core.impl.provider.entity.SourceProvider$DOMSourceReader
  com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider$General
  com.sun.jersey.core.impl.provider.entity.XMLListElementProvider$General
  com.sun.jersey.core.impl.provider.entity.XMLRootObjectProvider$General
  com.sun.jersey.core.impl.provider.entity.EntityHolderReader

From documents it look like only Response could be XML or JSON.

Two Questions:-

  1. To get response in JSON we have to use URL ends with .json, same can be achieve by setting "Accept=application/json" header. Any specific reason to use URL approach?

  2. Why JSON request not supported?

    • application/json enter image description here

    • application/x-www-form-urlencoded enter image description here


Solution

  • Thanks for your question Imran,