1

我刚刚开始了一个项目,我需要使用 SOAP 接口将联系人插入到 SugarCRM 系统中。

到目前为止,我已经创建了对服务http://sugar-dev.walkinwifi.net/soap.php?wsdl=sugarsoap的引用

然后写一些这样的代码

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, "");

这给了你一个笑话。

调用 login 时,最后一行给了我一个异常。

我得到的异常有一个内部异常抱怨它无法连接到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."}

https部分来自哪里?除了 http,我没有使用其他参考,但错误清楚地说明了 https。

我可以通过 http 连接到 SugarCRM soap 还是必须使用 https?

在我可以在网上找到的所有示例中,它都是 http,但其中大多数是带有非常 c# 的 php。

4

2 回答 2

1

我找错地方了。在 Sugar 的 Soap 配置中,您指定将用于肥皂调用的 url。这设置为https://sugar-dev.walkinwifi.com

将其更改为http,一切都很好。

于 2009-09-17T16:54:30.093 回答
0

在任何情况下,SOAP 服务也必须通过 HTTPS 工作。就我个人而言,即使使用 C# 客户端,我也没有遇到任何问题。验证服务器证书和证书链是否有效。

再见,安东尼奥。

于 2011-09-28T13:35:32.017 回答