Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-26-2011, 06:50 AM
Special Member
 
Posts: 149
Default SOAP API changes from 5 to 6?

Since I'm getting nowhere with support after 2 weeks, I figure I post here and hope someone else can help...

We use SOAP API routines to manage our add/deletes. But after upgrading our dev environment to 6, it's not working properly. The scripts making the calls get error 500s where as there is no error being reported in the log files at the server.

Here's an example code:

Code:
<ns0:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/">
<ns0:Header><ns1:context xmlns:ns1="urn:zimbra"><authToken>nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn</authToken>
</ns1:context></ns0:Header>
<ns0:Body><ns2:CreateAccountRequest xmlns:ns2="urn:zimbraAdmin">
<name>user@domain.net</name><password></password>
<an="zimbraCOSId">4a43c637-0913-4591-876f-ab94acb4b227</a>
<an="displayName">John N. Doe</a>
</ns2:CreateAccountRequest></ns0:Body></ns0:Envelope
>

We get back:

SOAP request failed: code=500, error=Server closed connection without
sending any data back

But looking at the logs, the account is created and there are no errors...

Last edited by su_A_ve; 07-26-2011 at 07:53 AM..
Reply With Quote
  #2 (permalink)  
Old 07-26-2011, 06:55 AM
raj raj is offline
Moderator
 
Posts: 768
Default

what Dev tools/programming language are you using and this output is from where ?
the <ns0 and <ns2 tags you have are little weird.

By the way: please dont post the Auth tokens on public fourms its not secure.

i have used the API since 4.0 to 7.0, works across all..one thing i must say Zimbra API is highly stable and backward compatible.

Raj
__________________
i2k2 Networks
Dedicated & Shared Zimbra Hosting Provider
Reply With Quote
  #3 (permalink)  
Old 07-26-2011, 08:00 AM
Special Member
 
Posts: 149
Default

We are using perl (Zimbra::SOAP). I'm working with our programmer - he passed me the sample code he is using.

Looking it in action, we had increased the logging level and clearly see the response back from the server, however 'somewhere' is being either misinterpreted or not understood and hence an error 500 is returned by libwwwperl.

Here's the snippet of code that checks for that response:
Code:
   my $res = $ua->request($req);
    if (!defined($res)) {
        print STDERR "No response from server\n";
        return undef;
    }

    my $xml = undef;
    eval {
        $xml = Zimbra::SOAP::XmlElement::parse($res->content);
    };
    if (!defined($xml)) {
        # Check for network/HTTP error after trying XML parse because
        # a SOAP fault comes back with HTTP 500 status.
        if ($res->is_error()) {
            print STDERR
                "SOAP request failed: code=" . $res->code() .
                ", error=" . $res->message() . "\n";
        } else {
            # We have legitimate XML parse error.
            print STDERR
                "Unable to parse SOAP response: " . $res->content() . "\n";
        }
        return undef;
    }
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.