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

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 01-18-2006, 12:14 PM
New Member
 
Posts: 4
Default Creating user accounts with SOAP

Hi everyone!

I have been following the ongoing discussions about SOAP with great interest.
In my environment I use Active Directory(AD) as a central authentication and identity backend. It works great with other applications such as our Mambo portal and our e-learning system Moodle. I usually create accounts in AD by scripts but now I am adding functionality to my own Student information system(SIS) to directly create the AD accounts when we add a new student. This way the new student is registered at courses, receiving network logon, is registered in our e-learning system. The only problem left is to create the mail account simultaneously. I am thinking about using a SOAP request to my zimbra test server from my SIS to achieve this. The SIS is written in ASP.NET and probably will be released as open source in the near future (as soon as some bugs are corrected and the database backend is changed to MySQL).

I would like some advice about an easy way to post a SOAP-request to my ZImbraserver. Generating the correct xml-code is no problem, I am just stuck in posting the request??? Thus, how do I send the xml-SOAP to the server??
(Excuse for this dumb question, but I have never been working with SOAP or Web services!)

Best regards
Andreas Göransson
Reply With Quote
  #2 (permalink)  
Old 01-18-2006, 04:38 PM
Zimbra Employee
 
Posts: 4,792
Default

See:

Create user with SOAP
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #3 (permalink)  
Old 01-19-2006, 01:17 AM
New Member
 
Posts: 4
Default

OK, I have read and understood that post. I also found information about the posting process itself on another website, thought it might work, do you have any opinion?

Code:
<script Language="C#" runat="server">
protected void Page_Load(object sender, EventArgs e)
{
string xmlfile;
xmlfile=Request.Params["xmlfile"];
if (xmlfile==null)
xmlfile="uddi.xml";
HttpSOAPRequest(xmlfile,null);
}

void HttpSOAPRequest(String xmlfile, string proxy)
{
XmlDocument doc = new XmlDocument();
doc.Load(@"C:\Inetpub\wwwroot\ASP.NET\" +xmlfile);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://uddi.microsoft.com/inquire");
if (proxy != null) req.Proxy = new WebProxy(proxy,true);
// if SOAPAction header is required, add it here...
req.Headers.Add("SOAPAction","\"\"");

req.ContentType = "text/xml;charset=\"utf-8\"";
req.Accept = "text/xml";
req.Method = "POST";
Stream stm = req.GetRequestStream();
doc.Save(stm);
stm.Close();
WebResponse resp = req.GetResponse();
stm = resp.GetResponseStream();
StreamReader r = new StreamReader(stm);
// process SOAP return doc here. For now, we'll just send the XML out to the browser ...
Response.Write(r.ReadToEnd());
}
</script>
What it does is simply generating a HTTPRequest and sends the xml data to the URL given in WebRequest.Create() Method. Could this work?
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.