Results 1 to 9 of 9

Thread: Error 405 HTTP method POST is not supported by this URL

  1. #1
    Join Date
    Oct 2009
    Location
    Italy
    Posts
    2
    Rep Power
    6

    Exclamation Error 405 HTTP method POST is not supported by this URL

    Hello,
    i have a problem devloping a jsp based zimlet under Zimbra 6.

    this is the code associated to the onMsgView event:

    Code:
            var requestParams = 
    	{
    		op		: 2,
    		msgID	: _msgID,
    		accountID : _accountID
    	}; 
    	thisObj = this;
    
    	this._request("myzimlet.jsp", requestParams, function(responce)
            {
              ...
            });
    and the function _request is like this:

    Code:
    com_zimbra_myzimlet.prototype._request = function(url, params, callback)
    {	
        var requestUrl = this.getResource(url);
        
    var requestHeader =
        {
            "Content-Type":"application/x-www-form-urlencoded"
        };
       
        var requestParams = this._urlEncode(params);
    
        var tempCallback = function(response)
        {
            var jsonResponse = eval("(" + response.text + ")");
    
            if(!jsonResponse.error)
            {
                callback(jsonResponse);
            }
            else
            {
                this._alert("Error", jsonResponse.error);
            }
        }
    
        AjxRpc.invoke(requestParams, requestUrl, requestHeader, new AjxCallback(this, tempCallback));
    
    }
    i see in firebug the error in the thread title:

    HTML Code:
    <title>Error 405 HTTP method POST is not supported by this URL</title>
    </head>
    <body><h2>HTTP ERROR 405</h2>
    <p>Problem accessing /service/zimlet/com_zimbra_myzimlet/myzimlet.jsp. Reason:
    <pre>    HTTP method POST is not supported by this URL</pre></p><hr /><i><small>Powered by Jetty://</small></i><br/>   
    Is this a Zimbra 6 bug?
    Note that the same zimlet works perfect in zimbra desktop (based on Zimbra 5).

    Is there some extra configuration involved?

    Is the AjxRpc.invoke method obsolete in Zimbra 6?

    Thanks for help.

  2. #2
    Join Date
    Nov 2005
    Posts
    477
    Rep Power
    10

    Default

    There have been reports of problems here. There are three canidates:

    1) The JSP is not compiling correctly:
    Zimlet JSP - Zimbra :: Wiki

    2) A bug in AjxRPC.invoke

    3) A error in the proxy.

    Can you look at the first and figure out if it applies to you?

  3. #3
    Join Date
    Oct 2009
    Location
    Italy
    Posts
    2
    Rep Power
    6

    Default

    Thanks Joshua for your reply!

    I bypassed the POST problem using the useGet flag of AjxRpc.invoke function using the serverUrl followed by the params passed to the jsp.
    This is the signature:

    Code:
    AjxRpc.invoke = function(requestStr, serverUrl, requestHeaders, callback, useGet, timeout)
    Now the zimlet is working properly.

    By the way.. the POST problem is not "solved" yet..

  4. #4
    Join Date
    Sep 2005
    Posts
    187
    Rep Power
    10

    Default

    Quote Originally Posted by alioscia View Post
    Thanks Joshua for your reply!

    I bypassed the POST problem using the useGet flag of AjxRpc.invoke function using the serverUrl followed by the params passed to the jsp.
    This is the signature:

    Code:
    AjxRpc.invoke = function(requestStr, serverUrl, requestHeaders, callback, useGet, timeout)
    Now the zimlet is working properly.

    By the way.. the POST problem is not "solved" yet..
    alioscia,
    Its most likely a bug w.r.t POST to custom-jsp throwing 405, I think web.xml isn't configured properly to allow this.

    With that exception, AjxRpc.invoke should work just fine like in 5.0.x (i.e. http get and http post to external sites; http get to internal jsp)
    Bugzilla - Wiki - Downloads - Before posting... Search!

  5. #5
    Join Date
    Jun 2010
    Posts
    5
    Rep Power
    5

    Default HTTP method POST is not supported by this URL

    I'm getting the same error using Zend Framework's Zend_Soap_Client.

    Please help, I'm under time constraints here at my job.

    Thank you!

  6. #6
    Join Date
    Sep 2005
    Posts
    187
    Rep Power
    10

    Default

    Can you post Firebug's Request, Response, Headers etc (use network tab)?
    Bugzilla - Wiki - Downloads - Before posting... Search!

  7. #7
    Join Date
    Jun 2010
    Posts
    5
    Rep Power
    5

    Default

    Thanks for the quick reply.

    Ok, maybe some progress. Looking aorund in the forum here, I noticed that people are using a different URL than in the *soap.txt file. The file says to use: /service/content/get for requests and that is when I got the error mentioned. I changed that to: /service/admin/soap and now it seems to be working.

    What is the correct URL for SOAP requests and for SOAP posts?

    * with respect, why don't you (the Zimbra people) just write some nice, concise docs for both the REST & SOAP API's? I realize that you're trying to sell a product, however, you're wasting your time and everyone else's by providing these half-baked notes. It also causes a lot of unecessary frustration. If you don't want to provide API's, then don't. But don't make people suffer through this guess work just because you're trying to sell something.

    The REST API docs are ok, but they're still incomplete and leave out a lot of critical information. Are there any real SOAP docs? Nowhere have I found some straight forward examples of how to use either of your API's.

  8. #8
    Join Date
    May 2009
    Posts
    48
    Rep Power
    6

    Default

    Quote Originally Posted by JoshuaPrismon View Post
    There have been reports of problems here. There are three canidates:

    1) The JSP is not compiling correctly:
    Zimlet JSP - Zimbra :: Wiki

    2) A bug in AjxRPC.invoke

    3) A error in the proxy.

    Can you look at the first and figure out if it applies to you?
    Hello Joshua
    I had similar problem since i started using Zimbra 6.
    i used to apply the first one Zimlet JSP - Zimbra :: Wiki
    and it used to work .
    Recently i installed zcs 6.0.7 along wth the patch they provided .
    Then i created the soflinks and <env-entry> in ../zimlet/WEB_INF/web.xml file as per the WIKI , but this time its not working
    i am testing with gmaps zimlet and this is error i m getting

    org.apache.jasper.JasperException: /net_inova_gmaps/map_frame.jsp(23,0) PWC6032: Unable to load tag handler class "com.zimbra.cs.taglib.ZimletConfig" for tag "z:zimletconfig"
    what i found out is after making the above changes as soon as i restart the mailbox or server the /opt/zimbra/jetty/webapps/zimlet/WEB-INF/web.xml gets overwritten and thus the changes are not reflected as suppossed . Could you gimme an idea to fix this ? How is the file getting overwritten ?

    Thanks

  9. #9
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    Lot of differents problems/questions in this thread :

    -The url http://xxx.xxx.xxx/service/soap/ should work for the soap requests.

    -The error "Error 405 HTTP method POST is not supported by this URL" is fixed since the 6.0.4 :
    Bug HTTP POST to Zimlet JSP files throws 405 (HTTP GET works)

    -I also corrected the wiki page Zimlet JSP - Zimbra :: Wiki.

Similar Threads

  1. Replies: 13
    Last Post: 01-28-2009, 01:30 AM
  2. How do I redirect http to a https general URL?
    By henryw in forum Administrators
    Replies: 0
    Last Post: 12-29-2008, 04:31 PM
  3. http get url
    By rmcnaught in forum Zimlets
    Replies: 0
    Last Post: 11-11-2008, 11:13 AM
  4. Can Admin login url be http
    By Shikha Sood in forum Administrators
    Replies: 0
    Last Post: 08-06-2008, 05:51 AM
  5. SOAP post HTTP error
    By MichaelA1 in forum Developers
    Replies: 6
    Last Post: 04-19-2006, 06:16 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
  •