[jboss-dev-forums] [JBoss XML Binding Development] - JBXB-100

richard.opalka@jboss.com do-not-reply at jboss.com
Thu Dec 10 09:18:54 EST 2009


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;
  |    }
  | }
  | 

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4269992#4269992

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4269992



More information about the jboss-dev-forums mailing list