0

文字列のような webservice raw メッセージがあります。私の目的は、このメッセージの内容を Goodbye!! のように変更することです。AlteredGoodbye!!へ。この作業を行う api/utils メソッドがあるかどうか教えてください。私はcxfスタックでjboss 5を使用しているため、これにはcxf utilsを優先します。

生の XML 文字列

さようなら!!

4

1 に答える 1

0

outインターセプターを追加する必要があります

例えば ​​:

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>
于 2013-02-15T13:07:54.240 に答える