- Where does the code lies for Provider Hosted App? does it lie in
The code for provider hosted app lies in remote web. Remote web is a web application that is hosted outside sharepoint server. For on prem installations one needs to set up high trust between sharepoint and remote web using certificates.
- How should we call the web services for Provider hosted app?
As remote web and sharepoint host site collection lie in different domains you need to use cross domain library (SP.RequestExecutor) to make cross domain calls to Sharepoint host site collection using REST APIs.
- Can we write JSOM in Provider hosted app?
Yes we can write JSOM in PHA. However you need to load sharepoint client libraries - sp.js and sp.runtime.js
Hope your queries are resolved !!