Uploading Data Service with REST when try it got "The endpoint reference (EPR) for the Operation not found"

285 views Asked by At

I'm trying DSS 3.2.1 and upload to server Pais.dbs file, but when try to test the REST resource with GET to url http://www.example.org:9763/services/Pais.HTTPEndpoint/Pais got the error:

<soapenv:Reason xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
   <soapenv:Text xml:lang="en-US">The endpoint reference (EPR) for the Operation not found is /services/Pais.HTTPEndpoint/Pais and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.</soapenv:Text>
</soapenv:Reason>

Calling through SOAP works like expected.

If I construct the DBS using import the REST resources works. Its something wrong with my .dbs file or maybe a BUG with the way I constructed the .dbs file?

Pais.dbs

<data name="Pais" serviceNamespace="http://www.example.org/systemx/ds">
<config id="default">
    <property name="carbon_datasource_name">SYSTEMX_DB</property>
</config>
<query id="getPaisByIdQuery" useConfig="default">
    <sql>select id, codigo, nome, sigla, codigoBacen, codigoSiscomex  from Pais where id=:id</sql>
    <param name="id" ordinal="1" paramType="SCALAR" sqlType="INTEGER" type="IN"/>
    <result element="resultado" rowName="Pais">
        <element column="id" name="id" xsdType="integer"/>
        <element column="codigo" name="codigo" xsdType="integer"/>
        <element column="nome" name="nome" xsdType="string"/>
        <element column="sigla" name="sigla" xsdType="string"/>
        <element column="codigobacen" name="codigoBacen" xsdType="integer"/>
        <element column="codigosiscomex" name="codigoSiscomex" xsdType="integer"/>
    </result>
</query>
<query id="getAllPaisQuery" useConfig="default">
    <sql>select id, codigo, nome, sigla, codigoBacen, codigoSiscomex  from Pais</sql>
    <result element="resultado" rowName="Pais">
        <element column="id" name="id" xsdType="integer"/>
        <element column="codigo" name="codigo" xsdType="integer"/>
        <element column="nome" name="nome" xsdType="string"/>
        <element column="sigla" name="sigla" xsdType="string"/>
        <element column="codigobacen" name="codigoBacen" xsdType="integer"/>
        <element column="codigosiscomex" name="codigoSiscomex" xsdType="integer"/>
    </result>
</query>
<query id="updatePaisQuery" useConfig="default">
    <sql>update Pais set codigo=:codigo, nome=:nome, sigla=:sigla, codigobacen=:codigoBacen, codigosiscomex=:codigoSiscomex  where id=:id</sql>
    <param name="id" sqlType="INTEGER"/>
    <param name="codigo" sqlType="INTEGER"/>
    <param name="nome" sqlType="STRING"/>
    <param name="sigla" sqlType="STRING"/>
    <param name="codigoBacen" sqlType="INTEGER"/>
    <param name="codigoSiscomex" sqlType="INTEGER"/>
</query>
<query id="createPaisQuery" returnGeneratedKeys="true" useConfig="default">
    <sql>insert into Pais (codigo, nome, sigla, codigoBacen, codigoSiscomex ) values (:codigo, :nome, :sigla, :codigoBacen, :codigoSiscomex )</sql>
    <result element="resultado" rowName="Pais" useColumnNumbers="true">
        <element column="1" name="id" xsdType="integer"/>
    </result>
    <param name="codigo" sqlType="INTEGER"/>
    <param name="nome" sqlType="STRING"/>
    <param name="sigla" sqlType="STRING"/>
    <param name="codigoBacen" sqlType="INTEGER"/>
    <param name="codigoSiscomex" sqlType="INTEGER"/>
</query>
<query id="deletePaisQuery" useConfig="default">
    <sql>delete Pais where id=:id</sql>
    <param name="id" ordinal="1" paramType="SCALAR" sqlType="INTEGER" type="IN"/>
</query>
<!--  SOAP -->
<operation name="getPais">
    <call-query href="getPaisByIdQuery">
        <with-param name="id" query-param="id"/>
    </call-query>
</operation>
<operation name="getAllPais">
    <call-query href="getAllPaisQuery"/>
</operation>
<operation name="insertPais">
    <call-query href="createPaisQuery">
        <with-param name="codigo" query-param="codigo"/>
        <with-param name="nome" query-param="nome"/>
        <with-param name="sigla" query-param="sigla"/>
        <with-param name="codigoBacen" query-param="codigoBacen"/>
        <with-param name="codigoSiscomex" query-param="codigoSiscomex"/>
    </call-query>
</operation>
<operation name="updatePais">
    <call-query href="updatePaisQuery">
        <with-param name="id" query-param="id"/>
        <with-param name="codigo" query-param="codigo"/>
        <with-param name="nome" query-param="nome"/>
        <with-param name="sigla" query-param="sigla"/>
        <with-param name="codigoBacen" query-param="codigoBacen"/>
        <with-param name="codigoSiscomex" query-param="codigoSiscomex"/>
    </call-query>
</operation>
<operation name="deletePais">
    <call-query href="deletePaisQuery">
        <with-param name="id" query-param="id"/>
    </call-query>
</operation>
<!--  REST -->
<resource method="GET" path="Pais/{id}">
    <call-query href="getPaisByIdQuery">
        <with-param name="id" query-param="id"/>
    </call-query>
</resource>
<resource method="GET" path="Pais">
    <call-query href="getAllPaisQuery"/>
</resource>
<resource method="POST" path="Pais">
    <call-query href="createPaisQuery">
        <with-param name="codigo" query-param="codigo"/>
        <with-param name="nome" query-param="nome"/>
        <with-param name="sigla" query-param="sigla"/>
        <with-param name="codigoBacen" query-param="codigoBacen"/>
        <with-param name="codigoSiscomex" query-param="codigoSiscomex"/>
    </call-query>
</resource>
<resource method="PUT" path="Pais">
    <call-query href="updatePaisQuery">
        <with-param name="id" query-param="id"/>
        <with-param name="codigo" query-param="codigo"/>
        <with-param name="nome" query-param="nome"/>
        <with-param name="sigla" query-param="sigla"/>
        <with-param name="codigoBacen" query-param="codigoBacen"/>
        <with-param name="codigoSiscomex" query-param="codigoSiscomex"/>
    </call-query>
</resource>
<resource method="DELETE" path="Pais/{id}">
    <call-query href="deletePaisQuery">
        <with-param name="id" query-param="id"/>
    </call-query>
</resource>

DDL for pais table

CREATE TABLE "public"."pais"
(
   id int PRIMARY KEY NOT NULL,
   codigo int,
   nome varchar(60),
   sigla varchar(3),
   codigobacen int,
   codigosiscomex int
)
;
CREATE UNIQUE INDEX pais_pkey ON "public"."pais"(id)
;
1

There are 1 answers

0
Chanikag On

Please specify the resource name in simple letters. ie. "pais" instead of "Pais"