3

I have developed an Oracle MAF iOS Mobile app and its failed calling web service when network is IPV6 compatible.

I have used below code for web service calling -

String restPayload = "";

RestServiceAdapter restServiceAdapter = Model.createRestServiceAdapter();
restServiceAdapter.clearRequestProperties();
restServiceAdapter.setConnectionName("PortPassConn");

//set GET, POST, DELETE, PUT
restServiceAdapter.setRequestType(httpMethod);

restServiceAdapter.addRequestProperty("Content-Type", "application/x-www-form-urlencoded");

restServiceAdapter.setRequestURI(requestURI);        
restServiceAdapter.setRetryLimit(0);    

//variable holding the response
String response = "";

//set payload if there is payload passed with the request
if(payload != null){   
     //send with empty payload
     restPayload  = payload;
}

try {
    response = (String) restServiceAdapter.send(restPayload);

} catch (Exception e) {

    MessageUtils.handleError("We encounter server side error, "+ e.getLocalizedMessage());
    //We encounter server side error, with http status code - 
    //log error
  //  Trace.log("REST_JSON",Level.SEVERE, this.getClass(),"invokeRestRequest", "Invoke of REST Resource failed for "+httpMethod+" to "+requestURI);
   // Trace.log("REST_JSON",Level.SEVERE, this.getClass(),"invokeRestRequest", e.getLocalizedMessage());
}

Getting error as:

"We encounter server side error, Network is unreachable."

Cœur
  • 37,241
  • 25
  • 195
  • 267
Santu C
  • 2,644
  • 2
  • 12
  • 20

0 Answers0