Ciao a tutti
ho questo problema che mi blocca da ieri.....ho la mia web application (fatta col framework 4.0) che ad un certo punto chiama un web service (il distance matrix di google) con questo codice:
codice:XPathDocument Doc = new XPathDocument("http://maps.googleapis.com/maps/api/distancematrix/xml?&origins=" + start + "&destinations=" + stop + "&units=metric&sensor=false&language=it");
tutto funziona bene finchè non passo da IIS... (quindi finchè uso il web server interno di VS tutto è ok)...appena pubblico la mia applicazione quando chiamo la porzione di codice sopra indicata..mi questo errore...
codice:Impossibile stabilire la connessione. Rifiuto persistente del computer di destinazione 173.194.67.95:80 Descrizione: Eccezione non gestita durante l'esecuzione della richiesta Web corrente. Per ulteriori informazioni sull'errore e sul suo punto di origine nel codice, vedere la traccia dello stack. Dettagli eccezione: System.Net.Sockets.SocketException: Impossibile stabilire la connessione. Rifiuto persistente del computer di destinazione 173.194.67.95:80 Errore nel codice sorgente: Traccia dello stack: [SocketException (0x274d): Impossibile stabilire la connessione. Rifiuto persistente del computer di destinazione 173.194.67.95:80] System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +305 System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +699 [WebException: Impossibile effettuare la connessione al server remoto.] System.Net.HttpWebRequest.GetResponse() +7769892 System.Xml.XmlDownloadManager.GetNonFileStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) +160 System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) +318 System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver) +75 System.Threading.CompressedStack.runTryCode(Object userData) +136 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) +0 System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state) +118 System.Xml.XmlTextReaderImpl.OpenUrl() +4996487 System.Xml.XmlTextReaderImpl.Read() +120 System.Xml.XPath.XPathDocument.LoadFromReader(XmlReader reader, XmlSpace space) +386 System.Xml.XPath.XPathDocument..ctor(String uri, XmlSpace space) +130 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3691
Lanciando in vece direttamente il link nel mio browser
http://maps.googleapis.com/maps/api/.../xml?&origins=" + start + "&destinations=" + stop + "&units=metric&sensor=false&language=it
con i parametri inseriti....mi ritorna l'xml corretto...qualcuno sa darmi una mano?![]()

Rispondi quotando