Tag: spring ws

如何在Spring-ws端点访问HTTP头?

如何在Spring-ws端点中访问HTTP头? 我的代码如下所示: public class MyEndpoint extends AbstractMarshallingPayloadEndpoint { protected Object invokeInternal(Object arg) throws Exception { MyReq request = (MyReq) arg; // need to access some HTTP headers here return createMyResp(); } } invokeInternal()仅获取未编组的JAXB对象作为参数。 如何在invokeInternal()访问请求附带的HTTP头? 一种可能有效的方法是创建一个Servletfilter,将头值存储到ThreadLocal变量,然后在invokeInternal()访问,但是有更好的,更类似Spring的方法吗?

如何在Spring-WS中为响应有效负载添加附件?

我正在构建一个旨在共享内容的Web服务服务器。 我想通过包含附件的SOAP响应来提供内容。 现在,我正在使用Spring WS处理请求并提供响应。 我的服务类似于以下内容: @Endpoint public class Service{ @PayloadRoot(namespace = “http://foo.com/coffee”, localPart = “order”) @ResponsePayload public Coffee getCoffee(@RequestPayload Order order){ return new Coffee(“Hot Joe”); } } 但是假设我想在回复中附上一杯咖啡的图片,我在哪里以及如何做到这一点? 编辑:另外,Spring-WS附带的示例显示了如何使用客户端发送附件,而不是服务器应该如何响应(这就是我在这里要问的)。

jdbcTemplate.queryForList的返回类型(sql,object,classType)

我正在使用jdbcTemplate.queryForList以下列方式执行命名查询: List conversations = jdbcTemplate.queryForList( SELECT_ALL_CONVERSATIONS_SQL_FULL, new Object[] {userId, dateFrom, dateTo}); SQL查询是: private final String SELECT_ALL_CONVERSATIONS_SQL_FULL = “select conversation.conversationID, conversation.room, ” + “conversation.isExternal, conversation.startDate, ” + “conversation.lastActivity, conversation.messageCount ” + “from openfire.ofconversation conversation ” + “WHERE conversation.conversationid IN ” + “(SELECT conversation.conversationID ” + “FROM openfire.ofconversation conversation, ” + “openfire.ofconparticipant participant ” + “WHERE conversation.conversationID […]

将SoapHeader添加到org.springframework.ws.WebServiceMessage

如何将对象添加到org.springframework.ws.WebServiceMessage的soap标头中 这是我希望最终得到的结构: username password