Skip to Content
0
Jan 11, 2021 at 07:38 AM

Error accessing OData Service after Migration of project from WebIDE to Business Application Studio

101 Views

Hi Community,

we want to migrate our fiori applications from SAP CP Neo, developed in WebIDE, to SAP CloudFoundry (CF) and Business Application Studio (BAS).

For that in i followed the instructions "Migrating HTML5 Applications from SAP Cloud Platform Neo to the Cloud Foundry Environment" in help.sap.com. This guide shows in different steps how to migrate an HTML5 app (which of course all our Fiori apps are) to SAP CF.

The only thing i changed is, that our source app in Neo does not need authentication (because authentication is implementend in the used OData Services).

After migration i'm able to start the app in BAS, BUT it does not run correctly because it is not able to access the OData-Service. I only get the following error:

I removed the leading "/" in requesturi of datasource part in manifest.json as descripted in the instruction guide (i of course also tried to not remove the leading "/").

The used destination itself works. I tested it by creating a new project from template and in the step of the wizzard where to choose a service of a destination, all services where selectable.

My Workspace looks like this, where "md" is my html module, containing the webapp folder. So the folder "md" contains my imported WebIDE project (here i already deleted neo-app.json which is not used in BAS)

Here is my file xs-app.json from my hmtl5-module directory:

{
    "welcomeFile": "/index.html",
    "authenticationMethod": "none",
    "logout": {
        "logoutEndpoint": "/do/logout"
    },
    "routes": [
        {
            "source": "^(.*)$",
            "target": "$1",
            "service": "html5-apps-repo-rt",
            "authenticationType": "none"
        },
        {
            "source": "^/sap/opu/odata(.*)$",
            "destination": "<mydestination>",
            "target": "$1"
        }
    ]
}

where <mydestination> is replaced with the name of my real destination.

My mta.yaml looks like this:

_schema-version: "3.2"
ID: personnelfile
version: 0.0.1
modules:
- name: personnelfile-destination-content
  type: com.sap.application.content
  requires:
  - name: my_destination_service
    parameters:
      content-target: true
  - name: personnelfile_html_repo_host
    parameters:
      service-key:
        name: personnelfile_html_repo_host-key
  build-parameters:
    no-source: true
- name: personnelfile_ui_deployer
  type: com.sap.application.content
  path: .
  requires:
  - name: personnelfile_html_repo_host
    parameters:
      content-target: true
  build-parameters:
    build-result: resources
    requires:
    - artifacts:
      - md-content.zip
      name: md
      target-path: resources/
- name: md
  type: html5
  path: md
  build-parameters:
    builder: custom
    commands:
    - npm run build
    supported-platforms: []
resources:
- name: my_destination_service
  type: org.cloudfoundry.managed-service
  parameters:
    service-plan: lite
    service: destination
    path: config.json
- name: my_connectivity_service
  type: org.cloudfoundry.managed-service
  parameters:
    service-plan: lite
    service: connectivity
- name: personnelfile_html_repo_host
  type: org.cloudfoundry.managed-service
  parameters:
    service: html5-apps-repo
    service-name: personnelfile-html5-app-host-service
    service-plan: app-host
build-parameters:
  before-all:
  - builder: custom
    commands:
    - npm install



As descripted in mta.yaml the destination configuration is in config.json which looks like this:

{
    "init_data": {
        "subaccount": {
            "existing_destinations_policy": "update",
            "destinations": [
                {
                    "Name": "<mydestination>",
                    "WebIDEEnabled": "true",
                    "sap-client": "100",
                    "WebIDEUsage": "odata_abap,dev_abap,ui5_execute_abap",
                    "WebIDESystem": "<mysid>",
                    "Authentication": "PrincipalPropagation",
                    "ProxyType": "OnPremise",
                    "Type": "HTTP",
                    "URL": "http://<myvirthost>:<port>"
                }
            ]
        }
    }
}

where again <mydestination>,<mysid>,<myvirthost> are replaced my real values.

Does anyone know what i maybee missed or what could be wrong or has an idea what to try?

That would be great.

Kind regards
Matthias

Attachments

wjgjy.png (12.5 kB)
gdzyy.png (23.1 kB)