Default value for base64Binary in XSD - base64

How do we define a default value in XSD for a base64binary element?
For ex : <xs:element name="file" type="xs:base64Binary" default=/>
WHAT can we use , if we want a default value of a question mark - "?"
We just need a ? in the default value so when we create a request
It should create something like this - char:file?</char:file>
Instead of this - char:filecid:1512219379916</char:file>
Your inputs will be of great help!
Thank you
-Ajay
I have tried few things , nothing is working
I have tried using - “#x20?”
I have tried using null
I have tried using an empty
We just need a ? in the default value so when we create a request
something like this - char:file?</char:file>

Related

How to change canonicalization method

does anyone know how to change the CanonicalizationMethod property in xadesjs? I know it is using xmldsigjs underneath but I cannot find a solution to change it. I mean the CanonicalizationMethod for the whole SignedInfo property (not the transforms for the references). Currently (by default) I get a document that has CanonicalizationMethod set to C14N:
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
I want to change it to EXC-C14N:
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
Is it even possible?
Ok, I've found a solution. In case anybody needs it, you can directly assign it with:
let signedXml = new XAdES.SignedXml();
signedXml.XmlSignature.SignedInfo.CanonicalizationMethod.Algorithm = "http://www.w3.org/2001/10/xml-exc-c14n#";

Marklogic faceted search and collations

I'm setting up a faceted search in MarkLogic. I have the following range indexes configured:
That is, I have two indexes. The first is on namespace http://www.corbas.co.uk/ns/presentations and local name keyword. The second has the local name level. The collation URI for both is http://marklogic.com/collation/en/S1.
When I try to search using the following I see errors related to collations:
xquery version "1.0-ml";
import module namespace search = "http://marklogic.com/appservices/search"
at "/MarkLogic/appservices/search/search.xqy";
search:search("levels:Intermediate",
<options xmlns="http://marklogic.com/appservices/search">
<return-results>true</return-results>
<return-facets>true</return-facets>
<constraint name="keywords" facet="true">
<range type="xs:string" collation="http://marklogic.com/collation/en/S1">
<element ns="http://www.corbas.co.uk/ns/presentations" name="keyword"/>
</range>
</constraint>
<constraint name="levels" facet="true">
<range type="xs:string" collation="http://marklogic.com/collation/en/S1">
<element ns="http://www.corbas.co.uk/ns/presentations" name="level"/>
</range>
</constraint>
</options>)
I get the following error:
XDMP-ELEMRIDXNOTFOUND: cts:search(fn:collection(),
cts:element-range query(fn:QName("http://www.corbas.co.uk/ns/presentations","level"),
"=", "Intermediate", ("collation=http://marklogic.com/collation/en/S1"), 1),
("score-logtfidf", "faceted", cts:score-order("descending")),
xs:double("1"), ()) -- No string element range index for
{http://www.corbas.co.uk/ns/presentations}level
collation=http://marklogic.com/collation/en/S1
What am I doing wrong?
Strange Message. If it even got that far, then it looks like your database default collation is changed. Does not answer the question. just strange.
Forst off, I would always add the collation to the constraint:
<search:range type="xs:string" facet="true"
collation="http://marklogic.com/collation/en/S1">
Second, I always troubleshoot range index issue from the query console:
use cts:values() to verify that your indexes are in place and in the namespace and collation you expect. This removes other layers and verifies that the index is as you expect.
And another item: MarkLogic range indexes do not exist until content is indexed. Are you sure you have not turned off auto-index on the database and perhaps content is not indexed? That would give you an error.
To be honest, I would have expected a different error message. I would have expected MarkLogic to complain it couldn't find an index for root collation, because you have not added collation attributes on the range elements in the search options.
Maybe adding those will help.
HTH!
It looks to me like your configuration is correct, which suggests to me that the problem is timing. Once you specify what indexes you want, MarkLogic gets to work creating them. If you run a query that requires those indexes before MarkLogic finishes creating them, you get this error. Depending on the amount of content you have, the creation process can be very quick or take hours.
To check the status, point your browser to the Admin UI (http://localhost:8001) and navigate to the configuration page for your database. Click on the Status tab and look for "Reindexing/Refragmenting State"—if MarkLogic is still reindexing, it will tell you so here and you'll get updates on its progress. (You can also get this information through the Management API.)

Replace/Update a existing node value in groovy

Below is my sample xml.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header>
<MessageHeader xmlns:ns3="http://csi.cingular.com/CSI/Namespaces/Types/Public/CingularDataModel.xsd" xmlns:ns39="http://csi.cingular.com/CSI/Namespaces/Types/Public/MessageHeader.xsd">
<ns39:TrackingMessageHeader>
<ns3:infrastructureVersion>86</ns3:infrastructureVersion>
<ns3:version>222</ns3:version>
<ns3:messageId>146100035386400076</ns3:messageId>
<ns3:originatorId>PEEPS</ns3:originatorId>
<ns3:timeToLive>120000</ns3:timeToLive>
<ns3:dateTimeStamp>2016-04-18T20:16:19.387Z</ns3:dateTimeStamp>
</ns39:TrackingMessageHeader>
<ns39:SecurityMessageHeader>
<ns3:userName></ns3:userName>
<ns3:userPassword></ns3:userPassword>
</ns39:SecurityMessageHeader>
<ns39:SequenceMessageHeader>
<ns3:sequenceNumber>1</ns3:sequenceNumber>
<ns3:totalInSequence>1</ns3:totalInSequence>
</ns39:SequenceMessageHeader>
</MessageHeader> </SOAP-ENV:Header> <SOAP-ENV:Body>
<InquireEnterpriseOrderListRequest xmlns="http://csi.cingular.com/CSI/Namespaces/InquireEnterpriseOrderListRequest.xsd">
<SelectionCriteria>
<organizationId>214256542</organizationId>
</SelectionCriteria>
</InquireEnterpriseOrderListRequest> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
I want to replace "organizationId" this tag value with the value read from file and trigger it using testRunner.runTestStepByName("InquireEnterpriseOrderList") once the value is updated in the node.
Can any help in understanding how to update/replace node with new value and re-trigger the API to capture result for many inputs.
Here you what you need to do:
Read file extract the required value and store it at test case level custom property. Assuming that you are using groovy script test step to do this. So, add the below additional code:
//You assign value from your code, for now using dummy assignment
def requiredvalue = '123453'
//Store that value at test case level custom property, say ORGANIZATION_ID
context.testCase.setPropertyValue('ORGANIZATION_ID', requiredValue.toString())
Now, you do not need to update the request. Instead use, property expansion as below, so that SoapUI automatically takes care of the required value from proerties
<organizationId>${#TestCase#ORGANIZATION_ID}</organizationId>

marklogic, howto create range on document properties

<?xml version="1.0" encoding="UTF-8"?>
<prop:properties xmlns:prop="http://marklogic.com/xdmp/property">
<publicationDate type="string" xmlns="http://marklogic.com/xdmp/json/basic">2015-03-30</publicationDate>
<identifier type="string" xmlns="http://marklogic.com/xdmp/json/basic">2629</identifier>
<posix type="string" xmlns="http://marklogic.com/xdmp/json/basic">nobs</posix>
</prop:properties>
I have a document with these properties above.
I want to filter by "PublicationDate" ...
I tried with "Fields" & "Field Range Indexes" and "Element Range Indexes", but I do not find the syntax (XML or JSON) to designate this property ?
is anyone know this syntax?
kind regards
In addition to the answers that give examples, please keep in mind that the element publicationDate is NOT in the namespace http://marklogic.com/xdmp/property in your example.. So your index configuration should have the namespace for the json/basic as defined per element and references to it as an xs:QName should not refer to "prop:"..
Trying to figure out if your index is correct? You can always try cts:values() from the query console and verify that your index is exactly where you expect it before using it in code.
After many trials, this is what seems to work fine (MarkLogic 8.0-3) :
Without "Field" (where wm is http://marklogic.com/xdmp/json/basic ):
qb.propertiesFragment(qb.value(qb.element(wm,'publicationDate'),'2015-03-30'))
is ok, but the following produces the same error (No element range index ...)
qb.propertiesFragment(qb.range(qb.element(wm,'publicationDate'), '>=' ,'2015-03-01'))
With "Field"
(wm:publicationDate, with wm in Path namespaces, WITHOUT /vm:properties/ before ...) the following seem to work fine :-)))
qb.propertiesFragment(qb.value(qb.field("properties_publicationDate"),'2015-03-30'))
qb.propertiesFragment(qb.range(qb.field("properties_publicationDate"), '>=' ,'2015-03-01'))
I think you are looking for cts:properties-query:
cts:properties-query(
cts:element-range-query(
xs:QName("my:publicationDate"),">",
current-dateTime() - xs:dayTimeDuration("P1D"))))
This example assumes a range index on prop:publicationDate, and also note that this assumes MarkLogic 7 or earlier. In MarkLogic 8, the name of this query appears to have changed to cts:properties-fragment-query.
In node.js, using the query builder, you could achieve something similar:
db.documents.query(
qb.where(
qb.fragmentScope('properties'),
qb.propertiesFragment(
qb.range('publicationDate', '>', ... )
)
)
)

WSO2 - Using get-property() function in Property/Xquery Mediators

Our current service has 7 operations. when writing an outbound xquery "local entry" in wso2, we're trying to retrieve the name of the current operation being executed (how can this be so difficult?).
After reading what i could find in wso2's documentation. it appears as if we need to set up both a Property and an Xquery mediator. supposedly the property mediator would pull the value doing something like get-property('OperationName') and then this would be referenced and passed thru the Xquery mediator.
The other idea was that we needed to define it as a variable in the "Local Registry entry definitions" and than it would be around at all parts of the sequence.
I've tried for 2 days but haven't quite got it.
Please tell me what I'm missing...
Did you try the following xquery sample[1]? I modified the query mediator to get the operation name as follows.
<variable xmlns:ax21="http://services.samples/xsd" xmlns:m0="http://services.samples" name="code" expression="get-property('OperationName')" type="STRING" />
this worked fine. I could see the getQuote in the response message.
[1] http://wso2.org/project/esb/java/4.0.2/docs/samples/advanced_mediation_samples.html#Sample390

Resources