Bonjour � tous,
je suis en train d'�crire ce qui pourrait s'apparenter � un proxy service web (une premi�re pour moi, je ne maitrise pas trop soap).
Pour r�sumer � l'extr�me, c'est dans le cadre du changement complet d'un service soap. Le nouveau service doit "comprendre" les demandes de l'ancien service, les traduire en demandes comprises par le nouveau service et enfin rendre ce que l'ancien service rendait.
Je poss�de le code du nouveau service, ce dernier ne sera pas modifi� mais interrog� par ce que j'appelle le proxy.
Je dispose des wsdl des anciens et nouveaux services.
C�t� proxy, j'ai �cris ce qu'il fallait pour qu'il se mette � l'�coute, comprenne les demandes et rende les paquets xml correspondant � l'ancien serveur.
C�t� interrogation, j'ai �galement cod� ce qu'il fallait pour interroger le service. Ca tourne nickel.
D�tail, j'utilise Eclipse.
Pour les 2 services, j'ai utilis� wsdl2h et soapcpp2 pour g�n�rer le code :
Pour le proxy :
Pour le client du nouveau service:
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3 wsdl2h -o /tmp/proxy.hpp service.wsdl espoir.xsd pims.xsd soapcpp2 -LSx -d/fs1/src/proxy /tmp/proxy.hpp
Pour le client, j'ai ajout� un namespace ams (-Qams) pour �viter d'avoir des d�finitions en doubles
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3wsdl2h -c -o/tmp/ams.h "http://localhost:5100?wsdl" soapcpp2 -CL -d/fs1/src/amsClient -pams -Qams /tmp/ams.h
J'ai commenc� � avoir des soucis lorsque j'ai voulu ajout� le code du client dans le projet du proxy.
Tout se compile correctement mais j'obtiens l'erreur suivante au linkage :
En effet, soap_getelement, soap_putelement et soap_markelement sont d�finies dans les 2 sources mais il y a un namespace sp�cifique dans amsC.c
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
35
36
37
38
39
40
41
42
43
44
45
46 make all Building file: ../c/amsClient/amsC.c Invoking: Cross GCC Compiler g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"c/amsClient/amsC.d" -MT"c/amsClient/amsC.o" -o "c/amsClient/amsC.o" "../c/amsClient/amsC.c" Finished building: ../c/amsClient/amsC.c Building file: ../c/amsClient/amsClient.c Invoking: Cross GCC Compiler g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"c/amsClient/amsClient.d" -MT"c/amsClient/amsClient.o" -o "c/amsClient/amsClient.o" "../c/amsClient/amsClient.c" Finished building: ../c/amsClient/amsClient.c Building file: ../c/soapC.cpp Invoking: Cross G++ Compiler g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"c/soapC.d" -MT"c/soapC.o" -o "c/soapC.o" "../c/soapC.cpp" Finished building: ../c/soapC.cpp Building file: ../c/soapServer.cpp Invoking: Cross G++ Compiler g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"c/soapServer.d" -MT"c/soapServer.o" -o "c/soapServer.o" "../c/soapServer.cpp" Finished building: ../c/soapServer.cpp Building file: ../c/stdsoap2.cpp Invoking: Cross G++ Compiler g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"c/stdsoap2.d" -MT"c/stdsoap2.o" -o "c/stdsoap2.o" "../c/stdsoap2.cpp" Finished building: ../c/stdsoap2.cpp Building file: ../c/workerAmaServer.cpp Invoking: Cross G++ Compiler g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"c/workerAmaServer.d" -MT"c/workerAmaServer.o" -o "c/workerAmaServer.o" "../c/workerAmaServer.cpp" Finished building: ../c/workerAmaServer.cpp Building target: workerAmaServer Invoking: Cross G++ Linker g++ -L/fs1/git/workerAmaServer/Debug/c -o "workerAmaServer" ./c/amsClient/amsC.o ./c/amsClient/amsClient.o ./c/soapC.o ./c/soapServer.o ./c/stdsoap2.o ./c/workerAmaServer.o -lresolv -ldl ./c/soapC.o : Dans la fonction « soap_getelement » : /fs1/git/workerAmaServer/Debug/../c/soapC.cpp:186 : définitions multiples de « soap_getelement » ./c/amsClient/amsC.o:/fs1/git/workerAmaServer/Debug/../c/amsClient/amsC.c:187 : défini pour la première fois ici ./c/soapC.o : Dans la fonction « soap_putelement » : /fs1/git/workerAmaServer/Debug/../c/soapC.cpp:375 : définitions multiples de « soap_putelement » ./c/amsClient/amsC.o:/fs1/git/workerAmaServer/Debug/../c/amsClient/amsC.c:644 : défini pour la première fois ici ./c/soapC.o : Dans la fonction « soap_markelement » : /fs1/git/workerAmaServer/Debug/../c/soapC.cpp:437 : définitions multiples de « soap_markelement » ./c/amsClient/amsC.o:/fs1/git/workerAmaServer/Debug/../c/amsClient/amsC.c:893 : défini pour la première fois ici makefile:46 : la recette pour la cible « workerAmaServer » a échouée collect2: error: ld returned 1 exit status
N'est ce pas suffisant ? Si quelqu'un avait une piste, cela m'aiderait bien.
Je joins les sources aux messages. Tout y est, sauf les urls
Merci d'avance.
Partager