Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServerException when using getdomain() if domain does not exist in zimbra server #35

Open
Zelrone opened this issue Jun 22, 2018 · 0 comments

Comments

@Zelrone
Copy link

Zelrone commented Jun 22, 2018

I tried using getdomain() function of Zimbra API and it works well when I provide the domain name that exists in the mail server, but if I try and give a domain name that is not added in the mail server its gives me the following error message in laravel.

ServerException in RequestException.php line 113:
Server error: `POST https://mail.fisquare.net:7071/service/admin/soap` resulted in a `500 Server Error` response:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra"><change tok (truncated...)

I am using the function as below :

           $api = \Zimbra\Admin\AdminFactory::instance(env("ZIMBRA_URL"));
           $api->auth(env("ZIMBRA_USER_ID"), env("ZIMBRA_PASSWORD"));

            $domain = new \Zimbra\Admin\Struct\DomainSelector(\Zimbra\Enum\DomainBy::NAME(), $domainName);
            $data = $api->getDomain($domain);
            $ret["status"] = "success";
            $ret["msg"] = "Domain found";
            $ret["domainId"] = $data->domain->id;

This code works well when the domain exists but for a domain that is not in the mail server, I am getting the above exception. Can someone tell me if I am doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant