Ça va être compliqué : j'appelle un web service d'une application interne uniquement accessible sur notre intranet.
Le mieux que je puisse faire c'est copier l'intégralité de ce que je vois passer en entrée et sortie dans wireshark.
En sortie :
Interface id: 0
WTAP_ENCAP: 1
Arrival Time: Feb 20, 2013 16:21:38.702533000 Paris, Madrid
Time shift for this packet: 0.000000000 seconds
Epoch Time: 1361373698.702533000 seconds
Time delta from previous captured frame: 0.000441000 seconds
Time delta from previous displayed frame: 0.000441000 seconds
Time since reference or first frame: 607.009440000 seconds
Frame Number: 8384
Frame Length: 533 bytes (4264 bits)
Capture Length: 533 bytes (4264 bits)
Frame is marked: False
Frame is ignored: False
Protocols in frame: eth:ip:tcp:http
Coloring Rule Name: HTTP
Coloring Rule String: http || tcp.port == 80
Internet Protocol Version 4, Src: 192.168.3.115 (192.168.3.115), Dst: 192.168.3.232 (192.168.3.232)
Transmission Control Protocol, Src Port: 55446 (55446), Dst Port: http-alt (8080), Seq: 1, Ack: 1, Len: 479
Source port: 55446 (55446)
Destination port: http-alt (8080)
Hypertext Transfer Protocol
Expert Info (Chat/Sequence): POST /obix/watchService/make/ HTTP/1.1\r\n
Message: POST /obix/watchService/make/ HTTP/1.1\r\n
Request Method: POST
Request URI: /obix/watchService/make/
Request Version: HTTP/1.1
Host: 192.168.3.232:8080\r\n
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0\r\n
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3\r\n
Accept-Encoding: gzip, deflate\r\n
Referer:
http://localhost:59619/testTrends.htm\r\n
Origin: http://localhost:59619\r\n
Connection: keep-alive\r\n
Pragma: no-cache\r\n
Cache-Control: no-cache\r\n
Full request URI:
http://192.168.3.232:8080/obix/watchService/make/
Et en retour :
Interface id: 0
WTAP_ENCAP: 1
Arrival Time: Feb 20, 2013 16:21:38.705858000 Paris, Madrid
Time shift for this packet: 0.000000000 seconds
Epoch Time: 1361373698.705858000 seconds
Time delta from previous captured frame: 0.003325000 seconds
Time delta from previous displayed frame: 0.003325000 seconds
Time since reference or first frame: 607.012765000 seconds
Frame Number: 8385
Frame Length: 1152 bytes (9216 bits)
Capture Length: 1152 bytes (9216 bits)
Frame is marked: False
Frame is ignored: False
Protocols in frame: eth:ip:tcp:http:xml
Coloring Rule Name: HTTP
Coloring Rule String: http || tcp.port == 80
Internet Protocol Version 4, Src: 192.168.3.232 (192.168.3.232), Dst: 192.168.3.115 (192.168.3.115)
Transmission Control Protocol, Src Port: http-alt (8080), Dst Port: 55446 (55446), Seq: 1, Ack: 480, Len: 1098
Source port: http-alt (8080)
Destination port: 55446 (55446)
Hypertext Transfer Protocol
HTTP/1.1 200 OK\r\n
Request Version: HTTP/1.1
Status Code: 200
Response Phrase: OK
Content-Length: 814\r\n
Content-Type: text/xml\r\n
Server: Microsoft-HTTPAPI/1.0\r\n
Access-Control-Allow-Origin: *\r\n
Access-Control-Allow-Methods: POST, GET, PUT\r\n
Access-Control-Max-Age: 1000\r\n
Access-Control-Allow-Headers: Content-Type\r\n
Date: Wed, 20 Feb 2013 15:21:35 GMT\r\n
<?xml version="1.0" encoding="utf-16" ?>
<?xml-stylesheet type='text/xsl' href='/obix/xsd' ?>
<obj name="watch112" href="
http://192.168.3.232:8080/obix/watchService/watch112/" is="obix:Watch">
<reltime name="lease" href="lease/" writable="true" val="PT1M" min="PT0S"/>
<int name="addFrequency" href="addFrequency/" writable="true" val="5000" min="0"/>
<op name="add" href="add/" in="obix:WatchIn" out="obix:WatchOut"/>
(...)
Je ne mets pas tout le xml, parce que ça n'a pas de grand intérêt.
Mais donc on voit bien ma requête partir à partir de mon
http://localhost:59619 en destination de mon serveur local sur port 8080.
On voit bien la réponse revenir avec le xml attendu.
Et c'est ce xml qui est interprété dans mon responseText de l'instance de mon objet XmlHTTPRequest par une chaîne de caractères chinois...
En tout cas, je te remercie déjà de t'être penché sur mon problème