Results 1 to 3 of 3

Thread: Creating user accounts with SOAP

  1. #1
    Andreas is offline New Member
    Join Date
    Dec 2005
    Posts
    4
    Rep Power
    9

    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

  2. #2
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    18

    Default

    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    Andreas is offline New Member
    Join Date
    Dec 2005
    Posts
    4
    Rep Power
    9

    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?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 21
    Last Post: 02-04-2010, 10:06 AM
  2. Post instsallation problems
    By Assaf in forum Installation
    Replies: 14
    Last Post: 01-29-2007, 11:38 AM
  3. Services stopped working
    By lilwong in forum Administrators
    Replies: 4
    Last Post: 08-15-2006, 09:19 AM
  4. Fedora Core 3, Clean Install - Not working!
    By pcjackson in forum Installation
    Replies: 17
    Last Post: 03-05-2006, 07:38 PM
  5. Network edition - strange behavior
    By goetzi in forum Installation
    Replies: 6
    Last Post: 11-16-2005, 03:08 PM

Posting Permissions

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