View Single Post
  #2 (permalink)  
Old 11-21-2006, 04:47 AM
Corey Scott Corey Scott is offline
Junior Member
 
Posts: 6
Default

Ok after all day of trying, then posting I found the solution. :-)

If anyone is interested, the code should have been:
Code:
class Context
{
    public $nonotify;
    public $noqualify;
}

$soapClient = new SoapClient(null, array('location' => 'https://192.168.0.199:7071/service/admin/soap/',
                                         'uri'      => 'urn:zimbraAdmin',
                                         'trace'    => 1,
                                         'exception'=> 1,
                                         'soap_version'  => SOAP_1_1,
                                         'style'    => SOAP_RPC,
                                         'use'      => SOAP_LITERAL
                                         ));

$soapHeader = new SoapHeader('urn:zimbra',
                             'context',
                             new Context());

    $soapClient->__setSoapHeaders($soapHeader);
    echo $soapClient->__soapCall("AuthRequest", 
                                    array(
                                        new SoapParam('admin@mworks.com.my', 'name'),
                                        new SoapParam('mypassword', 'password')
                                        ),
                                    array(
                                        'uri'     => 'urn:zimbraAdmin'
                                            ));
Which results in:
Code:
<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:zimbraAdmin" xmlns:ns2="urn:zimbra">
<SOAP-ENV:Header>
<ns2:context>
<nonotify/>
<noqualify/>
</ns2:context>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns1:AuthRequest>
<name>
admin@mworks.com.my</name>
<password>
mypassword</password>
</ns1:AuthRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Hope this helps someone else.

Last edited by Corey Scott : 11-21-2006 at 04:48 AM. Reason: Forgot to change the password before posting
Reply With Quote