Page 1 of 3

Problems with proxy on tiggzi.net?

Posted: Fri Aug 17, 2012 11:21 am
by Ole Henrik Oftedal

Hi !

I finally reached this point where I can publish my small Mobil Web Application in tiggzi appbuilder.

In the devolment stage I've been using tiggzi proxy, and I havent had any problems with using my services located on Azure (domain cloudapp.net) and port 8082. All i ok now. Not any problems from many devices like the appbuilder test page in Safari/Iphone, from the apptester on Android and a modified native App for Android (without proxy settings).

But when I publish this app to tiggzi.net the service fails (onerror event is triggered).

Why is that?

regards

Ole H. Oftedal
Timeflex Systemer AS
http://www.timeflex.com
http://www.timeflex.no


Problems with proxy on tiggzi.net?

Posted: Fri Aug 17, 2012 10:42 pm
by maxkatz

When you published the app to tiggzi.net, do you still use the proxy?


Problems with proxy on tiggzi.net?

Posted: Sat Aug 18, 2012 8:48 am
by Ole Henrik Oftedal

I've tried both with and without. Same result.


Problems with proxy on tiggzi.net?

Posted: Sat Aug 18, 2012 2:05 pm
by Ole Henrik Oftedal

I think I managed to turn on Cross-origin resource sharing (CORS) on my REST server which makes it easier to test because pages are not that easily forbidden by the "same origin policy".

(Here's how I can reproduce an error now. I could be the same or another problem.)

First I set up my service. It is called FullName and returns my full name. I have Basic Authentication in the header so i put in this in the header. Max helped me with this some time ago.

Image

Then I use the Test button. (BTW is this test always performed through Tiggzi proxy independently of whats in the proxy checkbox?)

Image

Everything works fine. I don't have to use Tiggzi proxy so this is not turned on. But when I use this service and test it in the Mobile preview I get my own message from the Service Error event which I've just put there:

Image

Now I turn on Tiggzy proxy and use the Test button. This works !

Image

And finally I Publish my app to tiggzi.net and run it from Firefox or from my Android phone. Not working :-(

Image

If I remove my checkbox so that Authorization is not marked as Header then i don't get an error but then of course the system cannot find my full name.


Problems with proxy on tiggzi.net?

Posted: Sat Aug 18, 2012 2:26 pm
by maxkatz

The proxy helps with services that don't support cross-domain calls. As to why it doesn't work when you have the proxy on (and before turning on CORS for your service), I'm not sure. You should check the service response in Chrome browser Developer Tools (or in FIrebug).

http://help.tiggzi.com/documentation/...

The Test always works because it always uses the proxy. The cross-domain issue is only when sending an Ajax request from a page:

http://help.tiggzi.com/documentation/...


Problems with proxy on tiggzi.net?

Posted: Sun Aug 19, 2012 8:30 am
by Ole Henrik Oftedal

Ok. Thanks for all help Max! I think I'll redesign my whole app and API instead of using Basic Authentication. But this is so easy in Tiggzi and MS Word so that is no problem.

Instead of Basic Authentication and using the http header, I'll put in a kind of Key string in my URL. I dont know if this is best practice but I've seen this done in other REST API's.

I can of course do some testing if this scenario comes up again with some other customer. I can set up my REST server back to default and start testing on this. Just let me now.


Problems with proxy on tiggzi.net?

Posted: Tue Sep 18, 2012 12:50 pm
by Ole Henrik Oftedal

Hi again!

After a redesign a new challenge has arrived (or more correctly I assumed that it would be no problem sending data through the proxy at tiggzi.net).

What happens:
When I host my App at tiggzi.net and use a service with a http POST request, the service fails with this line displayed in Firebug:

NetworkError: 500 Internal Server Error

(I think this error is because the REST server is receiving none or illegal JSON data from the Proxy server. Maybe JSON object not defined.).

When I use the App with the normal Test button my Web app works perfect!!!

Is there any possibility that we can make the TEST Proxy server at Tiggzi work 100% the same way as the proxy server supporting "application".tiggzi.net.

(I don't see how I can "design" myself out of this one. So right now I'm kind of lost.)

Ole

Serviceinfo:
Name: MailboxUpdate
Method: Post
Data type: json
Content type: json


Problems with proxy on tiggzi.net?

Posted: Tue Sep 18, 2012 1:46 pm
by maxkatz

The Test and the proxy used when running the app is the same thing. What's the exact request you are sending so we can try it?


Problems with proxy on tiggzi.net?

Posted: Tue Sep 18, 2012 3:48 pm
by Ole Henrik Oftedal

Name: MailboxUpdate
Url: {Server}/datasnap/rest/tservermethods1/MailboxUpdate/{Authorization}
Method: Post
Data type: json
Content type: json
Parameters/data:
Server=h_t_t_p://ofto2.cloudapp.net:8082
(remove "_" in h t t p)
Authorization=E15F4429-E84A-4CD8-BA40-CC1DBE894034
BackInOfficeDate=21.08.2012

Image

Image

Image

Example:
(This should return a JSON Pair named Status and the last word in the text is Ok.)

Image


Problems with proxy on tiggzi.net?

Posted: Tue Sep 18, 2012 9:41 pm
by maxkatz

I tried but got the same response from a page (with proxy):

Image