Пример #1
0
  /** Configures SOAP interceptors for the given client. */
  protected void configureInterceptors(Client client) {
    client.getInInterceptors().add(new Cxf3791WorkaroundInterceptor());

    // WS-Addressing-related interceptors
    if (wsTransactionConfiguration.isAddressing()) {
      MustUnderstandDecoratorInterceptor interceptor = new MustUnderstandDecoratorInterceptor();
      for (String nsUri : SoapUtils.WS_ADDRESSING_NS_URIS) {
        interceptor.addHeader(new QName(nsUri, "Action"));
      }

      client.getOutInterceptors().add(interceptor);

      MAPCodec mapCodec = new MAPCodec();
      MAPAggregator mapAggregator = new MAPAggregator();
      client.getInInterceptors().add(mapCodec);
      client.getInInterceptors().add(mapAggregator);
      client.getInFaultInterceptors().add(mapCodec);
      client.getInFaultInterceptors().add(mapAggregator);
      client.getOutInterceptors().add(mapCodec);
      client.getOutInterceptors().add(mapAggregator);
      client.getOutFaultInterceptors().add(mapCodec);
      client.getOutFaultInterceptors().add(mapAggregator);
    }

    if (wsTransactionConfiguration.isSwaOutSupport()) {
      client.getOutInterceptors().add(new ProvidedAttachmentOutInterceptor());
      client.getOutInterceptors().add(new FixContentTypeOutInterceptor());
    }

    InterceptorUtils.copyInterceptorsFromProvider(customInterceptors, client);
  }
Пример #2
0
  @Override
  protected void configureInterceptors(Client client) {
    super.configureInterceptors(client);
    client.getInInterceptors().add(new InPayloadExtractorInterceptor(SOAP_BODY));
    client.getInInterceptors().add(new InNamespaceMergeInterceptor());
    client.getInInterceptors().add(new InPayloadInjectorInterceptor(0));
    client.getEndpoint().getService().setDataBinding(new PlainXmlDataBinding());

    // install auditing-related interceptors if the user has not switched auditing off
    if (auditStrategy != null) {
      client
          .getOutInterceptors()
          .add(
              new AuditOutRequestInterceptor<>(
                  auditStrategy, correlator, getWsTransactionConfiguration()));

      AuditResponseInterceptor<Hl7v3AuditDataset> auditInterceptor =
          new AuditResponseInterceptor<>(auditStrategy, false, correlator, false);
      client.getInInterceptors().add(auditInterceptor);
      client.getInFaultInterceptors().add(auditInterceptor);
    }
  }