4

I am developing a windows phone 8 silverlight application and I am using MFP v6.3

The following problem occurs.

If I make a call to a MobileFirst adapter and place the app in the background before that call returns, when I reactivate the app it crashes with this exception.

ExceptionObject {System.NullReferenceException: Object reference not set to an instance of an object.
   at IBM.Worklight.WLRequest.responseCallback(IAsyncResult asyncResult)
   at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClass1d.<InvokeGetResponseCallback>b__1b(Object state2)}  System.Exception {System.NullReferenceException}

This happens for any call I have tried.
Does anybody know why this exception is thrown?

Secondly, I would like to know if there is a way to cancel a call. So that I can do it when my app is deactivated.

EDIT: adding adapter call implementation

public void getInvoices(IShowAndProceed showAndProceedVM, JObject parameter)
        {
    String myContextObject = "MyAppWP8";
    WLRequestOptions invoicesOptions = new WLRequestOptions();
    invoicesOptions.setInvocationContext(myContextObject);
    WLProcedureInvocationData InvoicesInvocationData = new WLProcedureInvocationData("BillingAdapter", "MyInvoicesProcedure");
    InvoicesInvocationData.setParameters(new Object[] { parameter });

    WLClient.getInstance().invokeProcedure(InvoicesInvocationData, new InvoicesInvokeListener(showAndProceedVM), invoicesOptions);
}
Corcus
  • 1,070
  • 7
  • 25

1 Answers1

1

Question #1:
An exception sounds like a defect to me. It will be investigated, but it will help if you will edit the question and add your implementation (for the adapter procedure call).

Edit: Please open a PMR.

Question #2:
It is not possible to 'cancel' a MFP adapter request after it has been executed. You can submit a feature request.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89