docs: public String encodeForWebClient() throws MessageEncodeFailedException {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "encodeForWebClient");
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Encoding Web Message", ((MessageImpl)jmsMsg).debugMsg());
  
      // Make sure any transients necessary are written back to the message
      ((JsJmsMessageImpl)jmsMsg).updateDataFields(MfpConstants.UDF_ENCODE);
  
      StringBuffer result = new StringBuffer();
  
      // Version number
      result.append(1);
  
      // Message Id
      result.append('~');
      byte[] id = jmsMsg.getCorrelationIdAsBytes();
      if (id != null)
        HexString.binToHex(id, 0, id.length, result);
  
      // Message type
      result.append('~');
      String type = jmsMsg.getJmsxAppId();
      if (type == null || type.equals(MfpConstants.WPM_JMSXAPPID_VALUE))
        type = "SIB";
      URLEncode(result, type);
  
      // Message format
      result.append('~');
      result.append(jmsMsg.getFormat());
  
      // Topic
      result.append('~');
      String topic = jmsMsg.getDiscriminator();
      if (topic != null)
        URLEncode(result, topic);
  
      // Properties
      result.append('~');
      Set<String> names = jmsMsg.getPropertyNameSet();
      boolean first = true;
      for (Iterator<String> i = names.iterator(); i.hasNext(); ) {
        String name = i.next();
  
        // JMSXAppID is stored in the header field instead so ignore it here
        if (!name.equals(SIProperties.JMSXAppID)) {
  
          // All objects
          Object value = jmsMsg.getObjectProperty(name);
          if (value != null) {
            encodePair(result, name, value, first);
            first = false;
          }
        }
      }
  
      // Body
      if (jmsMsg instanceof JsJmsTextMessage)
        encodeTextBody(result, (JsJmsTextMessage)jmsMsg);
      else if (jmsMsg instanceof JsJmsBytesMessage)
        encodeBytesBody(result, (JsJmsBytesMessage)jmsMsg);
      else if (jmsMsg instanceof JsJmsObjectMessage)
        encodeObjectBody(result, (JsJmsObjectMessage)jmsMsg);
      else if (jmsMsg instanceof JsJmsStreamMessage)
        encodeStreamBody(result, (JsJmsStreamMessage)jmsMsg);
      else if (jmsMsg instanceof JsJmsMapMessage)
        encodeMapBody(result, (JsJmsMapMessage)jmsMsg);
  
      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Encoded as web data", result);
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "encodeForWebClient");
      return result.toString();
    }