Web services 如何将原始webservice消息soapenv字符串转换为CXF中的相关对象

Web services 如何将原始webservice消息soapenv字符串转换为CXF中的相关对象,web-services,cxf,marshalling,unmarshalling,Web Services,Cxf,Marshalling,Unmarshalling,我有一个像字符串一样的webservice原始消息。我的目标是改变这个消息的上下文,就像再见一样!!要改变古德拜!!。 让我知道是否有任何api/utils方法可以完成这项工作。我将jboss 5与cxf堆栈一起使用,因此为此我将优先使用cxf UTIL 原始XML字符串 再见!! 您必须添加一个 例如: public class SoapActionOutInterceptor extends AbstractSoapInterceptor { public SoapActionOu

我有一个像字符串一样的webservice原始消息。我的目标是改变这个消息的上下文,就像再见一样!!要改变古德拜!!。 让我知道是否有任何api/utils方法可以完成这项工作。我将jboss 5与cxf堆栈一起使用,因此为此我将优先使用cxf UTIL

原始XML字符串

再见!! 您必须添加一个

例如:

public class SoapActionOutInterceptor extends AbstractSoapInterceptor {

   public SoapActionOutInterceptor() {
         super(Phase.POST_LOGICAL);
   }

   public void handleMessage(SoapMessage message) throws Fault {
         if (message.getVersion() instanceof Soap11) {
                PocBean pb = null;
                MessageContentsList list = (MessageContentsList) message.getContent(List.class);
                for (Iterator itList = list.iterator(); itList.hasNext();) {
                       Object content = itList.next();
                       if (content instanceof PocBean) {
                              pb = (PocBean) content;
                              pb.setParam1("AlteredGoodbye!!");

                       }
                }
         }
   }
}
然后像这样声明这个拦截器:

       <jaxws:endpoint id="pocWebService" implementor="#pocService"
         address="/pocService">

         <jaxws:properties>
                <entry key="schema-validation-enabled" value="true" />
         </jaxws:properties>
         <jaxws:outInterceptors>
                <bean class="fr.genybet.service.interceptor.SoapActionOutInterceptor" />
         </jaxws:outInterceptors>
   </jaxws:endpoint>