Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 85135 invoked from network); 6 Feb 2007 14:58:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Feb 2007 14:58:34 -0000 Received: (qmail 488 invoked by uid 500); 6 Feb 2007 14:58:35 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 423 invoked by uid 500); 6 Feb 2007 14:58:34 -0000 Mailing-List: contact axis-dev-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-dev@ws.apache.org Received: (qmail 412 invoked by uid 99); 6 Feb 2007 14:58:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2007 06:58:34 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Feb 2007 06:58:25 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 940747141D1 for ; Tue, 6 Feb 2007 06:58:05 -0800 (PST) Message-ID: <9908126.1170773885577.JavaMail.jira@brutus> Date: Tue, 6 Feb 2007 06:58:05 -0800 (PST) From: "Hugo Hallman (JIRA)" To: axis-dev@ws.apache.org Subject: [jira] Created: (AXIS-2625) BeanSerializer ignores namespace of arguments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org BeanSerializer ignores namespace of arguments --------------------------------------------- Key: AXIS-2625 URL: https://issues.apache.org/jira/browse/AXIS-2625 Project: Axis Issue Type: Bug Components: Serialization/Deserialization Affects Versions: 1.4 Environment: any, server is not Axis. Reporter: Hugo Hallman When calling a web-service with parameter complex types in a different namespace than the service itself, the BeanSerializer does not set the namespace of the parameter attributes to that of the parameter type, but leaves the namespace to the namespace of the service, on the server side, the parameters will be parsed as null. Example code javax.xml.rpc.Service service; service.getTypeMappingRegistry().getDefaultTypeMapping().register(ArgumentType.class, "qn-other-than-service's-qname", new BeanSerializerFactory(ArgumentType.class, qn), new BeanDeserializerFactory(ArgumentType.class, qn)); The problem was encountered on Axis 1.3, but looks to be the same on Axis 1.4 and on trunk: http://svn.apache.org/repos/asf/webservices/axis/trunk/java/src/org/apache/axis/encoding/ser/BeanSerializer.java This can be patched with a change in org.apache.axis.encoding.ser.BeanSerializer.java. I have not tested that this suggestion does not break something else, but it solves the problem for me. BeanSerializer is in serialize():178 From: if (qname == null) { qname = new QName(isEncoded ? "" : name.getNamespaceURI(), propName); } To: if (qname == null) { qname = new QName(isEncoded ? "" : this.xmlType.getNamespaceURI(), propName); } Similar problems have been reported here: https://issues.apache.org/jira/browse/AXIS-2431 https://issues.apache.org/jira/browse/AXIS-2449 https://issues.apache.org/jira/browse/AXIS-2578 https://issues.apache.org/jira/browse/AXIS-1926 https://issues.apache.org/jira/browse/AXIS-2260 This is the XML that is generated to go on the wire. Incorrect: Test Content Item testdomain Correct: (Note the setting of elements in the argument type to ns:http://model.api.company.com) Test Content Item testdomain WORKAROUND: In the call to service.getTypeMappingRegistry().getDefaultTypeMapping().register(), give a reference to the FixedBeanSerializerFactory, and copy the from http://svn.apache.org/repos/asf/webservices/axis/trunk/java/src/org/apache/axis/encoding/ser/BeanSerializer.java to FixedBeanSerializer where the above mentioned patch can be applied. This solution works with XFire, and should also be appropriate for .net. /** * Creates a bugfixed serializer. */ static class FixedBeanSerializerFactory extends BeanSerializerFactory { private static final long serialVersionUID = -8850895971122182792L; /** * Creates a new instance of FixedBeanSerializerFactory. * @param javaType * @param xmlType */ public FixedBeanSerializerFactory(Class javaType, QName xmlType) { super(javaType, xmlType); } /** * Optimize construction of a BeanSerializer by caching the * type and property descriptors. */ protected Serializer getGeneralPurpose(String mechanismType) { if ((javaType == null) || (xmlType == null)) { return super.getGeneralPurpose(mechanismType); } if (serClass == EnumSerializer.class) { return super.getGeneralPurpose(mechanismType); } return new FixedBeanSerializer(javaType, xmlType, typeDesc, propertyDescriptor); } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional commands, e-mail: axis-dev-help@ws.apache.org