J'utilise classique "ASP" ne me bea up. Juste havent été en mesure de faire le saut à .Net pour le moment. Je suis en train d'apprendre du savon et j'ai réussi à créer une requête SOAP pour un webservice. Cependant, je suis incapable de comprendre comment analyser la réponse et retirer un seul nœud. J'utilise MS DOM pour charger la réponse dans un document. Je peux obtenir la réponse à l'écran. J'ai essayé ce qui suit, mais je n'arrive pas à accéder à n'importe quel node_text individuellement.msxml Réponse de savon d'analyse en utilisant MS DOM et classique asp
'Set the XML Object
Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
'Set Asynchoronous = false
xmlDoc.async = False
'Load the XML file.
'User Server.MapPath method is the XML is located in your site.
'Else you can use the absolute path.
xmlDoc.Load (strResult)
'If there is any errors pasring the file the notify
If xmlDoc.parseError.errorCode = 0 Then
Response.Write "Error Parsing XML"
Response.Write "Rason :" & xmlDoc.parseError.reason & "Error Line: " & xmlDoc.parseError.line
End If
'Get ALL the Elements by the tag name book
Set sessionid = xmlDoc.getElementsByTagName("session_id")
'Now Iterate through the List and Display
response.write"sessionid ="&sessionid&"<BR>"
For i = 0 to (sessionid.Length-1)
Response.Write "session_id " & sessionid.item(i).childNodes(0).text & "<br/>"
Next
Voici une réponse que je suis en train d'analyser
<ns:getSessionResponse xmlns:ns="http://services.axis.openmeetings.org">
<ns:return xmlns:ax217="http://basic.beans.data.app.openmeetings.org/xsd"
xmlns:ax218="http://basic.beans.hibernate.app.openmeetings.org/xsd"
type="org.openmeetings.app.hibernate.beans.basic.Sessiondata">
<ax218:id>71</ax218:id>
<ax218:language_id xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax218:organization_id xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax218:refresh_time>2010-11-04T15:17:13.717Z</ax218:refresh_time>
<ax218:sessionXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax218:session_id>5f0415d9cdb72681816095debf3735de</ax218:session_id>
<ax218:starttermin_time>2010-11-04T15:17:13.717Z</ax218:starttermin_time>
<ax218:storePermanent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
<ax218:user_id xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true" />
</ns:return>
</ns:getSessionResponse>
je dois tirer le id_session de ce pare mais juste ne semble être en mesure de le faire. Et oui, je cherche à passer à .NET bientôt.
La mise en forme de l'exemple de réponse semble avoir été perdue lors de la traduction. Pouvez-vous inclure à nouveau la réponse XML? – jveazey