Hi,
I am trying to do a webservice search using Java API 4.6.1. I want to find if an asset id occurs in any other asset (as a metavalue).
Given below is the code
public MBAsset[] performSearch()
{
MBAsset[] searchResults = null;
try {
MBSearchCriteria criteria = new MBSearchCriteria();
criteria.setMMaxHits(3);
//criteria.setMAssetID(this.assetObj.getMID());
MBMetadata metadata = new MBMetadata();
// set metadata name could be parent association as well
metadata.setMName("Alternate Format");
metadata.setMID("{E38F1E60-9D9F-4DF5-9B61-2117E8AA0799}");
metadata.setMValue("{1E1FD51E-EEA1-4BAF-908B-C5BA4FDE7FED}");
MBSearchConstraint[] constraint = new MBSearchConstraint[1];
constraint[0] = new MBSearchConstraint();
constraint[0].setMMetadata(metadata);
constraint[0].setMSearchOperator("Equality");
constraint[0].setMBooleanOperator(MBBooleanOperator.NotSet);
criteria.setMSearchConstraints(constraint);
// Perform search
searchResults = this.mbService.search(criteria, false);
}
catch (Exception e)
{
e.printStackTrace();
log.error("Error thrown while performing search", e);
}
}
Given below is the descriptor of another asset where in the asset id (of the asset in the code above) is occurring as a metavalue.
<PARAM>
<LABEL>Alternate Format</LABEL>
<ID>{E38F1E60-9D9F-4DF5-9B61-2117E8AA0799}</ID>
<VALUE>
<ARRAY><IDTYPE/>
<ID>{1E1FD51E-EEA1-4BAF-908B-C5BA4FDE7FED}</ID>
</ARRAY></VALUE>
</PARAM>
Given below is the trace of the exception
faultCode: {
http://schemas.xmlsoap.org/soap/envelope/}Server faultSubcode:
faultString: Server was unable to process request. ---> MBException: The value passed in is not valid for the parameter (0x80040407)
faultActor:
faultNode:
faultDetail:
{
http://xml.apache.org/axis/}stackTrace
erver was unable to process request. ---> MBException: The value passed in is not valid for the parameter (0x80040407)
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
Help would be appreciated.
Thanks,