SharePoint Basic Search Service 2010 API secondaryFileExtention field not present - soap

I am developing a client for SharePoint and I am implementing both 2013 and 2010 SharePoint SearchServices. I am having trouble with getting the secondaryFileExtension field.
Below my request for 2010 Search Service:
<QueryPacket Revision="1000">
<Query>
<Context>
<QueryText language="en-US" type="STRING">Audio SITE:"https://xxxxxxxxxxxxxxxxx.com/demo/testsp/Documents"
</QueryText>
</Context>
<SupportedFormats Format="urn:Microsoft.Search.Response.Document.Document"/>
<Range>
<StartAt>1</StartAt>
<Count>30</Count>
</Range>
<EnableStemming>true</EnableStemming>
<EnableSpellCheck>Suggest</EnableSpellCheck>
<IncludeSpecialTermsResults>true</IncludeSpecialTermsResults>
<IncludeRelevantResults>true</IncludeRelevantResults>
<ImplicitAndBehavior>true</ImplicitAndBehavior>
<TrimDuplicates>true</TrimDuplicates>
<Properties>
<Property name="Rank"/>
<Property name="Title" />
<Property name="Author"/>
<Property name="Size" />
<Property name="Path" />
<Property name="Description" />
<Property name="Write"/>
<Property name="SiteName" />
<Property name="HitHighlightedSummary"/>
<Property name="HitHighlightedProperties"/>
<Property name="ContentClass"/>
<Property name="IsDocument"/>
<Property name="FileExtension"/>
</Properties>
</Query>
</QueryPacket>
With the following SOAP envelope:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Query xmlns="urn:Microsoft.Search">
<queryXml>THE XML GOES HERE!</queryXml>
</Query>
</soap:Body>
</soap:Envelope>
I am getting the following response:
<Envelope>
<Body>
<QueryResponse>
<QueryResult><ResponsePacket xmlns="ur…</QueryResult>
</QueryResponse>
</Body>
</Envelope>
The QueryResult:
<Document>
<Action>
<LinkUrl fileExt="aspx">https://xxxxxxxxxxxxxxx…</LinkUrl>
</Action>
<Properties>
<Property>
<Name>Rank</Name>
<Type>Int64</Type>
<Value>67299882</Value>
</Property>
<Property>
<Name>Title</Name>
<Type>String</Type>
<Value>Audio 2014-01-18 19_10</Value>
</Property>
<Property>
<Name>Author</Name>
<Type>Object</Type>
<Value>Testsp</Value>
</Property>
<Property>
<Name>Size</Name>
<Type>Int64</Type>
<Value>62327</Value>
</Property>
<Property>
<Name>Path</Name>
<Type>String</Type>
<Value>https://xxxxxxxxxxxxxxxx.com/demo/testsp/Documents/Forms/DispForm.aspx?ID=1</Value>
</Property>
<Property>
<Name>Write</Name>
<Type>DateTime</Type>
<Value>2014-01-19T02:53:05</Value>
</Property>
<Property>
<Name>SiteName</Name>
<Type>String</Type>
<Value>https://xxxxxxxxxxxxxx…</Value>
</Property>
<Property>
<Name>HitHighlightedSummary</Name>
<Type>String</Type>
<Value><c0>Audio</c0> 2014-01-18…</Value>
</Property>
<Property>
<Name>HitHighlightedProperties</Name>
<Type>String</Type>
<Value><HHTitle><c0>Audio</c0> 2…</Value>
</Property>
<Property>
<Name>ContentClass</Name>
<Type>String</Type>
<Value>STS_ListItem_DocumentLibr…</Value>
</Property>
<Property>
<Name>IsDocument</Name>
<Type>Boolean</Type>
<Value>false</Value>
</Property>
<Property>
<Name>FileExtension</Name>
<Type>String</Type>
<Value>ASPX</Value>
</Property>
</Properties>
</Document>
But the property SecondaryFileExtention is not present (it should containg "acc" because of audio file type). The action tag contains the following link:
https://xxxxxxxxxxxxxxx.com/demo/testsp/Documents/Forms/DispForm.aspx?ID=1
When I go to this link I see a form with 2 fields name and title, and I can download the .acc file from.
Doing similar request with SharePoint 2013 Search Service returns the following properties for a pdf file:
<element m:type="SP.SimpleDataRow">
<Cells>
<element m:type="SP.KeyValue">
<Key>Rank</Key>
<Value>12.6491832733154</Value>
<ValueType>Edm.Double</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>DocId</Key>
<Value>4458265</Value>
<ValueType>Edm.Int64</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>WorkId</Key>
<Value>4458265</Value>
<ValueType>Edm.Int64</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>Title</Key>
<Value>W9</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>Author</Key>
<Value>Dmitry Ivahno;Test User1</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>Size</Key>
<Value>162678</Value>
<ValueType>Edm.Int64</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>Path</Key>
<Value>https://xxxxxxxxxxxx.co…</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>Description</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>Write</Key>
<Value>2013-05-23T14:18:46.00000…</Value>
<ValueType>Edm.DateTime</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>CollapsingStatus</Key>
<Value>0</Value>
<ValueType>Edm.Int64</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>HitHighlightedSummary</Key>
<Value xml:space="preserve">Form W-9 (Rev. Decembe…</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>HitHighlightedProperties</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>contentclass</Key>
<Value>STS_ListItem_DocumentLibr…</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>PictureThumbnailURL</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>ServerRedirectedURL</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>ServerRedirectedEmbedURL</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>ServerRedirectedPreviewUR…</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>FileExtension</Key>
<Value>pdf</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>ContentTypeId</Key>
<Value>0x010100FA0E9F7CB9E8B94DB…</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>ParentLink</Key>
<Value>https://xxxxxxxxxxx.co…</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>ViewsLifeTime</Key>
<Value>88</Value>
<ValueType>Edm.Int64</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>ViewsRecent</Key>
<Value>0</Value>
<ValueType>Edm.Int64</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>SectionNames</Key>
<Value/>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>SectionIndexes</Key>
<Value/>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>SiteLogo</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>SiteDescription</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>deeplinks</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>importance</Key>
<Value>0</Value>
<ValueType>Edm.Int64</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>SiteName</Key>
<Value>https://xfa.sharepoint.co…</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>IsDocument</Key>
<Value>true</Value>
<ValueType>Edm.Boolean</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>LastModifiedTime</Key>
<Value>2013-05-23T14:18:46.00000…</Value>
<ValueType>Edm.DateTime</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>FileType</Key>
<Value>pdf</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>IsContainer</Key>
<Value>false</Value>
<ValueType>Edm.Boolean</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>WebTemplate</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>SecondaryFileExtension</Key>
<Value>pdf</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>docaclmeta</Key>
<Value m:null="true"/>
<ValueType>Null</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>OriginalPath</Key>
<Value>https://xfa.sharepoint.co…</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>PartitionId</Key>
<Value>d4cd988f-8939-401f-82e9-8…</Value>
<ValueType>Edm.Guid</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>UrlZone</Key>
<Value>0</Value>
<ValueType>Edm.Int32</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>AAMEnabledManagedProperti…</Key>
<Value>AttachmentURI;deeplinks;D…</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>RenderTemplateId</Key>
<Value>~sitecollection/_catalogs…</Value>
<ValueType>Edm.String</ValueType>
</element>
<element m:type="SP.KeyValue">
<Key>piSearchResultId</Key>
<Value>0_1</Value>
<ValueType>Edm.String</ValueType>
</element>
</Cells>
Can I by any chance get the real file extension with SharePoint 2010 Search API?

I ran into a similar issue when making SharePoint 2010 SOAP calls to the search service (using SPServices). I had 2 custom fields - a subheader (single line of text) and an article category (managed metadata) - that I needed to show up in the search results, and all I was getting back was exactly what you listed (Rank through File Extension).
Those two fields had to be added as "managed properties" to be made available to come back in search results - the steps are here: http://technet.microsoft.com/en-us/library/ff621097(v=office.14).aspx (you'll need central administration-level access though).
Once my managed properties were in there, I ran into another snag because although I could see the managed properties available for search (using the FAST Search for SharePoint tool: http://fastforsharepoint.codeplex.com/), they weren't showing up in the results, even when I put them in the <Properties> list of the SOAP call.
The solution to this was actually to specify a wildcard with my subheader value in the <QueryText> field (note the "#")...this appeared to force those two fields to show up (the path condition is optional):
<QueryText language='en-US' type='STRING'>
My Search Phrase SubHeader:# AND path:/PathTo/My/SPSite
</QueryText>
Not sure if that's by design or if it's a "feature" in SharePoint to only return the field is something exists there and/or is requested.
There are probably more elegant solutions out there if you have server-level access, but this worked for me.

Related

Use an imported schema in my main schema with correct namespaces

I have a schema with a namespace 'http://myobjects' which I am importing to my main schema like that:
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://services">
<import schemaLocation="myobjects.xsd" namespace="http://myobjects" />
<element name="registerClaim">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="1" name="Claims">
<complexType>
<sequence>
<element minOccurs="1" maxOccurs="unbounded" name="Claim" xmlns:mo="http://myobjects" type="mo:Claim" />
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
Now, when I create a sample XML based on this schema, element 'Claim' is in 'http://services' namespace as expected and all of it's children are in '' namespace so it no longer validates with myobjects.xsd schema.
<ser:registerClaim xmlns:ser="http://services">
<ser:Claims>
<ser:Claim>
<documentData>
<policyData>
I'm trying to figure out how to modify my main XSD so the resulting XML would like like this:
<ser:registerClaim xmlns:ser="http://services" xmlns:mo="http://mybojects">
<ser:Claims>
<ser:Claim>
<mo:documentData>
<mo:policyData>
or like this:
<ser:registerClaim xmlns:ser="http://services">
<ser:Claims>
<ser:Claim xmlns="http://myobjects">
<documentData>
<policyData>
Thanks

How to get a variable from WSDL with mule setvariable and datamapper? Message payload is of type: HashMap

It should be simple but I can't set it working. My XML looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:ws="http://www.mulesoft.org/schema/mule/ws" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.6.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/ws http://www.mulesoft.org/schema/mule/ws/current/mule-ws.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
<http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
<ws:consumer-config name="Web_Service_Consumer" wsdlLocation="http://procese/sysworkflow/en/classic/services/wsdl2" service="ProcessMakerService" port="ProcessMakerServiceSoap" serviceAddress="http://procese:80/sysworkflow/en/classic/services/soap2" doc:name="Web Service Consumer"/>
<data-mapper:config name="JSON_To_XML" transformationGraphPath="json_to_xml.grf" doc:name="JSON_To_XML"/>
<flow name="ws_pm_login3Flow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>
<set-payload value="#[{"userid":"xyz.qwe", "password":"12345"}]" doc:name="Set Payload"/>
<data-mapper:transform config-ref="JSON_To_XML" doc:name="JSON To XML"/>
<ws:consumer config-ref="Web_Service_Consumer" operation="login" doc:name="Web Service Consumer"/>
</flow>
</mule>
The WS is working fine.
The mapper file json_to_xml.grf looks like:
<?xml version="1.0" encoding="UTF-8"?><Graph __version="3.5.0" author="abc" created="Tue Apr 21 13:27:56 EEST 2015" description="JSON To XML" guiVersion="3.4.4.P" id="1429614596881" licenseCode="Unlicensed" licenseType="Unknown" modified="Tue Apr 21 13:27:56 EEST 2015" modifiedBy="abc" name="JSON_To_XML" revision="1.0" showComponentDetails="false">
<Global>
<Metadata __index="0" __referenceCounter="1" __sourcePath="{}/login" _dataStructure="OBJECT" _id="__id" _type="Input" id="e941872a-c0e5-4148-ac8c-6010c4dad903">
<Record fieldDelimiter="," name="login" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
<Field __index="1" __sourcePath="{}/login/password" containerType="SINGLE" label="password" name="password" type="string"/>
<Field __index="0" __sourcePath="{}/login/userid" containerType="SINGLE" label="userid" name="userid" type="string"/>
</Record>
</Metadata>
<Metadata __index="0" __referenceCounter="1" __sourcePath="{}/login" _dataStructure="OBJECT" _id="__id" _type="Output" id="d9e5b0f6-b757-46cb-89bf-a7662be5c77f">
<Record fieldDelimiter="," name="login" recordDelimiter="\n\\|\r\n\\|\r" type="delimited">
<Field __artificialType="_id" __systemManaged="true" name="__id" type="string"/>
<Field __index="0" __sourcePath="{}/login/password" containerType="SINGLE" label="password" name="password" type="string"/>
<Field __index="1" __sourcePath="{}/login/userid" containerType="SINGLE" label="userid" name="userid" type="string"/>
</Record>
</Metadata>
<Dictionary>
<Entry id="DictionaryEntry0" input="true" name="inputPayload" output="false" type="object"/>
<Entry id="DictionaryEntry1" input="false" name="outputPayload" output="true" type="object"/>
</Dictionary>
</Global>
<Phase number="0">
<Node cacheInMemory="true" charset="UTF-8" enabled="enabled" fileURL="dict:outputPayload" guiName="XML WRITER" guiX="900" guiY="20" id="EXT_XML_WRITER0" type="EXT_XML_WRITER">
<attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<login xmlns:clover="http://www.cloveretl.com/ns/xmlmapping" clover:inPort="0">
<password>$0.password</password>
<userid>$0.userid</userid>
</login>]]></attr>
<attr name="_data_format"><![CDATA[XML]]></attr>
</Node>
<Node enabled="enabled" guiName="Foreach 'login' -> 'login'" guiX="460" guiY="20" id="FOREACH_LOGIN_LOGIN" transformClass="com.mulesoft.datamapper.transform.MelRecordTransform" type="REFORMAT">
<attr name="melScript"><![CDATA[//MEL
//START -> DO NOT REMOVE
output.__id = input.__id;
//END -> DO NOT REMOVE
output.password = input.password;
output.userid = input.userid;
]]></attr>
</Node>
<Node charset="UTF-8" enabled="enabled" fileURL="dict:inputPayload" guiName="JSON READER" guiX="20" guiY="20" id="JSON_READER0" type="JSON_READER">
<attr name="mapping"><![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Context xpath="/root">
<Context outPort="0" sequenceField="__id" xpath="object">
<Mapping cloverField="password" trim="true" xpath="password"/>
<Mapping cloverField="userid" trim="true" xpath="userid"/>
</Context>
</Context>
]]></attr>
<attr name="_data_format"><![CDATA[JSON]]></attr>
</Node>
<Edge debugMode="true" fromNode="FOREACH_LOGIN_LOGIN:0" guiBendpoints="" id="Edge1" inPort="Port 0 (in)" metadata="d9e5b0f6-b757-46cb-89bf-a7662be5c77f" outPort="Port 0 (out)" toNode="EXT_XML_WRITER0:0"/>
<Edge debugMode="true" fromNode="JSON_READER0:0" guiBendpoints="" id="Edge0" inPort="Port 0 (in)" metadata="e941872a-c0e5-4148-ac8c-6010c4dad903" outPort="Port 0 (out)" toNode="FOREACH_LOGIN_LOGIN:0"/>
</Phase>
</Graph>
When I start the process I get:
Error executing graph: ERROR (com.mulesoft.mule.module.datamapper.api.exception.DataMapperExecutionException). Message payload is of type: HashMap
I am using 3.6.1 EE
What am I missing?
Turns out it is a problem in mule to use the double quotes in JSON. I swithced to XML and now it is working fine.

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

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)
;
Please specify the resource name in simple letters. ie. "pais" instead of "Pais"

Error in XSD without namespace

I have two XSDs to bottom, the following situation is, I'm consuming a REST service and rode two XSDs to generate classes via JAXB, it happens that I have to get the targetNamespace of the two XSDs, because it seems that the service has no namespace when consumption attributes is null, the JAXB generated class called package-info.java
#javax.xml.bind.annotation.XmlSchema(namespace = "", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
Where I deleted the namespace as low (with XSDs with this target namespace), and it worked, but I have to take the XSDs, and in one of these I m using an element that points to the other. But giving this formatting error, I tried to import, but asks the namespace, both xsds are in the same directory
Error:
src-resolve.4.2: Error resolving component 'Block'. It was detected
that 'Block' is in namespace 'http://www.w3.org/2001/ XMLSchema', but
components from this namespace are not referenceable from schema
document 'file:///G:/Dev/src/main/xsd/Actor.xsd'. If this is the
incorrect namespace, perhaps the prefix of 'BlockList' needs to be
changed. If this is the correct namespace, then an appropriate
'import' tag should be added to 'file:///G:/Dev/
src/main/xsd/Actor.xsd'.
actor.xsd
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" >
<include schemaLocation="Block.xsd"/>
<complexType name="Actor">
<sequence>
<element name="type" type="string" maxOccurs="1"
minOccurs="1">
</element>
<element name="blockList" type="Block" maxOccurs="1"
minOccurs="1"></element>
<element name="characteristicList" maxOccurs="1"
minOccurs="1">
<complexType>
<sequence>
<element name="characteristic"
maxOccurs="unbounded" minOccurs="1">
<complexType>
<sequence>
<element name="id" type="long"></element>
<element name="name"
type="string">
</element>
<element name="value"
type="string">
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</schema>
Block.xsd
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" >
<complexType name="Block">
<sequence>
<element name="greyList" type="boolean"></element>
<element name="blackList" type="boolean"></element>
<element name="blockListTimeToExit" type="long"></element>
<element name="blockedEventList">
<complexType>
<sequence>
<element name="blockedEvent" type="string" maxOccurs="unbounded"
minOccurs="0"></element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</schema>
Change your XSDs in ...
actor.xsd
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="yourNamespace"
xmlns:prefix="yourNamespace">
<include schemaLocation="Block.xsd"/>
<complexType name="Actor">
<sequence>
<element name="type" type="string" maxOccurs="1" minOccurs="1">
</element>
<element name="blockList" type="prefix:Block" maxOccurs="1" minOccurs="1"></element>
<element name="characteristicList" maxOccurs="1" minOccurs="1">
<complexType>
<sequence>
<element name="characteristic" maxOccurs="unbounded" minOccurs="1">
<complexType>
<sequence>
<element name="id" type="long"></element>
<element name="name" type="string">
</element>
<element name="value" type="string">
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</schema>
Block.xsd
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="yourNamespace"
xmlns:apm="yourNamespace">
<complexType name="Block">
<sequence>
<element name="greyList" type="boolean"></element>
<element name="blackList" type="boolean"></element>
<element name="blockListTimeToExit" type="long"></element>
<element name="blockedEventList">
<complexType>
<sequence>
<element name="blockedEvent" type="string" maxOccurs="unbounded"
minOccurs="0">
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
</schema>
I added only the namespaces and prefix to use the type from the Block.xsd.

WSO2 Data Services Server REST configuration

First post to SO, hopefully, I get it right. :-)
And, new to WSO2DSS...
I'd like to configure WSO2DSS to expose REST services like, for example:
http://localhost/svcendpoint/products
http://localhost/svcendpoint/products/computer
http://localhost/svcendpoint/products/computer/disks
where each url returns a more refined list. I've set up three queries / operations / resources, but I'm not getting the expected results.
I am getting the list for the first, a Axis2 "String index out of range" exception for the second, and a list for the third.
I'm not sure if it is me, a bug, or the wrong way to do this. Any help would be appreciated.
Here is the .dbs file (I can include the exception stacktrace if it will be useful):
<data name="MyDataService">
<config id="MyDataSource">
<property name="driverClassName">oracle.jdbc.driver.OracleDriver</property>
<property name="url">jdbc:oracle:thin:xxxxxx</property>
<property name="username">xxx</property>
<property name="password">xxx</property>
</config>
<query id="MyCategoriesQuery" useConfig="MyDataSource">
<sql>select distinct CAT_NM from T_FAM_BLMBRG_DATA_DICT order by CAT_NM</sql>
<result defaultNamespace="http://test.org" element="categories" rowName="">
<element column="FLD_MNM_NM" name="FLD_MNM_NM" xsdType="string"/>
<element column="FLD_ID" name="FLD_ID" xsdType="string"/>
<element column="DATA_LIC_CAT_NM" name="DATA_LIC_CAT_NM" xsdType="string"/>
<element column="FLD_DESC_TX" name="FLD_DESC_TX" xsdType="string"/>
<element column="CAT_NM" name="CAT_NM" xsdType="string"/>
<element column="FLD_DFN_TX" name="FLD_DFN_TX" xsdType="string"/>
<element column="FLD_DATYP_NM" name="FLD_DATYP_NM" xsdType="string"/>
<element column="CRT_USER_ID" name="CRT_USER_ID" xsdType="string"/>
<element column="CRT_TS" name="CRT_TS" xsdType="string"/>
<element column="UPD_USER_ID" name="UPD_USER_ID" xsdType="string"/>
<element column="UPD_TS" name="UPD_TS" xsdType="string"/>
</result>
</query>
<query id="MyCategoryQuery" useConfig="MyDataSource">
<sql>select * from T_FAM_BLMBRG_DATA_DICT where CAT_NM = :cat</sql>
<result defaultNamespace="http://test.org" element="entries" rowName="">
<element column="FLD_MNM_NM" name="FLD_MNM_NM" xsdType="string"/>
<element column="FLD_ID" name="FLD_ID" xsdType="string"/>
<element column="DATA_LIC_CAT_NM" name="DATA_LIC_CAT_NM" xsdType="string"/>
<element column="FLD_DESC_TX" name="FLD_DESC_TX" xsdType="string"/>
<element column="CAT_NM" name="CAT_NM" xsdType="string"/>
<element column="FLD_DFN_TX" name="FLD_DFN_TX" xsdType="string"/>
<element column="FLD_DATYP_NM" name="FLD_DATYP_NM" xsdType="string"/>
<element column="CRT_USER_ID" name="CRT_USER_ID" xsdType="string"/>
<element column="CRT_TS" name="CRT_TS" xsdType="string"/>
<element column="UPD_USER_ID" name="UPD_USER_ID" xsdType="string"/>
<element column="UPD_TS" name="UPD_TS" xsdType="string"/>
</result>
<param name="cat" sqlType="STRING"/>
</query>
<query id="MyCategoryFldQuery" useConfig="MyDataSource">
<sql>select * from T_FAM_BLMBRG_DATA_DICT where CAT_NM = :cat and FLD_ID = :fld</sql>
<result defaultNamespace="http://test.org" element="names" rowName="">
<element column="FLD_MNM_NM" name="FLD_MNM_NM" xsdType="string"/>
<element column="FLD_ID" name="FLD_ID" xsdType="string"/>
<element column="DATA_LIC_CAT_NM" name="DATA_LIC_CAT_NM" xsdType="string"/>
<element column="FLD_DESC_TX" name="FLD_DESC_TX" xsdType="string"/>
<element column="CAT_NM" name="CAT_NM" xsdType="string"/>
<element column="FLD_DFN_TX" name="FLD_DFN_TX" xsdType="string"/>
<element column="FLD_DATYP_NM" name="FLD_DATYP_NM" xsdType="string"/>
<element column="CRT_USER_ID" name="CRT_USER_ID" xsdType="string"/>
<element column="CRT_TS" name="CRT_TS" xsdType="string"/>
<element column="UPD_USER_ID" name="UPD_USER_ID" xsdType="string"/>
<element column="UPD_TS" name="UPD_TS" xsdType="string"/>
</result>
<param name="cat" sqlType="STRING"/>
<param name="fld" sqlType="STRING"/>
</query>
<operation name="MyCategoriesService">
<call-query href="MyCategoriesQuery"/>
</operation>
<operation name="MyCategoryService">
<call-query href="MyCategoryQuery">
<with-param name="cat" query-param="cat"/>
</call-query>
</operation>
<operation name="MyCategoryFldService">
<call-query href="MyCategoryFldQuery">
<with-param name="cat" query-param="cat"/>
<with-param name="fld" query-param="fld"/>
</call-query>
</operation>
<resource method="GET" path="category">
<call-query href="MyCategoriesQuery"/>
</resource>
<resource method="GET" path="category/{cat}">
<call-query href="MyCategoryQuery">
<with-param name="cat" query-param="cat"/>
</call-query>
</resource>
<resource method="GET" path="category/{cat}/{fld}">
<call-query href="MyCategoryFldQuery">
<with-param name="cat" query-param="cat"/>
<with-param name="fld" query-param="fld"/>
</call-query>
</resource>
</data>
You need to invoke the service as shown below
http://localhost:9763/services/SERVIVENAME.HTTPEndpoint/RESOURCEPATH/
For example
http://localhost:9763/services/MyDataSource.HTTPEndpoint/category/computer
Please refer [1] for more details
https://docs.wso2.org/display/DSS310/Exposing+Data+as+REST-Style+Resources