语言

Menu
Sites
Language
Web Service is not working

I am trying to make a web service using SDK 2.3. But when i try to launch the service it sends me a not found error like-"given package is not found".

I have tried serveral times changing the code, but seems the service is not being registered from config.xml-

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/WebService" version="1.0.0" viewmodes="maximized">
    <tizen:application id="9ym34mMJmK.WebService" package="9ym34mMJmK" required_version="2.3"/>
    <feature name="http://tizen.org/feature/screen.size.all"/>
    <icon src="icon.png"/>
    <name>WebService</name>
    <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
    <tizen:profile name="mobile"/>
    <tizen:service id="9ym34mMJmK.Service" on-boot="true" auto-restart="true">
        <tizen:content src="js/service1.js"/>

        <tizen:name>WebService1</tizen:name>
    </tizen:service>
</widget>

----------------------------------------------------------------

i am trying to launch this service using following code-

    tizen.application.launchAppControl(new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/service"),
            "9ym34mMJmK.Service",
            function() {alert("Launch Service succeeded"); },
            function(e) {alert("Launch Service failed : " +e.type + " : " +  e.message);});

Is anything wrong? Do i need to do something additional? 

编辑者为: Hafijur Rahaman 12 11月, 2014

响应

9 回复
Marco Buettner
<tizen:application id="9ym34mMJmK.WebService" package="9ym34mMJmK" required_version="2.3"/>
tizen.application.launchAppControl(new tizen.ApplicationControl("http://tizen.org/appcontrol/operation/service"),
            "9ym34mMJmK.Service",
            function() {alert("Launch Service succeeded"); },
            function(e) {alert("Launch Service failed : " +e.type + " : " +  e.message);});

You id is "9ym34mMJmK.WebService" not "9ym34mMJmK.Service" like on your launchAppControl ;)

Hafijur Rahaman

Thank you for quick reply.

I tried with "9ym34mMJmK.WebService" also  but this launches only the application not the service. I have an alert in "service1.js"  -

module.exports.onStart = function()
{

      alert('module.exports.onStart called');

      .......

}

Marco Buettner

Sorry, it was my fault. As your wrote on init post your id is 9ym34mMJmK.Service for the service. As I know the service will launch directly after the installation and like your write it on your config.xml (on-boot and auto-restart).

With the launchAppControl I think your are not able to launch the services.

You have also dont to forget that a service application has no USER INTERFACE (alerts will can not show) ;)

On Tizen 2.2 you have in the settings menu a option to show currently installed and running application (it calls manage downloaded apps or something like that) maybe on Tizen 2.3 you have a similar function for that? You have to check if the 9ym34mMJmK.WebService and 9ym34mMJmK.Service runs ;)

I have not installed Tizen 2.3 yet so I do not know how to connect the service with the web apps ... maybe like on native services via MessagePort

Kyle de Lanerolle

I am having the same issue. Have been fighting with this for a while. Did you find what's causing this? Tizen development is frustrating at best unfortunately

Marco Buettner

AFAIK WebService only available for wearables... Pls check if u setup the profile to "wearable" and not to "mobile"

Kyle de Lanerolle

Hi Marco, thanks for the quick response. I assume you are talking about the DeviceType when registering for the certificate. I only see 2 options there. "Mobile/Wearable" and "TV". And the current selection is "Mobile/Wearable" and I don't see how I can separate the two. 

Kyle de Lanerolle

Bit more info: My project is a wearable project and I am running this app on a Gear S2. I tried with a Public certification and then with Partner Level certificate. The result is the same. When I try to launch the service, I experience the exact behavior described by the original post.

daniel kim

Hi,

I would suggest you to refer to this link. It seems that Gear S2 doesn't support web service for now.

   https://developer.tizen.org/forums/web-application-development/full-service-application-example?tab=active

Regards

Kyle de Lanerolle

Hi Daniel, Thanks for your response.

So the documentation says Web Service is supported on wearable devices running 2.3 or higer. Gear S2 is running 2.3.1. It also says that you need a partner lever certificate. I registered my device for a partner level certificate and that's what I am using for this.

The thread you mentined has a comment saying that Gear S2 doesn't support web services but there is no mention of where that info is coming from. I am following the Web Service Application Guide (https://developer.tizen.org/dev-guide/wearable/2.3.0/org.tizen.wearable.web.appprogramming/html/guide/service_guide/service_app.htm) so web services must be supported on something. AFAIK, gear S2 is the only wearable device running 2.3 or higher for now.

Is tizen support team (if there is such a thing) involved in these forums? I would love to get some insight on this.