Skip to Content
0
Oct 14, 2019 at 04:04 PM

Error-calling an OData service using proxy classes of SAP cloud-platform for iOS.

150 Views

let provider = OnlineODataProvider(serviceName: "API_OUTBOUND_DELIVERY_SRV", serviceRoot: "https://my300942-api.s4hana.ondemand.com/sap/opu/odata/sap/API_OUTBOUND_DELIVERY_SRV/")

//APIOUTBOUNDDELIVERYSRVEntities is the part of proxy generated classes

let service = APIOUTBOUNDDELIVERYSRVEntities(provider: provider)

do

{

let data2 = try service.fetchAOutbDeliveryHeader()

print(data2)

}

catch

{

print(error.localizedDescription)

}

Below is the error getting :

Expected response with DataServiceVersion 2.0, header not found! This error can be disabled by setting serviceOptions.checkVersion = false. But first, the provider URL should be checked in case this client is accidentally communicating with the wrong service version.