Results 1 to 7 of 7

Thread: SOAP post HTTP error

  1. #1
    MichaelA1 is offline Junior Member
    Join Date
    Apr 2006
    Posts
    5
    Rep Power
    8

    Question SOAP post HTTP error

    Hi, I am trying to post SOAP to http://dev.mydomain.com:7071/service/admin/soap/

    I am using MS.Net's HttpSoapRequest and Respose classes to post SOAP request. The xml is pasted below:

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
    <context xmlns="urn:zimbra"/>
    </soap:Header>
    <soap:Body>
    <AuthRequest xmlns="urn:zimbraAdmin">
    <name>admin@mydomain.com</name>
    <password>mystrongpassword</password>
    </AuthRequest>
    </soap:Body>
    </soap:Envelope>


    But I am consistently getting the following error in VS.Net:

    "The underlying connection was closed: The server committed an HTTP protocol violation."

    I would appreciate any suggestions?

    Thanks.

  2. #2
    sam
    sam is offline Zimbra Employee
    Join Date
    Aug 2005
    Posts
    821
    Rep Power
    10

    Default

    where's the documentation for HttpSoapRequest?
    Sam Khavari

    :: :: [ Zimbra ] :: :: [ Bugzilla ] :: :: [ Product Portal ] :: :: [ Wiki ] :: :: [ Downloads ] :: :: [ . ] ::

  3. #3
    MichaelA1 is offline Junior Member
    Join Date
    Apr 2006
    Posts
    5
    Rep Power
    8

    Default code

    Here is the code I am using...

    try
    {
    // txt file containing the xml to post
    string xmlfile = "AuthToken.txt"

    XmlDocument doc = new XmlDocument();

    doc.Load(@"F:\Test Code\Zimbra\" +xmlfile);

    HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://myurl:7071/service/admin/soap/");


    // if SOAPAction header is required, add it here...
    // this does not help either uncommented or commented
    //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();

    //runs fine up to this point
    //================================================= //Protocol exception generated here at Request::GetResponse()
    HttpWebResponse myHttpWebResponse = (HttpWebResponse)req.GetResponse();



    // Releases the resources of the response.

    stm = myHttpWebResponse.GetResponseStream();
    //myHttpWebResponse.Close();

    //=================================================
    }
    catch(Exception e)
    {
    Console.WriteLine("error occured " + e.Message);
    }

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

    Default Ssl?

    It should be an SSL request so:

    https://myurl:7071/service/admin/soap/
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  5. #5
    MichaelA1 is offline Junior Member
    Join Date
    Apr 2006
    Posts
    5
    Rep Power
    8

    Question must use SSL for dev also?

    Oh, Does the URL have to be using SSL? I was just testing and using "post" to HTTPS would require more code writing. So to cut out some dev time I have just been posting to http for testing.

    But could it be why this is throwing the exception?

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

    Default

    By default we only accept SSL on that port. So unless you've configured it for HTTP it won't work. The exception IMHO is the HTTP parser barfing on the SSL handshake.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  7. #7
    MichaelA1 is offline Junior Member
    Join Date
    Apr 2006
    Posts
    5
    Rep Power
    8

    Default Thanks.

    Great, Thanks. I will code the complete SSL posting functionalities and let you know my progress.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Zimbra fails after working for 2 weeks
    By Linsys in forum Administrators
    Replies: 10
    Last Post: 10-07-2008, 12:42 AM
  2. Postfix problem
    By jimbo in forum Administrators
    Replies: 46
    Last Post: 07-23-2007, 05:24 AM
  3. 3.0 to 4.5.3 Upgrade failed (mysql error)
    By dealt in forum Installation
    Replies: 35
    Last Post: 03-19-2007, 10:30 PM
  4. M3 problem with shares
    By titangears in forum Users
    Replies: 4
    Last Post: 01-12-2006, 01:01 PM
  5. Building native libraries on MacOS X
    By ajmas in forum Developers
    Replies: 3
    Last Post: 10-14-2005, 11:00 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
  •