Java mule和rest具有post方法类型

Java mule和rest具有post方法类型,java,web-services,rest,mule,Java,Web Services,Rest,Mule,多流: @Path("/") public class RestIntegration { @GET @Path("get/{id1}") @Produces(MediaType.APPLICATION_JSON) public String getOperation(@PathParam("id1")String id){ System.out.println("GET: Id from UI-->"+id); return

多流:

@Path("/")
public class RestIntegration {
    @GET
    @Path("get/{id1}")
    @Produces(MediaType.APPLICATION_JSON)
    public String getOperation(@PathParam("id1")String id){
        System.out.println("GET: Id from UI-->"+id);
        return "Your Id is-->"+id;
    }

    @POST
    @Path("/post/{id1}")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Response postOperation(@PathParam("id1")String id){
        System.out.println("----INSIDE POST operation----"+id);
        return Response.ok("Response from Mule Rest component").build();
    }
}

我使用chrome rest客户端调用url。在rest客户端中,我没有在标题或加载中传递任何值。

找到了解决方案,在google chrome rest客户端中,我没有在标题中选择内容类型

ERROR 2014-07-31 11:18:43,337 [[restintegration].connector.http.mule.default.receiver.03] org.mule.exception.DefaultSystemExceptionStrategy: 
********************************************************************************
Message               : Failed to create MuleMessage
Code                  : MULE_ERROR-64
--------------------------------------------------------------------------------
Exception stack is:
1. String index out of range: -1 (java.lang.StringIndexOutOfBoundsException)
  java.lang.String:1871 (null)
2. Failed to create MuleMessage (org.mule.api.lifecycle.CreateException)
  org.mule.transport.AbstractTransportMessageHandler:462 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/lifecycle/CreateException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1871)
    at org.mule.transport.http.multipart.MultiPartInputStream.parse(MultiPartInputStream.java:349)
    at org.mule.transport.http.multipart.MultiPartInputStream.getParts(MultiPartInputStream.java:304)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************


它为我工作-----内部岗位操作----22-
Mule Rest组件的响应

请您详细说明您的回答,并添加关于您提供的解决方案的更多描述,好吗?
ERROR 2014-07-31 11:18:43,337 [[restintegration].connector.http.mule.default.receiver.03] org.mule.exception.DefaultSystemExceptionStrategy: 
********************************************************************************
Message               : Failed to create MuleMessage
Code                  : MULE_ERROR-64
--------------------------------------------------------------------------------
Exception stack is:
1. String index out of range: -1 (java.lang.StringIndexOutOfBoundsException)
  java.lang.String:1871 (null)
2. Failed to create MuleMessage (org.mule.api.lifecycle.CreateException)
  org.mule.transport.AbstractTransportMessageHandler:462 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/lifecycle/CreateException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
    at java.lang.String.substring(String.java:1871)
    at org.mule.transport.http.multipart.MultiPartInputStream.parse(MultiPartInputStream.java:349)
    at org.mule.transport.http.multipart.MultiPartInputStream.getParts(MultiPartInputStream.java:304)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
 <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration" basePath="restint"/>