Hi,
Iam trying to use the dfs object services, query services for my custom application using axis 1.4 on jdk 1.4.
Iam facing issues while setting up the folder relationships and using query services, can you please tell me where Iam going wrong below is the code snippet::
I have also attached the code iam using in this thread.
############# Query service ###############
String[] repoName= new String[1];
repoName[0] = docbase;
PassthroughQuery query = new PassthroughQuery();
String objectQuery = "select r_object_id from dm_sysobject where object_name='" + o.getObjectName() + "' and folder('" + o.getFolder() + "')";
query.setQueryString(objectQuery);
System.out.println("QUERY :: "+objectQuery);
query.setRepositories(repoName);
QueryExecution queryEx = new QueryExecution();
queryEx.setCacheStrategyType(CacheStrategyType.DEFAULT_CACHE_STRATEGY);
QueryServiceLocator querySvcLocator=new QueryServiceLocator();
QueryServicePortBindingStub queryStub= (QueryServicePortBindingStub)querySvcLocator.getQueryServicePort();
queryStub.setHeader(new SOAPHeaderElement(ele));
OperationOptions operationOptions = null;
QueryResult queryResult = queryStub.execute(query, queryEx, operationOptions);
DataPackage resultDp = queryResult.getDataPackage();
DataObject[] dataObjects = resultDp.getDataObjects();
int numberOfObjects = dataObjects.length;
if(numberOfObjects > 0 ){
exists = true;
info.setErrorCode(1);
info.setError(o.getObjectName() + " is already in " + o.getFolder() + ". Please be sure to use a unique file name.");
IDs[i] = info;
log.warn(o.getObjectName() + " is already in " + o.getFolder() + ".");
}
#################### setting up folder relationship ################
try {
ObjectPath objectPath = new ObjectPath();
objectPath.setPath(o.getFolder());
System.out.println("Object Path :: "+objectPath.getPath());
ObjectIdentity folderIdentity = new ObjectIdentity();
folderIdentity.setObjectPath(objectPath);
folderIdentity.setRepositoryName(docbase);
System.out.println("FOLDER IDENTITY ::"+folderIdentity.getObjectPath().getPath());
ReferenceRelationship folderRelationship = new ReferenceRelationship();
folderRelationship.setName("folder");
folderRelationship.setTarget(folderIdentity);
folderRelationship.setTargetRole("parent");
System.out.println("Relationship :: "+folderRelationship.getTarget().getObjectId().getId());
relationship[0] = folderRelationship;
} catch (Exception e) {
e.printStackTrace();
}
log.debug("Now setting the object content ");
BinaryContent[] binContent = new BinaryContent[1];
dataObject[0] = mydataObject;
binContent[0] = getBinaryContent(binaryData, o.getContentType());
dataObject[0].setContents(binContent);
dataObject[0].setRelationships(relationship);
dataObject[0].setType(o.getObjectType());
dataPackage.setDataObjects(dataObject);
dataPackage.setRepositoryName(docbase);
########## error occured :::
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: Failed to read a response: javax.xml.bind.UnmarshalException
- with linked exception:
[javax.xml.bind.UnmarshalException: Unable to create an instance of com.emc.documentum.fs.datamodel.core.Relationship
- with linked exception:
[java.lang.InstantiationException]]
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:Failed to read a response: javax.xml.bind.UnmarshalException
- with linked exception:
[javax.xml.bind.UnmarshalException: Unable to create an instance of com.emc.documentum.fs.datamodel.core.Relationship
- with linked exception:
[java.lang.InstantiationException]]
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 weblogic.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:585)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNamespaceBinder.java:898)
at weblogic.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.java:644)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1008)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1469)
at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:138)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
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)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.emc.documentum.fs.services.core.ObjectServicePortBindingStub.create(ObjectServicePortBindingStub.java:1048)
at com.supervalu.ecm.service.ObjectService.importObject(ObjectService.java:390)
at com.emc.documentum.tst.DAMSystemWrapper.main(DAMSystemWrapper.java:119)