public void setReplyTo(MAPEndpoint epref) { if (epref != null) { if (epref instanceof CXFMAPEndpoint) { implementation.setReplyTo(((CXFMAPEndpoint)epref).getImplementation()); } else { throw MESSAGES.unsupportedMapEndpoin(epref); } } else { implementation.setReplyTo(null); } }
.getEndpointReference(wsaHeaderValue)); } else if (Names.WSA_REPLYTO_NAME.equals(ent.getKey())) { maps.setReplyTo(EndpointReferenceUtils .getEndpointReference(wsaHeaderValue)); } else if (Names.WSA_FAULTTO_NAME.equals(ent.getKey())) {
@Override public void handleMessage(SoapMessage message) { AddressingProperties ap = ContextUtils.retrieveMAPs(message, true, false); if (ap != null) { EndpointReferenceType epr = new EndpointReferenceType(); AttributedURIType aut = new AttributedURIType(); aut.setValue("http://www.w3.org/2005/08/addressing/anonymous"); epr.setAddress(aut); ap.setReplyTo(epr); } } }
? Names.WSA_REPLYTO_QNAME : null; maps.setReplyTo(decodeAsNative( headerURI, EndpointReferenceType.class, ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType(); replyTo.setAddress(address); maps.setReplyTo(replyTo);
private void aggregateAddressing( SoapMessage message, String callbackEndpoint, String relatesTo) { final AddressingProperties maps = initAddressingProperties(message); if (callbackEndpoint != null) { EndpointReferenceType replyTo= maps.getReplyTo(); if (replyTo == null || ContextUtils.isGenericAddress(replyTo)) { EndpointReferenceType replyToRef = new EndpointReferenceType(); AttributedURIType address = new AttributedURIType(); address.setValue(callbackEndpoint); replyToRef.setAddress(address); maps.setReplyTo(replyToRef); } } /* Have to comment out "RelatesTo" setting after Upgrade CXF to 3.2.6 if (maps.getRelatesTo() == null) { RelatesToType relatesToAttr = new RelatesToType(); relatesToAttr.setRelationshipType("message"); relatesToAttr.setValue(relatesTo); maps.setRelatesTo(relatesToAttr); }*/ }
? Names.WSA_REPLYTO_QNAME : null; maps.setReplyTo(decodeAsNative( headerURI, EndpointReferenceType.class, ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType(); replyTo.setAddress(address); maps.setReplyTo(replyTo);
/** * Initializes WS-Addressing headers MessageID and ReplyTo, * and stores them into the given message context. */ private static void configureWSAHeaders(String messageId, String replyToUri, WrappedMessageContext context) { // obtain headers' container AddressingProperties apropos = (AddressingProperties) context.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES); if (apropos == null) { apropos = new AddressingProperties(); context.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, apropos); } // MessageID header AttributedURIType uri = new AttributedURIType(); uri.setValue(messageId); apropos.setMessageID(uri); LOG.debug("Set WS-Addressing message ID: {}", messageId); // ReplyTo header if (replyToUri != null) { AttributedURIType uri2 = new AttributedURIType(); uri2.setValue(replyToUri); EndpointReferenceType endpointReference = new EndpointReferenceType(); endpointReference.setAddress(uri2); apropos.setReplyTo(endpointReference); } }
/** * Construct and store MAPs for partial response. * * @param partialResponse the partial response message * @param namespaceURI the current namespace URI */ private static void ensurePartialResponseMAPs(Message partialResponse, String namespaceURI) { // ensure there is a MAPs instance available for the outbound // partial response that contains appropriate To and ReplyTo // properties (i.e. anonymous & none respectively) AddressingProperties maps = new AddressingProperties(); maps.setTo(EndpointReferenceUtils.getAnonymousEndpointReference()); maps.setReplyTo(ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType()); maps.getReplyTo().setAddress(ContextUtils.getAttributedURI(Names.WSA_NONE_ADDRESS)); maps.setAction(ContextUtils.getAttributedURI("")); maps.exposeAs(namespaceURI); ContextUtils.storeMAPs(maps, partialResponse, true, true, false); }
/** * Construct and store MAPs for partial response. * * @param partialResponse the partial response message * @param namespaceURI the current namespace URI */ private static void ensurePartialResponseMAPs(Message partialResponse, String namespaceURI) { // ensure there is a MAPs instance available for the outbound // partial response that contains appropriate To and ReplyTo // properties (i.e. anonymous & none respectively) AddressingProperties maps = new AddressingProperties(); maps.setTo(EndpointReferenceUtils.getAnonymousEndpointReference()); maps.setReplyTo(ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType()); maps.getReplyTo().setAddress(ContextUtils.getAttributedURI(Names.WSA_NONE_ADDRESS)); maps.setAction(ContextUtils.getAttributedURI("")); maps.exposeAs(namespaceURI); ContextUtils.storeMAPs(maps, partialResponse, true, true, false); }
/** * Construct and store MAPs for partial response. * * @param partialResponse the partial response message * @param namespaceURI the current namespace URI */ private static void ensurePartialResponseMAPs(Message partialResponse, String namespaceURI) { // ensure there is a MAPs instance available for the outbound // partial response that contains appropriate To and ReplyTo // properties (i.e. anonymous & none respectively) AddressingProperties maps = new AddressingProperties(); maps.setTo(EndpointReferenceUtils.getAnonymousEndpointReference()); maps.setReplyTo(ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType()); maps.getReplyTo().setAddress(ContextUtils.getAttributedURI(Names.WSA_NONE_ADDRESS)); maps.setAction(ContextUtils.getAttributedURI("")); maps.exposeAs(namespaceURI); ContextUtils.storeMAPs(maps, partialResponse, true, true, false); }
maps.setReplyTo(RMUtils.createNoneReference());
@Test public void testNonAnonToAnon() throws Exception { try (AddNumbersPortTypeProxy port = getPort()) { port.getRequestContext() .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + PORT + "/jaxws/addAnon"); AddressingProperties maps = new AddressingProperties(); EndpointReferenceType ref = new EndpointReferenceType(); AttributedURIType add = new AttributedURIType(); add.setValue("http://localhost:" + INVALID_PORT + "/not/a/real/url"); ref.setAddress(add); maps.setReplyTo(ref); maps.setFaultTo(ref); port.getRequestContext() .put("javax.xml.ws.addressing.context", maps); try { port.addNumbers3(-1, 2); } catch (SOAPFaultException e) { assertTrue(e.getFault().getFaultCode().contains("OnlyAnonymousAddressSupported")); } } } private AddNumbersPortTypeProxy getPort()throws Exception {
replyTo.setAddress(address); maps.setReplyTo(replyTo);
replyTo.setAddress(address); maps.setReplyTo(replyTo);
ref = new EndpointReferenceType(); ref.setAddress(uri); maps.setReplyTo(ref);
ref = new EndpointReferenceType(); ref.setAddress(uri); maps.setReplyTo(ref);
ref = new EndpointReferenceType(); ref.setAddress(uri); maps.setReplyTo(ref);