Index: src/java/fedora/server/access/dissemination/DisseminationService.java
===================================================================
--- src/java/fedora/server/access/dissemination/DisseminationService.java	(revision 6190)
+++ src/java/fedora/server/access/dissemination/DisseminationService.java	(revision 6191)
@@ -9,6 +9,9 @@
 import java.io.File;
 import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
+import java.io.InputStreamReader;
+import java.io.StringWriter;
+import java.io.IOException;
 
 import java.net.URLEncoder;
 
@@ -502,8 +512,67 @@
                                                               dissBindInfo.dsLocation,
                                                               PID,
                                                               dsMediatedCallbackHost);
+                            LOG.debug( "Replace string is '" + replaceString + "'" );
+
+                            LOG.debug( "Checking method params to see if we should perform 'by-value' replacement." );
+                            for ( MethodParmDef param : dissBindInfo.methodParms )
+                            {
+                                LOG.debug( "Checking param '" + param.parmName + "' with pass by '" + param.parmPassBy + "'" );
+                                if ( param.parmName.equals( dissBindInfo.DSBindKey ) )
+                                {
+                                    LOG.debug( "Param name matches datastream binding key '" + dissBindInfo.DSBindKey + "'" );
+                                    if ( MethodParmDef.PASS_BY_VALUE.equals( param.parmPassBy ) )
+                                    {
+                                        InputStream in = null;
+                                        try
+                                        {
+                                            MIMETypedStream value = getDisseminationContent( replaceString, context, "", "" );
+                                            in = value.getStream();
+                                            InputStreamReader isr = new InputStreamReader( in, "UTF-8" );  // FIX ME? use http charset
+                                            char[] chars = new char[1024];
+                                            int read = 0;
+                                            StringWriter sw = new StringWriter( 1024 );
+                                            while ( ( read = isr.read( chars, 0, chars.length ) ) != -1 )
+                                            {
+                                                sw.append( String.copyValueOf( chars, 0, read ) );
+                                            }
+                                            replaceString = sw.toString().trim();
+                                            LOG.debug( "Resolved replace string to value '" + replaceString + "'" );
+                                        }
+                                        catch ( IOException e )
+                                        {
+                                            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                                        }
+                                        finally
+                                        {
+                                            try
+                                            {
+                                                if ( in != null )
+                                                    in.close();
+                                            }
+                                            catch ( IOException e )
+                                            {
+                                                // ignore
+                                            }
+                                        }
+                                    }
+                                    else
+                                    {
+                                        LOG.debug( "Not performing substitution with param named '" + param.parmName +
+                                                "': pass by value '" + param.parmPassBy + "' doesn't equal '" + MethodParmDef.PASS_BY_VALUE + "'" );
+                                    }
+                                }
+                                else
+                                {
+                                    LOG.debug( "Not performing substitution with param named '" + param.parmName +
+                                            "': it doesn't match the datastream binding key '" +
+                                            dissBindInfo.DSBindKey + "'" );
+                                }
+                            }
+
                         } else {
                             replaceString = dissBindInfo.dsLocation;
+                            LOG.debug( "Replace string is '" + replaceString + "' (no replacement required)" );
                         }
                         if (dissBindInfo.dsControlGroupType
                                 .equalsIgnoreCase("R")
