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

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 10-16-2009, 03:34 AM
Starter Member
 
Posts: 2
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.
Reply With Quote
  #2 (permalink)  
Old 10-16-2009, 07:46 AM
Zimlet Guru & Moderator
 
Posts: 467
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?
Reply With Quote
  #3 (permalink)  
Old 10-20-2009, 09:53 AM
Starter Member
 
Posts: 2
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..
Reply With Quote
  #4 (permalink)  
Old 10-20-2009, 10:24 AM
Zimbra Employee
 
Posts: 187
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!
Reply With Quote
  #5 (permalink)  
Old 07-06-2010, 03:58 PM
Junior Member
 
Posts: 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!
Reply With Quote
  #6 (permalink)  
Old 07-06-2010, 10:55 PM
Zimbra Employee
 
Posts: 187
Default

Can you post Firebug's Request, Response, Headers etc (use network tab)?
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #7 (permalink)  
Old 07-07-2010, 07:52 AM
Junior Member
 
Posts: 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.
Reply With Quote
  #8 (permalink)  
Old 08-03-2010, 03:32 AM
Active Member
 
Posts: 48
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

Quote:
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
Reply With Quote
  #9 (permalink)  
Old 02-14-2011, 03:54 AM
Zimlet Guru & Moderator
 
Posts: 265
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.
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.