Basbous
Basbous

Reputation: 3925

Consuming a Web Service not responding?

Trying to call web service in Tizen, it works in Tizen web simulator but it doesn't work in the device.

  1. jQuery script linke added :

    src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"

  2. Internet privilege added:

    tizen:privilege name="http://tizen.org/privilege/internet

  3. Request jQuery:

    jQuery.ajax({
            url:"www.ServiceURL.com",
            type:"POST",
            beforeSend: function (request)
            {
                request.setRequestHeader("ver", "2.0.2217");             
            },
            processData: false,
            success: function(msg) {
                alert("jQueryPost :: Result");
            }
    });
    

it's work in the simulator but not responded in the device ?

Upvotes: 1

Views: 1124

Answers (1)

Basbous
Basbous

Reputation: 3925

Any resource that it is accessed outside should be declared(see Accessing External Network Resources):

You cannot access external network resources by default (WARP: W3C Access Requests Policy). So, you must request permissions for the widget to retrieve network resources. You can enter several URLs by using the Add button on the Access tab. For each URL, you can indicate if you want to allow the widget to access the URL sub-domains. The Allow subdomain column contents can be toggled by mouse clicks. so it cannot work without having access to the specific resource needed in our case defined in config.xml:

<access origin="http://url_resource" subdomains="true"/>

or

<access origin="*" subdomains="true"/>

to let everything pass.

Reference

Upvotes: 1

Related Questions