Impossibile connettersi all'API Soap SugarCRM
Domanda
Ho appena iniziato un progetto in cui devo inserire i contatti in un sistema SugarCRM usando l'interfaccia SOAP.
Finora ho creato un riferimento al servizio http: // sugar -dev.walkinwifi.net/soap.php?wsdl=sugarsoap
Quindi ho scritto un codice come questo
public SugarHelper()
{
//Create a new instance of the client proxy
this.sugarClient = new sugarsoapPortTypeClient();
//Set the default value
this.sessionId = String.Empty;
}
public bool Authenticate(string Username, string Password)
{
//Create an authentication object
user_auth user = new user_auth();
//Set the credentials
user.user_name = Username;
user.password = this.computeMD5String(Password);
//Try to authenticate
set_entry_result authentication_result = this.sugarClient.login(user, "");
questo ti dà il gusto.
L'ultima riga mi dà un'eccezione quando viene chiamato il login.
L'eccezione che ricevo ha un'eccezione interna che si lamenta che non può connettersi a https: // sugar-dev.walkinwifi.net/soap.php
{"An error occurred while making the HTTP request to https://sugar-dev.walkinwifi.net/soap.php. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server."}
Da dove viene la parte https? Non ho usato nessun altro riferimento diverso da http, ma l'errore indica chiaramente https.
Posso collegarmi a SugarCRM soap tramite http o devo usare https?
In tutti gli esempi che posso trovare in rete è http, ma la maggior parte di essi sono php con quelli molto c #.
Soluzione
Sto guardando nel posto sbagliato. All'interno della configurazione Soap di Sugar si specifica l'URL che verrà utilizzato per le chiamate soap. Questo è impostato su https://sugar-dev.walkinwifi.com .
Modificato in http e tutto va bene.
Altri suggerimenti
In ogni caso, anche i servizi SOAP devono funzionare su HTTPS. Personalmente non ho avuto problemi, nemmeno con un client C #. Verificare che il certificato del server e la catena di certificati siano validi.
Ciao, Antonio.