> Dear Axis-dev, > > I have (had) a problem with an axis 1.4 client to a service with the > interface class in one java-package and the argument classes in > another. The problem is that in the wsdl-the complex argument-elements > are in one namespace while the argument (in0) to the service is in > another. The BeanSerializer serializes the complex nested element as > if it was the same namespace, leading to a null input argument on the > server side. > I could solve this problem by copying the code to the BeanSerializer > to MyBeanSerializer and overriding the BeanSerializerFactory to return > MyBeanSerializer instead. > > Please let me know if this is a suitable bug to report on JIRA. > Before realizing I could fix this in the Axis code, I browsed the web > and found several discussions around this issue. > 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/ap > ache/axis/encoding/ser/BeanSerializer.java > I can imagine that the suggested fix can break some scenarios, but it > solves a real problem for us. > The server runs with XFire. > > > Thank you, > Hugo Hallman > > > The change in MyBeanSerializer 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); > } > > > > The serialized XML changes as: > (note that the doSomething element is in interfaces.api... While its > parameters are in model.api... > > From: > <?xml version="1.0" encoding="UTF-8"?> > <soapenv:Envelope > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <soapenv:Body> > <doSomething > xmlns="http://interfaces.api.company.com"> > <in0> > <contentItem> > <title>Test Content Item</title> > </contentItem> > <domain>testdomain</domain> > </in0> > </doSomething> > </soapenv:Body> > </soapenv:Envelope> > > > > To: > <?xml version="1.0" encoding="UTF-8"?> > <soapenv:Envelope > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> > <soapenv:Body> > <doSomething > xmlns="http://interfaces.api.company.com"> > <in0> > <ns1:contentItem > > xmlns:ns1="http://model.api.company.com"> > <ns1:title>Test Content Item</ns1:title> > </ns1:contentItem> > <ns2:domain > > xmlns:ns2="http://model.api.company.com"> > testdomain > </ns2:domain> > </in0> > </doSomething> > </soapenv:Body> > </soapenv:Envelope> >
