web stats
XDS.b attachments without map variables - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2018, 05:47 AM
jonathanlent jonathanlent is offline
OBX.1 Kenobi
 
Join Date: Aug 2014
Location: Denton, TX
Posts: 43
jonathanlent is on a distinguished road
Default XDS.b attachments without map variables

Okay guys, I've wandered into a corner and am too dense to figure my way out of this one.

The new XDS.b listener in the interop suite does a find job of removing the attachments even with no attachment handler -- which is nice. However, because there is no handler, it does not reattach anything when I pass it on to the XDS.b sender.

What I would like to do is just put some replacement templates in the Attachment table under the MTOM settings. However, the only way I can get this to actually send the attachment is to pull the base64 encoded value into a map variable first and then provide that to the table. It's functional, but places and enormous object into the map and I would like to avoid that.

All this feels a little like I am making it more difficult than it needs to be, as I would think that using the XDS.b listener and sender as a pair was one of the prime use cases for these two connectors.

So, currently I have ${attachment_content} in the Content column of the destination XDS.b connector. What am I missing here?
Reply With Quote
  #2  
Old 10-15-2018, 07:09 AM
narupley's Avatar
narupley narupley is offline
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,124
narupley is on a distinguished road
Default

Instead of putting the full Base64 content, you should be able to just use the attachment replacement token, like ${ATTACH:id}. In a transformer if you retrieve an Attachment object it'll have a getAttachmentId() method that returns you just that.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 10-15-2018, 10:59 AM
jonathanlent jonathanlent is offline
OBX.1 Kenobi
 
Join Date: Aug 2014
Location: Denton, TX
Posts: 43
jonathanlent is on a distinguished road
Default

So, this is where i join the "People Unclear on the Concept" club.

When Connect stashes the attachment, it assigns it a UUID as the identifier. I can get the value in code easily enough in a transform, but where my brain fails to make the leap is how to craft the Velocity template for the MTOM Content column.

Usually, some handler drops the ATTACH:id token into the message as a constant because it knows the value of the attachment id when it was created. The XDS.b listener doesn't do that here because the attachment came over via MTOM instead of having to be carved out of the body of the message by one of the handlers.

So, here is my quandary. If I have the attachment id and it is stored in a map variable as "attachment_id", what would the velocity template in the Content column look like? I've tried a bunch of permutations, even using #evaluate in one case, but the consistent result is that the template is sent as a literal instead of being evaluated.

I know I'm pushing on a door marked "Pull" here, but I just can't seem to make a and b connect today.
Reply With Quote
  #4  
Old 02-14-2019, 11:25 PM
vignesh vignesh is offline
Mirth Newb
 
Join Date: Jul 2018
Posts: 4
vignesh is on a distinguished road
Smile

Hi Jonathan,

I'm very curious on this issue. Any break through? If you had achieved it by any alternate ways. Please share your ideas.. Appreciate that!
Reply With Quote
  #5  
Old 02-15-2019, 01:28 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,028
agermano is on a distinguished road
Default

You don't put the attachment_id in a chanelMap variable. You put it in the message where you want it to be replaced with the actual attachment.
Reply With Quote
  #6  
Old 02-15-2019, 06:35 AM
vignesh vignesh is offline
Mirth Newb
 
Join Date: Jul 2018
Posts: 4
vignesh is on a distinguished road
Smile

Can you please share a sample channel of XDS.b listener for sending out attachment in MTOM format.
Reply With Quote
  #7  
Old 02-15-2019, 11:07 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,028
agermano is on a distinguished road
Default

I don't have those extensions, just letting you know how mirth attachments work. The attachment replacement token isn't a velocity variable. The token gets inserted into the message as if it were the attachment itself. You might want to read up on attachment handlers in the user guide, starting on page 158.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:22 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation