2012-08-02 57 views
1

我有一个请求,当我使用POSTMAN和POSTER插件打开服务时正常工作,但是当我尝试点击负载平衡url时收到错误。未收到回复。请求无法打开或请求超时(对于POST请求)

在海报(插件)错误:

enter image description here

在邮差(插件)错误:

enter image description here

的代码部分:

@Path("/") 
public class Check { 
    public ResultSet rs; 

    @POST 
    @Produces(MediaType.TEXT_PLAIN) 
    @Consumes("application/xml") 
    public String validate(String xmlContent) throws Exception { 
      String value = "no"; 
      String result = null; 
      Boolean inputCheck; 

      Contents unmarshalledValues = unmarshalingContent(xmlContent); 

MIME类型说明:

好,MIME类型XML的

http://annevankesteren.nl/2004/08/mime-types

示例XML消耗

http://docs.oracle.com/javaee/6/tutorial/doc/gkknj.html

回答

0

好了,我要JAXRS未编组XML,所以我删除

@Consumes 

它的工作:)

1

@MadD嗨你能试试o像这样,

@Path("/upload") 
public class Check { 

    @POST 
    @Consumes(MediaType.APPLICATION_OCTET_STREAM) 
    public Response validate(InputStream input) { 
      ... 
      return Response.ok().build(); 
    } 
    ... 
} 

希望这些帮助。