Tag: spring ws

使用Spring Web服务客户端解密消息

350赏金和华夫饼给能帮助我的人! 我一直在努力使用Spring Web Service加密几天,我无法弄清楚如何让Spring的加密function在消息体上运行。 每当我让服务器加密生成的消息时,客户端似乎在尝试根据模式( XSD )validation它之前没有对其进行解密。 这是服务器端配置 服务器的xwss安全配置 客户端的Spring配置 客户端的xwss配置 我能做的是加密用户令牌并成功解密。 我在从客户端向服务器发送数据时这样做。 然后,服务器解密用户令牌并validation用户凭据,这非常有效。 如果我尝试加密回来的邮件正文,则会出现此问题。 问题发生在客户端。 似乎客户端在解密之前尝试validation消息,因此在validation模式时会发生错误。 [Fatal Error] :1:192: The prefix “ns0” for element “ns0:HolidayListResponse” is not bound. 11-Dec-2009 7:45:32 AM com.sun.xml.wss.impl.apachecrypto.DecryptionProcessor decryptElementWithCipher SEVERE: WSS1203: Exception [ The prefix “ns0” for element “ns0:HolidayListResponse” is not bound. ] while trying to decrypt message 这是SOAP响应本身 。 […]

如何使用Spring-WS直接传输SOAP?

我们希望在Web服务端点中启用有效负载的直接流式传输。 我们必须处理大量数据,并希望在处理时流式传输数据。 我们在版本2.0.0中使用spring-ws-core,并使用PayloadRootQNameEndpointMapping作为端点映射器。 作为消息工厂,我们使用的是AxiomSoapMessageFactory 。 我们实现StreamingPayload和相应的writeTo(XMLStreamWriter writer)方法,我们用它来编写有效负载(根据spring-ws JIRA票证, SWS-352 )。 这没有任何错误,但我们想直接流! 这显然是不可能的。 我们做了一个简单的测试,我们流式传输一些数据来评估行为。 writer.writeStartElement(“exampleResponse”) 10000.times { writer.writeStartElement(“example”) writer.writeEndElement() } writer.writeEndElement() 我们假设这将直接流式传输到使用者/客户端,因此soap头已经写入我们的编写器并在端点完成后关闭。 不幸的是,这是不可能的,流不能直接使用! 流被包装在Spring-ws源中的ByteArrayInputStream中。 StreamingOMDataSource的实现显示了这一点(可以在SpringEye中查看)。 StreamingOMDataSource调用您的StreamingPayload实现并为您提供一个编写器。 public XMLStreamReader getReader() throws XMLStreamException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); serialize(bos, null); ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); return StAXUtils.createXMLStreamReader(bis); } 方法#serialize()使用ByteArrayOutputStream创建XMLStreamWriter ,并调用有效负载以启用写入,如上所述。 public void serialize(OutputStream output, OMOutputFormat format) throws […]

Spring WS – STS中的一步一步(来自WSDL)

我正在尝试在Spring Tool Suite(STS)中创建一个新的Spring Web服务项目。 我查了一下这个链接 http://static.springsource.org/spring-ws/site/reference/html/tutorial.html 但这并没有非常明确地说明这些步骤。 任何人都可以分享链接到一些有用的资源,一步一步显示如何创建一个Spring WS项目?

Spring-WS:指定Content-Type

我有一个基于AbstractJDomPayloadEndpoint的Spring Web服务。 此服务工作正常,但我的客户端需要将HTTP标头Content-Type设置为正确的字符集(在我的情况下为utf-8)。 我无法找到我可以配置的地方。 我尝试编写一个简单的servlet Filter : chain.doFilter(request, response); HttpServletResponse httpResponse = (HttpServletResponse) response; httpResponse.setHeader(“Content-Type”, “text/xml; charset=utf-8”); 但这根本不会改变标题。 我怀疑内容类型标头是由Spring-WS设置的,并且响应是提交的,因此我在filter中设置的任何内容都不会产生影响。 我的appserver是WebLogic 9.2.3。

JAX-WS返回空列表

我是网络服务的新手。 我遇到了一些问题。 在服务器端我使用spring-ws。 在客户端我使用jax-ws。 使用wsimport工具,我根据我的wsdl生成了java类。 一切正常,但由于某种原因,jax-ws不解析数组并正确列出,所有列表都是空的 我完全确定,响应是正确的forms,用soapui测试它,我也使用日志拦截器来记录outcomming响应。 以下是回复的片段 回应看起来像 hello world text hello world text hello world text 和wsdl的片段 要生成客户端代码,请使用wsimport。 SayHelloResponseType resp = serv.sayHello(r); List name = resp.getName(); System.out.println(name.size()); 谢谢。 任何帮助将受到高度赞赏。

Spring WS Web服务。 使用SAAJ向响应添加附件 – 没有端点适配器

我真的很难让Spring-WS返回带附件的响应。 我已经设法让MTOM版本工作,但这在客户端有一些先决条件,因为我相信客户端也必须启用MTOM(如果这不正确,请纠正我)。 我现在要做的是使用标准的SOAP和附件实现,使用SAAJ和Spring-WS。 为此,我实现了一个端点,只需将图像从本地文件系统附加到响应。 @Endpoint public class TestEndPoint { private SaajSoapMessageFactory saajMessageFactory; @PayloadRoot(namespace=”http://ws.mypackage.com”, localPart=”downloadMessageRequestSaaj”) @ResponsePayload public JAXBElement invoke(@RequestPayload DownloadMessageRequestSaaj req, MessageContext context ) throws Exception { DownloadResponseSaajType response = new DownloadResponseSaajType(); DownloadResponseSaajType.PayLoad payload = new DownloadResponseSaajType.PayLoad(); DataHandler handler = new javax.activation.DataHandler(new FileDataSource(“c:\\temp\\maven-feather.png”)); SaajSoapMessage message = saajMessageFactory.createWebServiceMessage(); message.addAttachment(“picture”, handler); context.setResponse(message); payload.setMessagePayLoad(handler); return objectFactory.createDownloadMessageResponseSaaj(response); } public void […]

无法找到BeanDefinitionParser for Spring Web服务的元素

我是Spring Web服务的新手,我不断收到此错误: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [annotation-driven] Offending resource: ServletContext resource [/WEB-INF/spring-ws-servlet.xml] 经过一番挖掘后,看起来我很可能在我的架构和jar子之间存在版本不匹配但我看不到哪里(我正在为v3.1拍摄)。 这是我库中的每个Spring jar: M2_REPO\org\springframework\spring-aop\3.1.1.RELEASE\spring-aop-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-asm\3.1.1.RELEASE\spring-asm-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-beans\3.1.1.RELEASE\spring-beans-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-context\3.1.1.RELEASE\spring-context-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-context-support\3.1.1.RELEASE\spring-context-support-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-core\3.1.1.RELEASE\spring-core-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-expression\3.1.1.RELEASE\spring-expression-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-jdbc\3.1.1.RELEASE\spring-jdbc-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-jms\3.1.1.RELEASE\spring-jms-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-oxm\3.1.1.RELEASE\spring-oxm-3.1.1.RELEASE.jar M2_REPO\org\springframework\ws\spring-oxm\1.5.10\spring-oxm-1.5.10.jar M2_REPO\org\springframework\ws\spring-oxm-tiger\1.5.10\spring-oxm-tiger-1.5.10.jar M2_REPO\org\springframework\security\spring-security-acl\3.1.1.RELEASE\spring-security-acl-3.1.1.RELEASE.jar M2_REPO\org\springframework\security\spring-security-config\3.1.1.RELEASE\spring-security-config-3.1.1.RELEASE.jar M2_REPO\org\springframework\security\spring-security-core\3.1.1.RELEASE\spring-security-core-3.1.1.RELEASE.jar M2_REPO\org\springframework\security\spring-security-remoting\3.1.1.RELEASE\spring-security-remoting-3.1.1.RELEASE.jar M2_REPO\org\springframework\security\spring-security-taglibs\3.1.1.RELEASE\spring-security-taglibs-3.1.1.RELEASE.jar M2_REPO\org\springframework\security\spring-security-web\3.1.1.RELEASE\spring-security-web-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-test\3.1.1.RELEASE\spring-test-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-tx\3.1.1.RELEASE\spring-tx-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-web\3.1.1.RELEASE\spring-web-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-webmvc\3.1.1.RELEASE\spring-webmvc-3.1.1.RELEASE.jar M2_REPO\org\springframework\ws\spring-ws-core\2.1.2.RELEASE\spring-ws-core-2.1.2.RELEASE.jar M2_REPO\org\springframework\ws\spring-ws-core-tiger\1.5.10\spring-ws-core-tiger-1.5.10.jar M2_REPO\org\springframework\ws\spring-xml\1.5.10\spring-xml-1.5.10.jar 弹簧-WS-servlet.xml中 web.xml中 My Webservice Created By Archetype for Spring WS spring-ws […]

Spring Web Service客户端教程或示例必需

我需要跳进Spring Web Service Project,因为我需要实现Spring Web Service的Client Only .. 所以,我已经使用了Spring的客户参考文档 。 所以,我已经了解了Client实现所需的类。 但我的问题就像我做了一些谷歌搜索,但没有得到客户端和服务器的任何正确的例子,因为我可以为我的客户端实现一个示例。 所以,如果有人给我一些链接或教程,从中我可以了解到我的客户端实现将非常感谢。 提前致谢…

使用Spring-WS客户端动态设置自定义HTTP标头

在使用Spring-WS时,如何在客户端动态设置自定义HTTP头(而不是SOAP头)?

Spring WS + JIBX“没有端点适配器”错误

我使用JIBX从XSD文件创建我的实体类。 它在pom.xml中配置,并在我执行“maven:compile”时创建类 我也用spring-ws。 当我使用SOAPUI测试我的Web服务时,我得到了臭名昭着的错误; “No adapter for endpoint GetTransactionsResponse getTransactions(GetTransactionsRequest), Is your endpoint annotated with @Endpoint, or does..” 我检查了所有关于该错误的线程,但没有帮助。 我有一个Parent.xsd,它导入2个子xsd。 它们都在同一个文件夹中。 这就是我的spring-ws-servlet的样子; /WEB-INF/Parent.xsd 这是我的端点类; @Endpoint public class TransactionsEndpoint { public static final String NAMESPACE = “nmapespace”; @PayloadRoot(namespace = NAMESPACE, localPart = “getTransactionsRequest”) @ResponsePayload public GetTransactionsResponse getTransactions(@RequestPayload GetTransactionsRequest request) { GetTransactionsResponse transactionsResponse = new GetTransactionsResponse(); return […]