我正在尝试DSS 3.2.1并上传到服务器Pais.dbs文件,但是当尝试使用GET测试REST资源时,url http://www.example.org:9763/services/Pais.HTTPEndpoint/Pais收到了错误:
<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>
通过SOAP调用就像预期的那样。
如果我使用导入构建DBS,则REST资源有效。我的.dbs文件有问题,或者我构建.dbs文件的方式可能是BUG吗?
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>
用于pais表的DDL
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)
;
答案 0 :(得分:0)
请用简单的字母指定资源名称。即。 &#34; PAIS&#34;而不是&#34; Pais&#34;