Package javax.xml.ws.addressing

Examples of javax.xml.ws.addressing.AddressingBuilder


    assertEquals(DOMUtils.parse(expEnv), DOMUtils.parse(wasEnv));
  }

  public void testReplyToHeaders() throws Exception
  {
    AddressingBuilder addrBuilder = SOAPAddressingBuilder.getAddressingBuilder();
    SOAPAddressingProperties replyProps = (SOAPAddressingProperties)addrBuilder.newAddressingProperties();
    replyProps.initializeAsReply(addrProps, false);
    replyProps.setAction(addrBuilder.newURI("http://fabrikam123.example/ReplyPO"));

    MessageFactory factory = MessageFactory.newInstance();
    SOAPMessage wasMsg = factory.createMessage();
    replyProps.writeHeaders(wasMsg);
View Full Code Here


    /**
     * Construct the coordinator client.
     */
    private CoordinatorClient()
    {
        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
        try {
            preparedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_PREPARED);
            abortedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ABORTED);
            readOnlyAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_READ_ONLY);
            committedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
            faultAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_FAULT);
        } catch (URISyntaxException use) {
            // TODO - log fault and throw exception
        }
        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;

        // Add WS-Addressing
        // AddressingPolicy.register(handlerRegistry) ;
        // Add client policies
        // ClientPolicy.register(handlerRegistry) ;

        final String participantURIString =
            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, false);
        final String secureParticipantURIString =
            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.PARTICIPANT_SERVICE_NAME, true);
        try {
            URI participantURI = new URI(participantURIString);
            participant = builder.newEndpointReference(participantURI);
        } catch (URISyntaxException use) {
            // TODO - log fault and throw exception
        }
        try {
            URI secureParticipantURI = new URI(secureParticipantURIString);
            secureParticipant = builder.newEndpointReference(secureParticipantURI);
        } catch (URISyntaxException use) {
            // TODO - log fault and throw exception
        }
    }
View Full Code Here

    /**
     * Construct the completion coordinator client.
     */
    private CompletionCoordinatorClient()
    {
        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
        try {
            commitAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMIT);
            rollbackAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ROLLBACK);
        } catch (URISyntaxException use) {
            // TODO - log fault and throw exception
        }
        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;

        // Add WS-Addressing
        // AddressingPolicy.register(handlerRegistry) ;
        // Add client policies
        // ClientPolicy.register(handlerRegistry) ;

        final String completionInitiatorURIString =
            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME, false) ;
        final String secureCompletionInitiatorURIString =
            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_INITIATOR_SERVICE_NAME, true) ;
        try {
            URI completionInitiatorURI = new URI(completionInitiatorURIString) ;
            completionInitiator = builder.newEndpointReference(completionInitiatorURI);
        } catch (URISyntaxException use) {
            // TODO - log fault and throw exception
        }
        try {
            URI secureCompletionInitiatorURI = new URI(secureCompletionInitiatorURIString) ;
            secureCompletionInitiator = builder.newEndpointReference(secureCompletionInitiatorURI);
        } catch (URISyntaxException use) {
            // TODO - log fault and throw exception
        }
    }
View Full Code Here

    /**
     * Construct the completion initiator client.
     */
    private CompletionInitiatorClient()
    {
        final AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
        try {
            committedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_COMMITTED);
            abortedAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_ABORTED);
            faultAction = builder.newURI(AtomicTransactionConstants.WSAT_ACTION_FAULT);
        } catch (URISyntaxException use) {
            // TODO - log fault and throw exception
        }
        // final HandlerRegistry handlerRegistry = new HandlerRegistry() ;

        // Add WS-Addressing
        // AddressingPolicy.register(handlerRegistry) ;
        // Add client policies
        // ClientPolicy.register(handlerRegistry) ;

        final String completionCoordinatorURIString =
            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, false) ;
        final String secureCompletionCoordinatorURIString =
            ServiceRegistry.getRegistry().getServiceURI(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, true) ;
        try {
            URI completionCoordinatorURI = new URI(completionCoordinatorURIString) ;
            completionCoordinator = builder.newEndpointReference(completionCoordinatorURI);
        } catch (URISyntaxException use) {
            // TODO - log fault and throw exception
        }
        try {
            URI secureCompletionCoordinatorURI = new URI(secureCompletionCoordinatorURIString) ;
            secureCompletionCoordinator = builder.newEndpointReference(secureCompletionCoordinatorURI);
        } catch (URISyntaxException use) {
            // TODO - log fault and throw exception
        }
    }
View Full Code Here

   {
      log.info("handleRequest" + this);

      try
      {
         AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         AddressingConstants ADDR = builder.newAddressingConstants();

         AddressingProperties outProps = builder.newAddressingProperties();
         outProps.setTo(builder.newURI("uri:jaxrpc-samples-wsaddressing/TestService"));
         outProps.setAction(builder.newURI("http://org.jboss.ws/addressing/stateful/action"));

         EndpointReference replyTo = builder.newEndpointReference(new URI(ADDR.getAnonymousURI()));
         outProps.setReplyTo(replyTo);
         outProps.setMessageID(builder.newURI("urn:uuid:"+ UUIDGenerator.generateRandomUUIDString()));

         // Assign a new clientid
         if (clientid == null)
         {
            clientid = "clientid-" + (++maxClientId);
View Full Code Here

      log.info("handleResponse");

      try
      {
         AddressingProperties inProps = (AddressingProperties)msgContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
         AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();

         builder.newAddressingConstants();
         AddressingProperties outProps = builder.newAddressingProperties();
         outProps.initializeAsReply(inProps, false);
         outProps.setAction(builder.newURI("http://org.jboss.ws/addressing/stateful/actionReply"));

         msgContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, outProps);
         msgContext.setScope(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
      }
      catch (URISyntaxException ex)
View Full Code Here

   {
      log.info("handleRequest" + this);

      try
      {
         AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         AddressingProperties outProps = builder.newAddressingProperties();
         outProps.setTo(builder.newURI("uri:jaxws-wsaddressing-initial/InitialService"));
         outProps.setAction(builder.newURI("http://org.jboss.ws/jaxws/wsaddressing/replyto/action"));

         EndpointReference eprReplyTo = builder.newEndpointReference(new URI("http://" + getServerHost() + ":8080/jaxws-wsaddressing-replyto/ReplyToService"));
         outProps.setReplyTo(eprReplyTo);
         outProps.setMessageID(builder.newURI("urn:uuid:" + UUIDGenerator.generateRandomUUIDString()));
         EndpointReference eprFaultTo = builder.newEndpointReference(new URI("http://" + getServerHost() + ":8080/jaxws-wsaddressing-faultto/FaultToService"));
         outProps.setFaultTo(eprFaultTo);

         msgContext.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, outProps);
      }
      catch (URISyntaxException ex)
View Full Code Here

    * subscription id as wsa:ReferenceParameter
    */
   public static AddressingProperties buildFollowupProperties(SubscribeResponse response, String wsaAction, String wsaTo) {
      try
      {
         AddressingBuilder addrBuilder = AddressingBuilder.getAddressingBuilder();
         AddressingProperties followupProps = addrBuilder.newAddressingProperties();

         //followupProps.setTo(addrBuilder.newURI(wsaTo));
         followupProps.setAction(addrBuilder.newURI(wsaAction));
         followupProps.setMessageID(AddressingClientUtil.createMessageID());

         // necessary in order to parse ref params
         EndpointReference epr = addrBuilder.newEndpointReference(new URI(wsaTo));

         String subscriptionID = response.getSubscriptionId();
         SOAPElementImpl element = new SOAPElementImpl(
            "Identifier",
            "wse", "http://schemas.xmlsoap.org/ws/2004/08/eventing"
View Full Code Here

   // Workaround for [JBWS-2015] Modify addressing handlers to work with the JAXWS-2.1 API
   private void initAddressingProperties(BindingProvider bindingProvider, EndpointReference epr)
   {
      Map<String, Object> reqContext = bindingProvider.getRequestContext();
      AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
      AddressingProperties addrProps = builder.newAddressingProperties();
      reqContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, addrProps);
     
      NativeEndpointReference nepr = EndpointReferenceUtil.transform(NativeEndpointReference.class, epr);
      try
      {
         if (nepr.getAddress() != null)
            addrProps.setTo(builder.newURI(nepr.getAddress()));

         List<Element> w3cRefParams = nepr.getReferenceParameters();
         if (w3cRefParams != null)
         {
            ReferenceParameters refParams = addrProps.getReferenceParameters();
View Full Code Here

      Service serviceB = Service.create(new URL(endpointBUrl + "?wsdl"), serviceNameB);
      EndpointA portA = (EndpointA)serviceA.getPort(EndpointA.class, new AddressingFeature());
      EndpointB portB = (EndpointB)serviceB.getPort(EndpointB.class, new AddressingFeature());
      BindingProvider bindingProviderA = (BindingProvider)portA;
     
      AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
      AddressingProperties props = builder.newAddressingProperties();
      props.setAction(builder.newURI("echo"));
      EndpointReference epr = builder.newEndpointReference(new URI(endpointBUrl));
      Element element = DOMUtils.parse("<wsarj:identifier xmlns:wsarj='myNS'>MyIdentifier</wsarj:identifier>");
      epr.getReferenceParameters().addElement(element);
      props.setReplyTo(epr);
      props.setTo(builder.newURI(new URI(endpointAUrl)));
      props.setMessageID(builder.newURI("TestMessageID"));
     
      bindingProviderA.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, props);
      portA.echo("Hi!");
     
      Thread.sleep(2000);
View Full Code Here

TOP

Related Classes of javax.xml.ws.addressing.AddressingBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.