title: Smack XMPP Custom Extensions not arriving fully
body: <p>I've got Smack running with OpenFire. Message Transfer works fine, but custom extensions never arrive fully.</p>
  
  <p>This is what get's sent (by a not-smack library):</p>
  
  <pre><code>&lt;message type="normal" id="42444f16-761f-471d-a37c-c9204cf14cfc" to="timmy@openfireserver.eu"&gt;
    &lt;operation xmlns="http://www.openfireserver.eu/ns/xmpp-rest" ack="false"&gt;PUT&lt;/operation&gt;
    &lt;part xmlns="http://www.openfireserver.eu/ns/xmpp-rest" RIDDL-TYPE="simple" content-disposition="riddl-data; name=&amp;quot;value&amp;quot;"&gt;stopped&lt;/part&gt;
    &lt;part xmlns="http://www.openfireserver.eu/ns/xmpp-rest" RIDDL-TYPE="simple" content-disposition="riddl-data; name=&amp;quot;tims&amp;quot;"&gt;world&lt;/part&gt;
    &lt;part xmlns="http://www.openfireserver.eu/ns/xmpp-rest" RIDDL-TYPE="complex" content-disposition="riddl-data; name=&amp;quot;excellent&amp;quot;" content-transfer-encoding="binary" content-type="text/plain"&gt;party time&lt;/part&gt;
  &lt;/message&gt;
  </code></pre>
  
  <p>This is what arrives:</p>
  
  <pre><code>&lt;message id="42444f16-761f-471d-a37c-c9204cf14cfc" to="timmy@openfireserver.eu" from="jürgen@openfireserver.eu/f8c64ccb"&gt;
  &lt;operation xmlns="http://www.openfireserver.eu/ns/xmpp-rest"&gt;&lt;/operation&gt;
  &lt;part xmlns="http://www.openfireserver.eu/ns/xmpp-rest"&gt;&lt;/part&gt;
  &lt;part xmlns="http://www.openfireserver.eu/ns/xmpp-rest"&gt;&lt;/part&gt;
  &lt;part xmlns="http://www.openfireserver.eu/ns/xmpp-rest"&gt;&lt;/part&gt;
  &lt;/message&gt;
  </code></pre>
  
  <p>I tried creating an OperationExtension and setting it before the connection is created like this:</p>
  
  <pre><code>OperationProvider o = new OperationProvider();
  ProviderManager.getInstance().addExtensionProvider(o.getExtension().getElementName(),o.getExtension().getNamespace(), o);
  </code></pre>
  
  <p>The OperationProvider looks like this for testing, but my breakpoints never get hit :-(</p>
  
  <pre><code>public class OperationProvider implements PacketExtensionProvider {
  
      private OperationExtension extension = new OperationExtension();
  
      @Override
      public PacketExtension parseExtension(XmlPullParser xmlparser) throws Exception {
          OperationExtension o = new OperationExtension();
          System.out.println("YAAAA + " + xmlparser.getText());
          String text = xmlparser.nextText();
          while (text != null)
          {
              System.out.println("YAAAA + " + text);
              text = xmlparser.nextText();
          }
          return o;
      }
  
      public OperationExtension getExtension() {
          return extension;
      }
  
      public void setExtension(OperationExtension extension) {
          this.extension = extension;
      }
  
  }
  </code></pre>
  
  <p>The OperationExtension itself is pretty basic (set breakpoints here to hopefully have them hit sometimes, but doesn't work):</p>
  
  <pre><code>public class OperationExtension implements PacketExtension {
  
      public static final String NAMESPACE = "http://www.openfireserver.eu/ns/xmpp-rest";
  
      public String getElementName()
      {
          return "Operation"; // &lt;-- here was my error, it should say (lower-case) "operation"
      }
  
      public String getNamespace()
      {
          return NAMESPACE;
      }
  
      @Override
      public String toXML() {
          return "&lt;Operation&gt;GET&lt;/Operation&gt;"; // this is also just mockup with a breakpoint ;-)
      }
  
  }
  </code></pre>
  
  <p>, but the toXml() method also doesn't get called. As some of the few available docs suggest, I put a smack.properties file in a META-INF folder inside the /src path of the project, and I made it look like this:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;extensionProvider&gt;
        &lt;elementName&gt;operation&lt;/elementName&gt;
        &lt;namespace&gt;http://www.openfireserver.eu/ns/xmpp-rest&lt;/namespace&gt;
        &lt;className&gt;adventure.messagerouting.XmppExtensions.OperationExtension&lt;/className&gt;
     &lt;/extensionProvider&gt;
     &lt;extensionProvider&gt;
         &lt;elementName&gt;part&lt;/elementName&gt;
         &lt;namespace&gt;http://www.openfireserver.eu/ns/xmpp-rest&lt;/namespace&gt;
         &lt;className&gt;adventure.messagerouting.XmppExtensions.PartExtension&lt;/className&gt;
  &lt;/extensionProvider&gt;
  </code></pre>
  
  <p>I can that my Provider is registered in <code>ProviderManager.getInstance().getExtensionProviders();</code> but I cannot say why it's code is never called.</p>
  
  <ol>
  <li>Do I do something wrong here? Why do my attributes and tag contents not arrive in smack?</li>
  <li>Is it possible that OpenFire filters something out?</li>
  </ol>