$metadata 404 (Not Found) when hosting SAPUI5 app that connects to WCF data serviceRSS

4 replies

Last post Apr 07, 2017 11:27 PM by jaldinger

  • $metadata 404 (Not Found) when hosting SAPUI5 app that connects to WCF data service

    Oct 21, 2016 04:50 PM|Hitman47|LINK

    I have been developing SAPUI5 app that connects to WCF data service written in C# and there was no problem in the development process till i started to host the SAPUI5 app on my local IIS i started to get the following error in chrome developer tools $metadata 404 (Not Found) whenever i tried to connect to the service  Error

    While in eclipse the code runs with no error No error

    and hosted it on my local IIS and things were more than perfect then i developed a client app with SAPUI5 framework and again it was so smooth with zero errors until i hosted my client app on the local IIS i started to get the following error $metadata 404 (Not Found)

    Server Error in '/' Application.


    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

    Requested URL: /proxy/http/mikmo.mylocalhost.com/MIKMOWCFDataService.svc/$metadata


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1073.0

    While developing i didnt get that error and i was developing the client app with Eclipse that uses Apache tomcat to run the SAPUI5 app

    Any help would be appreciated 

    Thanks in advance 

  • Rovastar Rovastar

    5469 Posts

    MVP

    Moderator

    Re: $metadata 404 (Not Found) when hosting SAPUI5 app that connects to WCF data service

    Oct 23, 2016 10:51 PM|Rovastar|LINK

    First you will need to know what type of 404 it is. The subcode will give you more info, check the IIS logs.

    Is it related to https://archive.sap.com/discussions/thread/3338924
    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: $metadata 404 (Not Found) when hosting SAPUI5 app that connects to WCF data service

    Oct 24, 2016 02:21 AM|Yuk Ding|LINK

    Hi Hitman47.

    The environment under developing and IIS is different.

    You may need to check the substatus code in IIS log.

    If the error is 404.3 then you could try the method in following link to enable WCF service in IIS 7:

    http://sinoy-sidharthan.blogspot.sg/2012/12/how-to-install-wcf-components-in-iis.html#!/2012/12/how-to-install-wcf-components-in-iis.html

    Please check The feature in Control panel->Programs->Turn Windows features on or off. Make sure the feature under .net 3.5 and .net4.5/WCF service/HTTP activation has been has been installed. Besides, please check whether Internet information services/Common HTTP features/Static content has been installed.

    If necessary, you could try to enable failed request tracing to get more detail about the error:

    https://www.iis.net/learn/troubleshoot/using-failed-request-tracing/troubleshooting-failed-requests-using-tracing-in-iis

    Best Regards,

    Yuk Ding

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.
  • Re: $metadata 404 (Not Found) when hosting SAPUI5 app that connects to WCF data service

    Apr 07, 2017 11:04 PM|jaldinger|LINK

    Hello Hitman47:

    I have exactly the same problem. I have developed an OData service in IIS and try to use it with UI5. While testing the UI, I get a 404 error when UI5 tries to load the .../$metadata document. Yet if I copy and paste the metadata URL into the browser, it works perfectly.

    Seems to me that IIS is blocking the $metadata request if a "Referer" is present in the HTTP header, even though everything is running on the same server and site.

    The specific error subcode I am getting is 404.0 by the way.

    Have you found a solution to your problem?

    Thanks,

    Joerg.

  • Re: $metadata 404 (Not Found) when hosting SAPUI5 app that connects to WCF data service

    Apr 07, 2017 11:27 PM|jaldinger|LINK

    Never mind, I figured out my mistake: I was using a UI5 OData model that only works up to version 3. Since my OData version on IIS was version 4, it would come back with a 404. After changing my UI5 model to V4, it started working...

    Regards,

    Joerg.