我刚刚开始了一个项目,我需要使用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。

有帮助吗?

解决方案

我正在寻找错误的地方。在Sugar的Soap配置中,您可以指定将用于soap调用的URL。这设置为 https://sugar-dev.walkinwifi.com

将其更改为http,一切顺利。

其他提示

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

再见 安东尼奥。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top