Bonjour à tous, je suis en train d'intégrer un web service dans l'une de mes applications Spring donc, tout naturellement, je mets en oeuvre SpringRemoting.

La connexion à mon service se passe bien mais le mapping n'est pas reconnu en standard, normal ! Je me fends donc de mon propre JaxRpcPortProxyFactoryBean.

Seulement voilà, le résultat de mon appel WS est de type :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 
<xs:complexType name="findAllApplicationsResponse">
   <xs:sequence>
      <xs:element maxOccurs="unbounded" minOccurs="0" name="result" type="tns:application"/>
   </xs:sequence>
</xs:complexType>
Ce qui correspond au type xml :
et au type Java :
seulement, dans mon JaxRpcPortProxyFactoryBean, je le map comment le petit là ?

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package test.client;
 
import java.util.ArrayList;
 
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.encoding.TypeMapping;
import javax.xml.rpc.encoding.TypeMappingRegistry;
 
import org.apache.axis.encoding.ser.BeanDeserializerFactory;
import org.apache.axis.encoding.ser.BeanSerializerFactory;
import org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean;
 
import fr.mdt.services.mesapplications.Application;
 
public class AxisPortProxyFactoryBean extends JaxRpcPortProxyFactoryBean {
 
	public AxisPortProxyFactoryBean() {
		super();
	}
 
	protected void postProcessJaxRpcService(Service service) {
		TypeMappingRegistry registry = service.getTypeMappingRegistry();
		TypeMapping mapping = registry.createTypeMapping();
		registerBeanMapping(mapping, ??????????, "result");
		registerBeanMapping(mapping, Application.class, "application");
		registry.register("http://schemas.xmlsoap.org/soap/encoding/", mapping);
	}
 
	protected void registerBeanMapping(TypeMapping mapping, Class type, String name) {
		QName qName = new QName("http://monNameSpace/services/mesapplications", name);
		mapping.register(type, qName, new BeanSerializerFactory(type, qName), new BeanDeserializerFactory(type, qName));
	}
}
Merci de votre aide !