It's all about the answers!

Ask a question

Unable to POST when using TeamRawService


Vibha Sinha (1643610) | asked Jul 24 '08, 1:37 a.m.
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

4 answers



permanent link
Matt Lavin (2.7k2) | answered Jul 24 '08, 8:30 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
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:
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

permanent link
Vibha Sinha (1643610) | answered Jul 24 '08, 10:34 a.m.
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 {
.....
}

}

permanent link
Matt Lavin (2.7k2) | answered Jul 24 '08, 3:52 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
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:
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 {
....
}

}


permanent link
Vibha Sinha (1643610) | answered Jul 25 '08, 6:04 a.m.
Hello Lavin,

I have opened a bug on this - 59261 and have posted my code there.

However, I was not able to assign it to you as did not have the requisite permissions.

Thanks
- Vibha

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.