Getting a "Failed" status when using MMCoverSheetRetrieve API
Hi,
We want to be able to retrieve the names of the cover pages from the web admin portal as shown below:
and use the name upon sending the fax in our code using the JobSubmit API.
However, I'm currently encountering a "Failed" status using the MMCoverSheetRetrieve API as shown below:
Can you please let me know if there's anything I've missed?
I tried to find any sample code that you might have using this API but I can't find one. I also tried to search here in this support page like in here: https://forums.opentext.com/forums/developer/discussion/301667/issue-in-sending-fax-with-custom-cover-sheet
but it still doesn't work.
Appreciate it if you can help me out on this. Thanks.
Answers
-
Please set the ownership to either to customer, user or group similar to setObjKind() in the code.
Please find the below sample
<MMCoverSheetRetrieveRequest xmlns="http://ws.easylink.com/MMCoverSheetRetrieve/2011/01">
<ObjectStore>XDDS</ObjectStore>
<MMCoverSheetId objKind="mmcover" ownership="customer">testmmcover</MMCoverSheetId>
</MMCoverSheetRetrieveRequest>
</soapenv:Body>
</soapenv:Envelope>
Try printing the ErrorCode and ErrorMessages using System.out.println. This will make us to debug easier.
Prabhakaran R
OpenText0 -
Thanks for the response. It works now. It needs to be supplied with the coversheet id in order to retrieve the fields of the cover page.
But what if we don't have the cover sheet ID? what we are really trying to retrieve is the cover page names or the cover sheet IDs that are created or listed inside the web admin as stated in previous post.
Should I use the same API or there's another API for this? I checked the services below but I couldn't find anything else that would make sense:
Which API should I use?
0 -
Please use StoredObjectList API.
SampleRequest
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<ns:Request soapenv:mustUnderstand="0" xmlns:ns="http://ws.easylink.com/RequestResponse/2011/01">
<ns:ReceiverKey>http://tf-vdevxoaapp-d001.xpedite.com/soap/sync</ns:ReceiverKey>
<ns:Authentication>
<ns:XDDSAuth>
<ns:RequesterID aliasType="M2F">user@email.com</ns:RequesterID>
<ns:Password>password</ns:Password>
</ns:XDDSAuth>
</ns:Authentication>
</ns:Request>
</soapenv:Header>
<soapenv:Body>
<ns:StoredObjectListRequest xmlns:ns="http://ws.easylink.com/StoredObjectList/2011/01">
<ns:ObjectStore>XDDS</ns:ObjectStore>
<ns:FilterByObjectKind>
<ns:ObjKind>mmcover</ns:ObjKind>
<ns:OwnershipInfo>
<ns:Ownership>user</ns:Ownership>
</ns:OwnershipInfo>
<ns:OwnershipInfo>
<ns:Ownership>customer</ns:Ownership>
</ns:OwnershipInfo>
<ns:OwnershipInfo>
<ns:Ownership>group</ns:Ownership>
</ns:OwnershipInfo>
<ns:OwnershipInfo>
<ns:Ownership>domain</ns:Ownership>
</ns:OwnershipInfo>
</ns:FilterByObjectKind>
<ns:RetrieveDescription>true</ns:RetrieveDescription>
<ns:UseBase64>false</ns:UseBase64>
<ns:MaxListSize>0</ns:MaxListSize>
</ns:StoredObjectListRequest>
</soapenv:Body>
</soapenv:Envelope>
Prabhakaran R
OpenText0 -
Thanks for your quick reply. Much appreciated.
Yes, I tried that API. When I tested it, it works when I used "group" to set as ownership. It returned Status = 0 but all my cover pages levels
are "customer" so I used this for ownership instead.
However, I'm getting the error below when setting the ownership info to "customer".
Please see code and error below:
which doesn't make sense because all cover pages are of type "customer" inside web admin as you can see in my screenshot below:
Is there anything I've missed or incorrect in what I did in the code? Please reply.
0 -
Please copy paste the code instead of screenshots.
It will help us in debugging.
I need to copy the code and then i have to analyze
Prabhakaran R
OpenText0 -
Please see code snippet below:
StoredObjectListBindingStub bindingStub = new StoredObjectListBindingStub();
bindingStub._setProperty(AuthenticateBindingStub.ENDPOINT_ADDRESS_PROPERTY, "https://messaging.easylink.com/soap/sync");
XDDSAuthType xauth = new XDDSAuthType();
UIDType uid = new UIDType();
uid.setAliasType("M2F");
uid.set_value("");
xauth.setRequesterID(uid);
xauth.setPassword("");
RequestAuthentication auth = new RequestAuthentication();
auth.setXDDSAuth(xauth);
StoredObjectListRequest parameter = new StoredObjectListRequest();
Request requestHeader = new Request();
StoredObjectListResultHolder parameter0 = new StoredObjectListResultHolder();
OwnershipInfoType custType = new OwnershipInfoType();
custType.setOwnership(StoredObjectLevelType.customer);
OwnershipInfoType groupType = new OwnershipInfoType();
groupType.setOwnership(StoredObjectLevelType.group);
requestHeader.setAuthentication(auth);
URI uri = new URI("https://messaging.easylink.com");
requestHeader.setReceiverKey(uri);
ResponseHolder responseHeader = new ResponseHolder();
OwnershipInfoType[] infoTypes = new OwnershipInfoType[1];
infoTypes[0] = custType;
// infoTypes[0] = groupType;
parameter.setObjectStore("XDDS");
FilterByObjectKindType byObjectKindType = new FilterByObjectKindType();
byObjectKindType.setObjKind("mmcover");
byObjectKindType.setOwnershipInfo(infoTypes);
parameter.setFilterByObjectKind(byObjectKindType);
parameter.setRetrieveDescription(true);
parameter.setUseBase64(false);
parameter.setMaxListSize((long) 2);
bindingStub.storedObjectList(parameter, requestHeader, parameter0, responseHeader);
int StatusCode = parameter0.value.getStatus().getStatusCode().intValue();
System.out.println("StatusCode "+StatusCode);
StoredObjectInfoType[] mapField = parameter0.value.getStoredObjectInfo();
Integer count=0;
if (null!=mapField) {
for (StoredObjectInfoType f : mapField){
System.out.println(count+" : "+f.getObjectDisplayName());
count++;
}
}
System.out.println("222222 "+parameter0.value.getNumberOfObjects());
// System.out.println("333333 "+parameter0.value.getDisplayName());
if ( StatusCode == 0) {
} else {
String sError = parameter0.value.getStatus().getStatusCode().toString();
sError += "\n" + parameter0.value.getStatus().getStatusMessage();
System.out.println("444444 "+sError);
}
Thanks for the quick reply.
0 -
Thanks @Prabhakr_2018 for looking into this.
May I follow up with you if you had the chance to check the code above?
Please let me know if there's anything else you need from side. Thanks again
0 -
After debugging, parameter.setRetrieveDescription(true); is the function which is causing the above exception. This function is used to send the "additionalInfo" of the coversheet in the response which is causing the above exception.
There are two ways you can resolve the exception.
- parameter.setRetrieveDescription(false) will not send additional Info of the coversheet,but u can get the list of coversheets u have created.
- Exception was similar to the one which is present in https://www.ibm.com/support/pages/node/422357 . and stubs were not generated properly. we need to pass -w as mentioned in the above link.With the generated stubs, the code will work even if you set parameter.setRetrieveDescription(true).
Prabhakaran R
OpenText0 -
Thanks so much for the reply.
I just set it to "false" like the following: parameter.setRetrieveDescription(false) just for me to proceed.
The error is now gone but I'm only getting "null" when trying to display the values as highlighted below:
Can you please advise which method should I use?
0 -
System.out.println(count+" : "+f.getStoredObjectId().get_value());
Prabhakaran R
OpenText0
Categories
- All Categories
- 118 Developer Announcements
- 52 Articles
- 150 General Questions
- 137 Services
- 56 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 912 Cloud Fax and Notifications
- 82 Digital Asset Management
- 9.3K Documentum
- 30 eDOCS
- 175 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 6 XM Fax