小编kiw*_*rog的帖子

如何修改出站CXF请求的原始XML消息?

我想修改一个传出的SOAP请求.我想从信封的主体中删除2个xml节点.我设法建立一个Interceptor并将生成的消息集的String值获取到端点.

但是,以下代码似乎不起作用,因为未按预期编辑传出消息.有没有人有关于如何做到这一点的一些代码或想法?

public class MyOutInterceptor extends AbstractSoapInterceptor {

public MyOutInterceptor() {
        super(Phase.SEND); 
}

public void handleMessage(SoapMessage message) throws Fault { 
        // Get message content for dirty editing...
        StringWriter writer = new StringWriter();
        CachedOutputStream cos  = (CachedOutputStream)message.getContent(OutputStream.class); 
        InputStream inputStream = cos.getInputStream();
        IOUtils.copy(inputStream, writer, "UTF-8");
        String content = writer.toString();

        // remove the substrings from envelope...
        content = content.replace("<idJustification>0</idJustification>", "");
        content = content.replace("<indicRdv>false</indicRdv>", "");
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        outputStream.write(content.getBytes(Charset.forName("UTF-8")));
        message.setContent(OutputStream.class, outputStream);
} 
Run Code Online (Sandbox Code Playgroud)

java web-services cxf interceptor

17
推荐指数
2
解决办法
3万
查看次数

Eclipse:在编辑器中显示每一行的作者?

我想在我的Java文件中显示每行的作者姓名.我已经在使用FishEye(http://www.atlassian.com/software/fisheye/),但我想在Eclipse Java编辑器中使用此功能.

java eclipse editor atlassian-fisheye

11
推荐指数
3
解决办法
8386
查看次数

如何修改生成的SOAP请求?

我正处于创建输出拦截器的阶段,我从SOAP消息中获取了一个OuputStream.但是如何在将SOAP信封发送到端点之前修改它呢?我想删除一些xml元素.

java cxf outputstream interceptor

9
推荐指数
1
解决办法
1万
查看次数

Apache Commons VFS Maven存储库?

有什么想法使用哪个Maven存储库来使用Apache公共VFS库?谢谢.

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-vfs2</artifactId>
        <version>2.1-SNAPSHOT</version>
    </dependency>
Run Code Online (Sandbox Code Playgroud)

**编辑**:以下存储库工作正常:

    <repository>
        <id>commons-vfs</id>
        <name>Apache Commons VFS Repository Group</name>
        <url>https://repository.apache.org/content/groups/snapshots/</url>
        <layout>default</layout>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
Run Code Online (Sandbox Code Playgroud)

repository apache-commons vfs maven

3
推荐指数
1
解决办法
6268
查看次数