Calling Progress OE web service using Javascript: Web Servic

Posted by fredj on 15-Jan-2015 09:42

Hi,

I'm trying to calling an OE web service using javascript and I encounter the 405 error http.

My website (http://myserver) is hosted on the same server that my web services (http://myserver:8080/wsa_h01/wsa1).

I read this post, which describes exactly my problem :

https://community.progress.com/community_groups/mobile/f/17/p/8558/32768.aspx#

Is anyone ever encountered this error? and how to solve ??? yet I set CORS in apache ....

Thanks for help !

Posted by fredj on 16-Jan-2015 07:02

Thanks Bronco for your response.

I applied this same parameters on my Apache Server, without result.

I found that it's possible to enable CORS filter on Tomcat.

I've actived CORS filter, and now it's works !

It's only 2 jar file to add on lib directory, declare CORS filter on web.xml, and done !

All Replies

Posted by Shelley Chase on 15-Jan-2015 09:49

Please call tech support and do a request for assistance so we can look into this.

Thanks

Shelley

Posted by fredj on 16-Jan-2015 01:36

Hi schase,

I've already call tech support, they told me to ask to community ....

Posted by bronco on 16-Jan-2015 02:24

Albeit this was the solution for AngularJs to node.js call I ended up setting the following headers:

"Access-Control-Allow-Origin": "*"

"Access-Control-Allow-Methods", "GET,POST"

"Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept"

However, that's not all I did to get this to work. What you might experience is that *before* your actual call is executed, a so called CORS preflight is done. This actually an HTTP OPTION request. The reason that this is happening is that you set more than the minimum set of HTTP headers. This is explained at this link:

www.html5rocks.com/.../cors

What you could do is to use Fiddler to see if there's an HTTP OPTION request and if so either narrow down the amount of headers you send or serve the HTTP OPTION request.

Does this help?

Posted by fredj on 16-Jan-2015 07:02

Thanks Bronco for your response.

I applied this same parameters on my Apache Server, without result.

I found that it's possible to enable CORS filter on Tomcat.

I've actived CORS filter, and now it's works !

It's only 2 jar file to add on lib directory, declare CORS filter on web.xml, and done !

Posted by bronco on 21-Jan-2015 07:31

just for completeness of the answer: which jar's did you add and what did you do exactly to the web.xml file?

edited: typo

Posted by fredj on 22-Jan-2015 02:27

For completing my answer :

- I download cors-filter-1.7.jar and java-property-utils-1.9.1.jar on $CATALINA_HOME/WEB-INF/lib directory.

- On the web.xml file, I insert these lines :

 <filter>

   <filter-name>CORS</filter-name>

   <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class>

 </filter>

 <filter-mapping>

   <filter-name>CORS</filter-name>

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

 </filter-mapping>

This thread is closed