use of alfresco/wcservice instead of alfresco/service

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2007 07:36 AM
i'm trying to create a new file under the company home space. I want this to be done with admin authentication but it's not important this to be admin, it can be a user, too. But i faced with a problem:
Web Script Status 405 - Method Not Allowed
Message: Script url /alfresco/wcservice/sample/create does not support the method GET
Exception: org.alfresco.web.scripts.WebScriptException - Script url /alfresco/wcservice/sample/create does not support the method GET
I used alfresco/service but when i read some posts of other developers about this topic, i see i should use alfresco/wcservice. i read the wiki page:
http://wiki.alfresco.com/wiki/Web_Script_Runtimes#Servlet_Runtime_.28HTTP_Access.29
but sadly i couldn't understand the use of alfresco/wcservice.
how can i use authentication and make this script to work properly?
and should i have alfresco enterprise to do this task( creating a file)?
create.post.desc.xml=>
<webscript>
<shortname>Create</shortname>
<description>Creates a file</description>
<url>/alfresco/wcservice/sample/create?name={newfile}</url>
<authentication>admin</authentication>
<transaction>required</transaction>
</webscript>
create.post.js=>
var fname=args.name;
var myFile=companyhome.createFile(fname);
myFile.properties.title=fname+".txt";
myFile.properties.description="my new file";
myFile.save();
Web Script Status 405 - Method Not Allowed
Message: Script url /alfresco/wcservice/sample/create does not support the method GET
Exception: org.alfresco.web.scripts.WebScriptException - Script url /alfresco/wcservice/sample/create does not support the method GET
I used alfresco/service but when i read some posts of other developers about this topic, i see i should use alfresco/wcservice. i read the wiki page:
http://wiki.alfresco.com/wiki/Web_Script_Runtimes#Servlet_Runtime_.28HTTP_Access.29
but sadly i couldn't understand the use of alfresco/wcservice.
how can i use authentication and make this script to work properly?
and should i have alfresco enterprise to do this task( creating a file)?
create.post.desc.xml=>
<webscript>
<shortname>Create</shortname>
<description>Creates a file</description>
<url>/alfresco/wcservice/sample/create?name={newfile}</url>
<authentication>admin</authentication>
<transaction>required</transaction>
</webscript>
create.post.js=>
var fname=args.name;
var myFile=companyhome.createFile(fname);
myFile.properties.title=fname+".txt";
myFile.properties.description="my new file";
myFile.save();
Labels:
- Labels:
-
Archive
3 REPLIES 3

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2007 08:54 AM
Exception: org.alfresco.web.scripts.WebScriptException - Script url /alfresco/wcservice/sample/create does not support the method GET
Your web script is configured to handle POST, not GET i.e. you have the following file names…
create.post.desc.xml
create.post.js
And you're making a GET request to your URL /alfresco/wcservice/sample/create?name={newfile}
The error is not related to authentication.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2007 09:24 AM
thank you for reply.
when i made the url:
URL /alfresco/wcservice/sample/create
and just want to create a dumb file in company home, it is still giving same error. what is the difference between GET and POST methods url arguments.
when i made the url:
URL /alfresco/wcservice/sample/create
and just want to create a dumb file in company home, it is still giving same error. what is the difference between GET and POST methods url arguments.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2007 09:36 AM
HTTP GET & POST.
