Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Basic SOAP Questions

  1. #11
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default No auth token

    Let's see. The piece that's failing is
    Code:
            Account adminAcct = prov.get(AccountBy.id, lc.getAuthtokenAccountId());
            if (adminAcct == null)
                throw AccountServiceException.NO_SUCH_ACCOUNT(lc.getAuthtokenAccountId());
    No auth token would mean lc.getAuthtokenAccountId() is null which means admin account lookup will fail.

    So... what does your request look like? Are you sure that you're including the auth token in the <context> block in the SOAP envelope?
    Last edited by dkarp; 07-13-2007 at 06:09 AM.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  2. #12
    Join Date
    Jul 2006
    Location
    Pisa
    Posts
    135
    Rep Power
    9

    Default exactc sequence

    Hi

    I had the same problem too, I starded grom the getMsg.pl script and
    solved it as follow (perl code)

    my $adm = new XmlDoc;
    $adm->start('AuthRequest', "urn:zimbraAdmin");
    $adm->add('name', undef, undef, $admin );
    $adm->add('password', undef, undef, $adminPsw);
    $adm->end();
    # Authenticate as admin
    my $admAuthResponse = $SOAP->invoke($admUrl, $adm->root());
    #print "Admin AuthResponse = ".$admAuthResponse->to_string("pretty")."\n";
    my $admAuthToken = $admAuthResponse->find_child('authToken')->content;
    #print "admAuthToken $admAuthToken\n";
    my $admContext = $SOAP->zimbraContext($admAuthToken, $admin);
    # my $admContextStr = $admContext->to_string("pretty");
    # print "admContextStr $admContextStr\n";
    my $delega = new XmlDoc;
    $delega->start('DelegateAuthRequest', "urn:zimbraAdmin");
    # print $userId."\n";
    $delega->add('account', undef, { by => "name"}, $userId );
    $delega->end();
    # Get a new auth token that is valid for $userId
    my $delegaAuthResponse = $SOAP->invoke($admUrl, $delega->root(),$admContext);
    # print "Delega AuthResponse = ".$delegaAuthResponse->to_string("pretty")."\n";
    my $delegaAuthToken = $delegaAuthResponse->find_child('authToken')->content;
    my $newContext = $SOAP->zimbraContext($delegaAuthToken, $userId);


    first I authenticate as admin
    then obtain a delegated authtoken
    from the new authtoken I retrieve the newContext that I can use instead of the old context obtained authenticating the user
    Last edited by lfasci; 07-13-2007 at 08:59 AM.

  3. #13
    Join Date
    May 2007
    Location
    Perth, Western Australia
    Posts
    14
    Rep Power
    8

    Default And therein lies the key...

    Quote Originally Posted by lfasci View Post
    Hi

    # Get a new auth token that is valid for $userId
    my $delegaAuthResponse = $SOAP->invoke($admUrl, $delega->root(),$admContext);
    My DelegateAuthResponse was not including the Admin Context! Simply added the context I got from the initial AuthRequest and presto, my DelegateAuthResponse was successful!

    MANY thanks to all who helped me understand this a little better!

  4. #14
    Join Date
    Sep 2007
    Posts
    9
    Rep Power
    8

    Default

    I have posted this on another thread but this thread seems more 'soap active' so here goes ... hopefully i can get some help ...thanks folks ...

    __________________________________________________ ________________

    I have major SOAP connectivity issues as well and have almost given up pursuing this. I tried using the Java code mentioned in an earlier post to no avail. Here is my code and the errors are meaningless as i dont have the source code for SoapTransport..

    SoapProvisioning sp = new SoapProvisioning();
    sp.soapSetURI("https://localhost:7071/zimbraAdmin/");
    sp.soapAdminAuthenticate("admin","password");
    createZimbraAccount = sp.createAccount("username", "password", getMap());

    and my error is ...
    at org.apache.commons.logging.LogFactory.getLog(LogFa ctory.java:353)
    at org.apache.commons.httpclient.HttpClient.<clinit>( HttpClient.java:69)
    at com.zimbra.soap.SoapHttpTransport.<init>(SoapHttpT ransport.java:61)
    at ZimbraSoap.createUser(ZimbraSoap.java:173)
    at ZimbraSoap.main(ZimbraSoap.java:42)


    Ive included zimbrastore.jar into my project along with the other jar files. is your issue similar to this ...

Similar Threads

  1. XSD/WSDL Files for the SOAP Server?
    By photoadrian in forum Developers
    Replies: 5
    Last Post: 12-23-2012, 01:32 AM
  2. Basic Installation Questions
    By jhoelz in forum Installation
    Replies: 7
    Last Post: 03-02-2007, 11:21 AM
  3. Project Management, Testing and basic Javascript questions
    By JoshuaPrismon in forum Developers
    Replies: 2
    Last Post: 01-08-2007, 02:30 PM
  4. new to ZCS.. just two questions basic install
    By sewerynb in forum Installation
    Replies: 4
    Last Post: 10-12-2006, 11:55 AM
  5. Replies: 6
    Last Post: 03-17-2006, 09:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •