J'apprends Ruby et j'ai écrit le code suivant pour savoir comment utiliser les services SOAP:Comment analyser la réponse SOAP du client Ruby?
require 'soap/wsdlDriver'
wsdl="http://www.abundanttech.com/webservices/deadoralive/deadoralive.wsdl"
service=SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
weather=service.getTodaysBirthdays('1/26/2010')
La réponse que je nous obtenons est:
#<SOAP::Mapping::Object:0x80ac3714
{http://www.abundanttech.com/webservices/deadoralive} getTodaysBirthdaysResult=#<SOAP::Mapping::Object:0x80ac34a8
{http://www.w3.org/2001/XMLSchema}schema=#<SOAP::Mapping::Object:0x80ac3214
{http://www.w3.org/2001/XMLSchema}element=#<SOAP::Mapping::Object:0x80ac2f6c
{http://www.w3.org/2001/XMLSchema}complexType=#<SOAP::Mapping::Object:0x80ac2cc4
{http://www.w3.org/2001/XMLSchema}choice=#<SOAP::Mapping::Object:0x80ac2a1c
{http://www.w3.org/2001/XMLSchema}element=#<SOAP::Mapping::Object:0x80ac2774
{http://www.w3.org/2001/XMLSchema}complexType=#<SOAP::Mapping::Object:0x80ac24cc
{http://www.w3.org/2001/XMLSchema}sequence=#<SOAP::Mapping::Object:0x80ac2224
{http://www.w3.org/2001/XMLSchema}element=[#<SOAP::Mapping::Object:0x80ac1f7c>,
#<SOAP::Mapping::Object:0x80ac13ec>,
#<SOAP::Mapping::Object:0x80ac0a28>,
#<SOAP::Mapping::Object:0x80ac0078>,
#<SOAP::Mapping::Object:0x80abf6c8>,
#<SOAP::Mapping::Object:0x80abed18>]
>>>>>>> {urn:schemas-microsoft-com:xml-diffgram-v1}diffgram=#<SOAP::Mapping::Object:0x80abe6c4
{}NewDataSet=#<SOAP::Mapping::Object:0x80ac1220
{}Table=[#<SOAP::Mapping::Object:0x80ac75e4
{}FullName="Cully, Zara"
{}BirthDate="01/26/1892"
{}DeathDate="02/28/1979"
{}Age="(87)"
{}KnownFor="The Jeffersons"
{}DeadOrAlive="Dead">,
#<SOAP::Mapping::Object:0x80b778f4
{}FullName="Feiffer, Jules"
{}BirthDate="01/26/1929"
{}DeathDate=#<SOAP::Mapping::Object:0x80c7eaf4>
{}Age="81"
{}KnownFor="Cartoonists"
{}DeadOrAlive="Alive">]>>>>
J'ai beaucoup de la difficulté à comprendre comment analyser et afficher les informations renvoyées dans une bonne table, ou même comment faire une boucle dans les enregistrements et avoir accès à chaque élément (par exemple FullName, Age, etc.). Je suis allé à travers l'ensemble "getTodaysBirthdaysRethods - Object.new.methods" et a continué à travailler pour essayer de trouver comment accéder aux éléments, mais ensuite j'arrive au tableau et je me suis perdu.
Toute aide qui peut être offerte serait appréciée.
J'ai regardé brièvement Handsoap hier, est-ce juste un client de savon ou puis-je créer un serveur de savon juste Comme Soap4r StandaloneServer – nas
Sur une autre note pouvez-vous me montrer quelque chose qui a une comparaison entre Soap4R et HandSoap. Je serais très intéressé à regarder les avantages et les inconvénients de HandSoap et Soap4R les uns sur les autres. Évidemment, ni l'un ni l'autre ne peut avoir que des avantages ou des inconvénients par rapport à un autre. – nas
C'est juste un client. Il y a une certaine justification pour la bibliothèque sur la page du projet, mais une petite histoire: Handsoap prend plus d'effort à l'avance, mais facilite le débogage du code si/quand les choses échouent (ce que cela fait parce que SOAP est un cauchemar de protocole). Il fait également pour le code plus léger/plus rapide. – troelskn