cancel
Showing results for 
Search instead for 
Did you mean: 

Standard Fiori application, local testing and SimpleProxyServlet - doesn't work

Former Member
0 Kudos

Hello!

Trying to test a standard Fiori application in Eclipse using Tomcat 7.0.

I've use all available guides and googled it intensively, but it seems that SimpleProxyServlet doesn't work for me.

So my web.xml contains:

<servlet>

  <servlet-name>SimpleProxyServlet</servlet-name>

  <servlet-class>com.sap.ui5.proxy.SimpleProxyServlet</servlet-class>

</servlet>

<servlet-mapping>

  <servlet-name>SimpleProxyServlet</servlet-name>

  <url-pattern>/proxy/*</url-pattern>

</servlet-mapping>

<context-param>

  <param-name>com.sap.ui5.proxy.REMOTE_LOCATION</param-name>

  <param-value>http://mycompanyurl.ru:8000</param-value>

</context-param>


Component-preload.js:

---cut----


"hcm.emp.payslip.Configuration",

  {

  oServiceParams : {

  serviceList : [ {

  name : "SRA006_SRV",

  masterCollection : "Payslips",

  serviceUrl : "HCM_PS_MON/proxy/sap/opu/odata/sap/SRA006_SRV/",

  isDefault : true,

  mockedDataSource : "/hcm.emp.payslip/model/metadata.xml"

  } ]

  },


---cut----


I've tried various options like   serviceUrl : "/proxy/sap/opu/odata/sap/SRA006_SRV/",   serviceUrl : "proxy/sap/opu/odata/sap/SRA006_SRV/",   but nothing helps.

Always get something like "GET http://localhost:8080/proxy/sap/opu/odata/sap/SRA006_SRV/$metadata 404 (Not Found)"

Where should I put my vision to solve that strange behavior?

Accepted Solutions (1)

Accepted Solutions (1)

seVladimirs
Active Contributor
0 Kudos

Can you attach your web.xml here ?

Former Member
0 Kudos

Here you are

seVladimirs
Active Contributor
0 Kudos

Make sure that SimpleProxyServlet is working by following this steps:

1) Open your web.xml and find application name.

2) Try to access your OData service via tomcat's proxy (please make sure tomcat is up and running) - replace "mySuperApp" to applciation name you find in step 1.

http://localhost:8080/mySuperApp/proxy/sap/opu/odata/sap/SRA006_SRV/$metadata

Let us know about results.

Regards,

Vladimir

seVladimirs
Active Contributor
0 Kudos

Thanks! Just post some steps in case you would not share web.xml

Can you try to access your OData via tocmat's proxy ( I guess you are running your app on tomcat ? ) by openning following url in new browser tab

http://localhost:8080/HCM_PS_MON/proxy/sap/opu/odata/sap/SRA006_SRV/$metadata

Former Member
0 Kudos

When I access OData service in such way, everything is OK.

But when I'm using a sandbox launchpad (http://localhost:8080/HCM_PS_MON/test-resources/sap/ushell/shells/sandbox/fioriSandbox.html#HCM_PS_M..., got that error.

seVladimirs
Active Contributor
0 Kudos

Sweet - it show you that SimpleProxyServlet works as a charm and your application code should be adjusted accordingly.


Can you try to change serviceUrl in your Component.js to

/HCM_PS_MON/proxy/sap/opu/odata/sap/SRA006_SRV

and then try again... in case of error please make a screenshot of Chrome's console.

Former Member
0 Kudos

Hi! It works fine now.

Just a missing "/" give that error.

Thank you!

seVladimirs
Active Contributor
0 Kudos

Happy to hear. Cheers!

Former Member
0 Kudos

Hi Vladimirs,

may be do you have some experience to bind seleral odata services in one fiori project?

Could you please look at this request: How to bind Multi Model / OData Services in Fio... | SCN

Thanks in advance.

Regards,

Dmitry

Answers (0)