Closed bnilesh closed 4 years ago
hi bnilesh, even i am facing this issue prefix issue but if i remove the error code in bcc .i am getting the same error. Do you know how to give a reply to an email?
Hi Siva, for now I replaced 'ns1:t:Mailbox' with 't:Mailbox' in soap client inside node modules before sending reply. This seems to work fine but its just a band aid on the issue.
Hi nilesh, can you tell me the file you replaced and where?? I verified soap module under node modules but i'm unable to find out
Hi Siva, check it under node_modules. \node_modules\soap\lib\client.js Line#275 for me
// I have added it after following if block if(options && options.postProcess){ xml = options.postProcess(xml); } console.log("PRE-XML:",xml); xml = xml.replace(/ns1:t:Mailbox/g, 't:Mailbox'); console.log("POST-XML:",xml);
With above code, you should be able to see before and after xml created for soap request.
Good luck!
Awesome work, thanks for the solution nilesh. Its working for me.
Nilesh, can we add an attachement while seding reply??
NO problem Nilesh, i got that.
I am trying to reply to an existing email using ReplyToItem with ReferenceItemId. Everything works well if I provide single BccRecipients mailbox. As soon as, I surround the Mailbox with array notation, I get the schema validation error. a:ErrorSchemaValidation: The request failed schema validation: 'ns1' is an undeclared prefix.
So far I have tried everything with regard to namespace. Added 'ts:' to types as well but no luck. Can anyone please help? I can see that 'ns1' getting added to Mailbox node when array type is provided.
var ewsCreateItemArgs = { "attributes": { "MessageDisposition": "SendAndSaveCopy" }, "SavedItemFolderId": { "DistinguishedFolderId": { "attributes": { "Id": "sentitems" } } }, "Items": { "ReplyToItem": { //following commented piece works - single email // "t:BccRecipients": { // "t:Mailbox": { // "t:EmailAddress" : debugEmail // } // }, //fails with error "t:BccRecipients": { "t:Mailbox": [ { "t:EmailAddress" : debugEmail1}, { "t:EmailAddress" : debugEmail2} ] },
"ReferenceItemId": { "attributes": { "Id": eItemId.attributes.Id, "ChangeKey": eItemId.attributes.ChangeKey } }, "NewBodyContent": { "attributes": { "BodyType": "Text" }, "$value":
${emlJob.eSubj || 'Thank you for request.'}
}, } } };//resulting xml for createitemargs `<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/">