2 Replies Latest reply on Jul 20, 2016 5:20 AM by rkandasamy RSS
    shashikanta Explorer

    How to expose local java service implementation in metadata.xml for Thing shape ? Used ServiceDefinition/ServiceImplementation/HandlerDefinitions. There is error "No service handler defined for service"

    Want to define a ThingShape that has a local java method (not java script) exposed as service. Hence the ThingShape class has the required method with annotation ThingworxServiceDefinition/ThingworxServiceResult..

    Want to expose The same method is then added in metadata.xml so that service is available to things. Tried to use Reflection Handler definition and it lists the service on thing shape as well as thing created using the thing shape defined. However when we test, it return the error ..

    Unable to Invoke Service PTCGetAllThingsData on Mt2 : No service handler defined for service PTCGetAllThingsData on thing [Mt2]



    Server method declaration in Thing Shape ...

    @ThingworxServiceDefinition( isLocalOnly=true, name="PTCGetAllThingsData", description="Get implementing things" )

      @ThingworxServiceResult( name="Result", description="Result", baseType="STRING" )

      public String PTCGetAllThingsData () throws Exception {





    The example metadata.xml







      <ThingPackage name="PTCThingShapeExtPackage" description="Sample Extension" className="com.ptc.exps.PTCThingShapeExp" aspect.isSystemObject="false" aspect.isCreatable="true" >



                <HandlerDefinition name="Reflection" className="com.ptc.exps.PTCThingShapeExp"/>




      <FileResource type="JAR" file="thingworx-ptcthingshape-extension.jar" description="PTC ThingShape Extension Package JAR" />







      <ThingShape name="PTCThingShapeExp" description="PTC Thing Shape Extension" className="com.ptc.exps.PTCThingShapeExp" aspect.isSystemObject="false" thingPackage="PTCThingShapeExtPackage">


      <ServiceDefinition aspect.isAsync="false" description="sds" isAllowOverride="false" isLocalOnly="false" isOpen="false" isPrivate="false" name="PTCGetAllThingsData">

                <ResultType baseType="STRING" description="" name="result"/>




      <ServiceImplementation handlerName="Reflection" name="PTCGetAllThingsData" allowOverride="false" />