Unable to POST when using TeamRawService
I have created a service which extends TeamRawService.
The implementation has 2 functions: perform_POST and perform_GET
However, the POST function never gets invoked. Even if I submit using a POST method from my browser, the request is redirected to the get method.
For reference here is the request header from the browser:
Post method type seems to work fine when I am using ITeamModelledRestService.
Would really appreciate help in this issue.
Thanks
- Vibha
The implementation has 2 functions: perform_POST and perform_GET
However, the POST function never gets invoked. Even if I submit using a POST method from my browser, the request is redirected to the get method.
For reference here is the request header from the browser:
http://localhost:9080/jazz/service/com.ibm.research.sedna2.blueprintprojectdata.common.IAttachmentRestService
POST /jazz/service/com.ibm.research.sedna2.blueprintprojectdata.common.IAttachmentRestService HTTP/1.1
Host: localhost:9080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: multipart/form-data; boundary=---------------------------146043902153
Content-Length: 14390
-----------------------------146043902153
Content-Disposition: form-data; name="uploadFileInput"; filename="Abc.xml"
Content-Type: text/xml
......
Post method type seems to work fine when I am using ITeamModelledRestService.
Would really appreciate help in this issue.
Thanks
- Vibha
4 answers
Is it possible for you to post the class or at least a skeleton of it to
the forum? Are you sure that the perform_POST method was properly
overriden? Putting a @Overrides annotation will generate a warning if it
isn't.
vssinha wrote:
the forum? Are you sure that the perform_POST method was properly
overriden? Putting a @Overrides annotation will generate a warning if it
isn't.
vssinha wrote:
I have created a service which extends TeamRawService.
The implementation has 2 functions: perform_POST and perform_GET
However, the POST function never gets invoked. Even if I submit using
a POST method from my browser, the request is redirected to the get
method.
For reference here is the request header from the browser:
http://localhost:9080/jazz/service/com.ibm.research.sedna2.blueprintprojectdata.common.IAttachmentRestService
POST
/jazz/service/com.ibm.research.sedna2.blueprintprojectdata.common.IAttachmentRestService
HTTP/1.1
Host: localhost:9080
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-Type: multipart/form-data;
boundary=---------------------------146043902153
Content-Length: 14390
-----------------------------146043902153
Content-Disposition: form-data; name="uploadFileInput";
filename="Abc.xml"
Content-Type: text/xml
.....
Post method type seems to work fine when I am using
ITeamModelledRestService.
Would really appreciate help in this issue.
Thanks
- Vibha
Hello Lavin,
Here are the snippets of the code
Here are the snippets of the code
public class AttachmentRestService extends TeamRawService implements IAttachmentRestService {
public void perform_POST(String uri, HttpServletRequest request, HttpServletResponse response) throws IOException {
System.out.println("In post !!!!");
....
}
public void perform_GET(String uri, HttpServletRequest request, HttpServletResponse response)
throws IOException {
.....
}
}
I wrote the same type of service less than a week ago, and the incoming
requests were properly dispatched to the perform_POST method. Would it
be possible to open a bug and include a small plugin example for the
problem? Perhaps there is something else about your plugin setup that
is causing the problem.
If you open a bug, can you subscribe me so I can look into it?
vssinha wrote:
requests were properly dispatched to the perform_POST method. Would it
be possible to open a bug and include a small plugin example for the
problem? Perhaps there is something else about your plugin setup that
is causing the problem.
If you open a bug, can you subscribe me so I can look into it?
vssinha wrote:
Hello Lavin,
Here are the snippets of the code
public class AttachmentRestService extends TeamRawService implements
IAttachmentRestService {
public void perform_POST(String uri, HttpServletRequest request,
HttpServletResponse response) throws IOException {
System.out.println("In post !!!!");
...
}
public void perform_GET(String uri, HttpServletRequest request,
HttpServletResponse response)
throws IOException {
....
}
}