public MessageContextFactory(WSFeatureList wsf) {
   features = wsf;
   envelopeStyle = features.get(EnvelopeStyleFeature.class);
   if (envelopeStyle == null) { // Default to SOAP11
     envelopeStyle =
         new EnvelopeStyleFeature(new EnvelopeStyle.Style[] {EnvelopeStyle.Style.SOAP11});
     features.mergeFeatures(new WebServiceFeature[] {envelopeStyle}, false);
   }
   for (EnvelopeStyle.Style s : envelopeStyle.getStyles()) {
     if (s.isXML()) {
       if (xmlCodec == null) xmlCodec = Codecs.createXMLCodec(features);
     } else {
       if (soapCodec == null) soapCodec = Codecs.createSOAPBindingCodec(features);
       singleSoapStyle = s;
     }
   }
 }
 private Packet packet(Message m) {
   final Packet p = new Packet();
   // TODO when do we use xmlCodec?
   p.codec = soapCodec;
   if (m != null) p.setMessage(m);
   MTOMFeature mf = features.get(MTOMFeature.class);
   if (mf != null) {
     p.setMtomFeature(mf);
   }
   return p;
 }