3

I have a code like this:

import javax.xml.transform.Source;
import org.apache.cxf.binding.soap.SoapMessage;

public class MyProvider implements Provider<Source> {

    public Source invoke(Source request) {
        SoapMessage message= ???    
    }
}

Now I want to extract from request the SoapMessage that I know is inside. Someone know how to do it????

Pay attention that I'd like to have a org.apache.cxf.binding.soap.SoapMessage and not javax.xml.soap.SOAPMessage.

Truly my purpose is to read the UserToken from request, if I have a org.apache.cxf.binding.soap.SoapMessage I know how to do. But if someone know how to read it directly from Source or some other method I appreciated the same.

4

1 回答 1

0

我假设您的 UserToken 包含在 SOAP 标头中。如果是这种情况,必须使用 ServiceMode "MESSAGE" 来获取整个 SOAP 信封,而不仅仅是正文。或者,您可以使用 Handler 将提取的用户令牌放入请求上下文中以进行进一步处理。

于 2012-12-09T14:28:14.997 回答