According to ionic [1], CORS will be an issue if using "ionic serve" or
"ionic run -l", but shouldn't be an issue if using just "ionic run".

It might be worth dumping all the response headers coming back to see if
the 401 is from CORS or from a genuine rejection by Apache Isis.  You could
also put a break point in the IsisSessionFilter to see if it is Isis that
is rejecting the request, or whether it was denied earlier on by the web
server/CORS.

HTH
Dan

[1] http://blog.ionic.io/handling-cors-issues-in-ionic/


On 16 December 2015 at 19:40, Cesar Lugo <[email protected]> wrote:

> I was thinking it might be CORS too, I will check that way. Thank you!
> Cesar.
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Wednesday, December 16, 2015 1:39 PM
> To: [email protected]
> Subject: Re: Web service call
>
> hi Cesar,
>
>
>
> Sounds like CORS issue to me..
>
>
>
> grtz Johan
>
>
>
>
> ----- Original Message ----
>
> From: Cesar Lugo
>
> To:
>
> Sent: Din, 15 Dec 2015 19:47
>
> Subject: Web service call
>
>
>
>
>
>
> (function(){(window.hostMIF =
> parent.document.getElementById("ext-gen605").ownerCt)._windowContext={eval:function(s){return
> new Function("return ("+s+")")();}};})()
>
> Hello,
>
>
>
> I am calling Isis RO services from within my Ionic app, works great when
> calling from a local Ionic app (i.e.  ionic serve --lab). When I deploy it
> to the phone device, I need it to call the service using the IP address,
> the client is no longer in localhost. So this works:
>
>
>
> .factory('Business', function ($resource) {
>
>     return
> $resource('/restful/objects/simple.Business/:businessInstanceId',
> {}, {
>
>                get: {
>
>                                  method: 'GET',
>
>                                  headers: { 'Accept': 'application/json' }
>
>                              }
>
>            });
>
>
>
>
>
> But this does not, the RO service issues an 401 Unauthorized
>
>
>
> .factory('Business', function ($resource) {
>
>     return
> $resource('
> http://192.xxx.xxx.xxx:8080/restful/objects/simple.Business/:busi
> nessInstanceId', {}, {
>
>                get: {
>
>                                  method: 'GET',
>
>                                  headers: { 'Accept': 'application/json' }
>
>                              }
>
>            });
>
>
>
>
>
> Any ideas?
>
>
>
> Cesar.
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>
>
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
>

Reply via email to