Package javax.xml.ws.addressing

Examples of javax.xml.ws.addressing.AddressingBuilder


  
         Service service = Service.create(wsdlURL, serviceName);
         EndpointB port = (EndpointB)service.getPort(EndpointB.class, new AddressingFeature());
         BindingProvider bindingProvider = (BindingProvider)port;

         AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         AddressingProperties props = builder.newAddressingProperties();
         props.initializeAsReply(serverProps, false);
         props.setAction(builder.newURI("echo"));
        
         bindingProvider.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, props);
         port.echo(s);
      }
      catch (Exception e)
View Full Code Here


  protected boolean handleOutbound(MessageContext msgContext)
   {
      log.info("handleRequest" + this);
      try
      {
         AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         SOAPAddressingProperties outProps = (SOAPAddressingProperties)builder.newAddressingProperties();
      outProps.setMu(true);
      outProps.setTo(builder.newURI("http://localhost:8080/jaxrpc-addressing-action-rpc/ActionService"));
         outProps.setAction(builder.newURI("urn:wsa-action-bar"));
         msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, outProps);
      }
      catch (URISyntaxException ex)
      {
         throw new IllegalStateException("Cannot handle request", 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

    super.setUp();

    MessageFactory factory = MessageFactory.newInstance();
    SOAPMessage soapMessage = factory.createMessage(null, new ByteArrayInputStream(reqEnvStr.getBytes()));

    AddressingBuilder addrBuilder = SOAPAddressingBuilder.getAddressingBuilder();
    addrProps = (SOAPAddressingProperties)addrBuilder.newAddressingProperties();
    addrProps.readHeaders(soapMessage);
  }
View Full Code Here

    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

   {
      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

   // 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

   {
      log.info("enter handleRequest");

      try
      {
         AddressingBuilder builder = SOAPAddressingBuilder.getAddressingBuilder();
         SOAPAddressingProperties outProps = (SOAPAddressingProperties)builder.newAddressingProperties();
         outProps.setTo(builder.newURI("http://" + getServerHost() + ":8080/jaxrpc-samples-wsaddr-hello"));
         outProps.setAction(builder.newURI("http://org.jboss.ws/jaxrpc/samples/wsaddr/replyto/sayHello"));
         EndpointReference rp = builder.newEndpointReference(new URI("http://" + getServerHost() + ":8080/jaxrpc-samples-wsaddr-replyto"));
         outProps.setReplyTo(rp);
         outProps.setMessageID(builder.newURI("123456"));
         context.setProperty(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, outProps);
      }
      catch(URISyntaxException e)
      {
         e.printStackTrace();
View Full Code Here

            addElement(soapElement.cloneNode(true));
         }
      }     
      if (props.getMessageID() != null)
      {
         AddressingBuilder builder = AddressingBuilder.getAddressingBuilder();
         Relationship rel = builder.newRelationship(props.getMessageID().getURI());
         this.relatesTo = new Relationship[] { rel };
      }

    this.initialized = true;
  }
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.