[SOAP] Question sur la déclaration des types non primitifs
Salut,
Je dois développer un client effectuant des requêtes à un serveur SOAP. J'ai lu plusieurs tuto mais une notion est encore obscure pour moi, la déclaration des types non primitifs. Voici mon code bien aidé de ce lien (http://www.soapuser.com/fr/client2.html)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
// Process the arguments.
URL url = new URL(args[0]);
SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer beanSer = new BeanSerializer();
// Map the types.
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("urn:QuotationService", "quotation"), Quotation.class, beanSer, beanSer);
// Build the call.
Call call = new Call();
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI("urn:QuotationService");
call.setMethodName("sendMail");
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
//Build the params
String test = "test";
Vector params = new Vector();
params.addElement(new Parameter("test", String.class, test, null));
call.setParams(params);
// Invoke the call.
resp = call.invoke(url, ""); |
C'est quoi ce système de mapping ? Comment ça fonctionne ?
A ce que j'en ai compris, ça permet de déclarer les types non primitifs. Seulement, à quoi correspond tous ces paramètres : "urn:QuotationService", "quotation". Et comment connaître ceux dont j'ai besoin ? Je n'ai à ma disposition que le WSDL que j'ai converti en classes Java avec Java2WSDL
Merci pour votre aide.