Hi All,
*
**So I was about to post about an issue that I had where SOAP addNewUser 
wouldn't send a confirmation email when I found the solution.  I decided to 
post the solution (maddeningly simple) because the thing confounded me for 
a couple hours and I figure it might save some other hapless person some 
time.**
*
*The problem was as Follows:*

I'm trying out Openmeetings SOAP API for the first time and I'm running 
> into a bit of a problem.  I'm trying to add a new user with the addNewUser 
> function and I get back the message code "-40".  From my understanding, 
> this is an indication that everything should be fine, given the 
> documentation:
>
> -40    Message    You have successfully signed up. An email with a 
>> verification code will be sent to your mailbox. 
>
>
> However, I go to my email account and find nothing.  I know my 
> Openmeetigns is configured to send email just fine because it does so for 
> lost passwords and alike (I've even tested it with the particular email 
> address I'm trying to use), however no such email is sent in the situation 
> above.  Also (I don't know if this is an indication of any issue but just 
> in case) no added user shows up in the "Users" administration panel.  
> Additionally (again, don't know if this is a problem) no entry is made in 
> the om_users table in the database.
>

*Solution:*  Turns out my test username was too short.  I was using "bob" 
and openmeetings didn't like that.  However, this was not reflected in any 
sort of error message returned by SOAP...at least none that my code picked 
up on (see below).  Just thought this might be helpful to anyone who might 
be in the same situation (I'd already typed up a whole bunch so I figured 
it would be good not to let it go to waste).



*My php code:*

> <?php
>         $wsdl = 
> "http://localhost:5080/openmeetings/services/UserService?wsdl";;
>         $SOAP = new SoapClient($wsdl, array(
>                     "trace"=>1,
>                     "exceptions"=>0));
>         $value = $SOAP->getSession();
>         $session = $value->return;
>         $sid = $session->session_id;
>         print "<pre>\n";
>     
>         print "<br />\n Request: 
> ".htmlspecialchars($SOAP->__getLastRequest());
>         
>         print "<br />\n Response: 
> ".htmlspecialchars($SOAP->__getLastResponse());
>         
>         print "</pre>";
>         print "<br/>\n SID: $sid";
>         $params = array(
>             'SID' => $sid,
>             'username' => 'admin',
>             'userpass' => 'password'
>         );
>
>         $result = $SOAP-> loginUser($params);
>         print "<pre>\n";
>     
>         print "<br />\n Request: 
> ".htmlspecialchars($SOAP->__getLastRequest());
>         
>         print "<br />\n Response: 
> ".htmlspecialchars($SOAP->__getLastResponse());
>         
>         print "</pre>";
>         $parameters = 
> array("SID"=>$sid,"username"=>"Bob","userpass"=>"password","lastname"=>"Woodward","firstname"=>"Robert","email"=>"[email protected]",
>  
> "additionalname"=>NULL, "street"=>"555 Test Street", "zip"=>"55555", 
> "fax"=>NULL, "states_id"=>"1", "town"=>"City", "language_id"=>"1", 
> "baseURL"=>"http://website.com";);
>         echo "<br/><strong>Parameters:</strong> ";
>         var_dump($parameters);
>         $value = $SOAP->addNewUser($parameters);
>                 print "<pre>\n";
>     
>         print "<br />\n Request: 
> ".htmlspecialchars($SOAP->__getLastRequest());
>         
>         print "<br />\n Response: 
> ".htmlspecialchars($SOAP->__getLastResponse());
>         
>         print "</pre>";
>         
> ?>
>

*
***

Reply via email to