No, that's ok, but the last two lines were missing from your original code.
However, you are setting the model twice: once to the core and once to the view. Does that has a special purpose?
Furthermore, because the closing bracket for the response handler is missing, I assume you set the object to the model within the response handler?
The error 'cannot access the url' is that thrown immediately, or after the OData request has finished successfully?
Since the view's iframe src {/pdfurl} does not exist until the OData request has finished successfully, I can imagine the Iframe initially tries to show a non-existing URL