Dear all,

I try to access a REST-service by the Mashup-server. For this I try to use the 
HttpClient method which is described in the documentation here:
http://wso2.org/project/mashup/2.1.0/docs/httpclienthostobject.html

I succeeded to execute the GET-method with the HttpClient Hostobject:

toString.outputType = "String";
function toString() {
 var client = new HttpClient();
 var params = { followRedirect : true };
 var content = [];
 var code = client.executeMethod("GET", "http://localhost:8182/test555.xml";, 
content, params);

 if (code == 200) {
  return client.response ;
 }
 else {
 return "<failure><code>" + code + "</code><statusText>" + client.statusText + 
"</statusText></failure>";
 }
}


But the PUT-method is missing. The following code results in the error "Fault: 
HTTP method you specified is not supported":

postContent.httpMethod = "POST";
postContent.inputType = "string";
postContent.outputType = "string";
function postContent(content){
 var client = new HttpClient();
 var params = { followRedirect : true };
 var code = client.executeMethod("PUT", "http://localhost:8182/test555.xml";, 
content, params);

 if (code == 200) {
   return client.response ;
 }
 else {
 return "<failure><code>" + code + "</code><statusText>" + client.statusText + 
"</statusText></failure>";
 }
}


Is there any reason why this method is missing? The documentation says that it 
is missing. Maybe it can be added. Is there any other way to access a 
REST-PUT-service?

Thank you very much for your help in advance.

Regards
-- 
Christoph Tornau



_______________________________________________
Mashup-user mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/mashup-user

Reply via email to