4 Replies Latest reply on Dec 12, 2009 5:52 AM by aloubyansky

    JBXB-100

    ropalka

      Hi Alexey,

      below is the code we're talking about in JBXB-100. JBossWS code is reusing org.jboss.xb.binding.SimpleTypeBindings for un/marshalling.
      The methods we're using requires String for payload to be de/serialized. Our request is for supporting javax.xml.transform.Source instead of String.
      Our sourceToString() method takes too much processing time. (~20 % of invocation time). If you would provide this improvement in JBXB, you'd help us improve our invocation performance very significantly.

      package org.jboss.ws.core.jaxrpc.binding;
      
      import javax.xml.namespace.QName;
      import javax.xml.transform.Source;
      import org.jboss.logging.Logger;
      import org.jboss.ws.core.binding.BindingException;
      import org.jboss.ws.core.binding.DeserializerSupport;
      import org.jboss.ws.core.binding.SerializationContext;
      import org.jboss.xb.binding.SimpleTypeBindings;
      
      public class SimpleDeserializer extends DeserializerSupport
      {
       public Object deserialize(QName xmlName, QName xmlType,
       Source xmlFragment, SerializationContext serContext) throws BindingException {
      
       String jbxb100Workaround = sourceToString(xmlFragment); // [JBXB-100]
       return deserialize(xmlName, xmlType, jbxb100Workaround, serContext);
      
       }
      
       private Object deserialize(QName xmlName, QName xmlType, String xmlFragment, SerializationContext serContext) throws BindingException
       {
       String valueStr = unwrapValueStr(xmlFragment);
      
       if (valueStr != null)
       {
       return SimpleTypeBindings.unmarshal(
       xmlType.getLocalPart(), valueStr, serContext.getNamespaceRegistry()); // [JBXB-100]
       }
      
       return null;
       }
      }
      


        • 1. Re: JBXB-100
          aloubyansky

          Since you keep ignoring my questions on the issue I have nothing to add.

          • 2. Re: JBXB-100
            ropalka

            I'm not ignoring your questions Alexey, I'm just too busy these days and can't put my hands on everything I'd like to :( Wait few days, I'll analyze the problem more deeply and then we'll discuss it ;)

            • 3. Re: JBXB-100
              ropalka

              And I was not on JBXB-100 watch list before, now I am ;)

              • 4. Re: JBXB-100
                aloubyansky

                Whic XB versions are you using?

                There is JBossXBParser interface here http://anonsvn.jboss.org/repos/common/jbossxb/trunk/src/main/java/org/jboss/xb/binding/parser/

                which is a SAX-like one. The only implementation is SAX-based.
                Since, I guess, when you marshal DOMSource into a String you navigate through DOM structures, you could generate the needed SAX-like events and they will be directly processed by XB. That would be DOM-based implementation of JBossXBParser. I think it shouldn't be a difficult task to do. Do you want to do this?

                The problem with the current releases of XB is that there is actually no way to supply an alternative impl of JBossXBParser. But also because of this JBossXBParser interface can be reviewed and simplified safely since there have been only one implementation. So this one is also easy to fix.