/** * Create an instance of {@link ReferenceParametersType } * */ public ReferenceParametersType createReferenceParametersType() { return new ReferenceParametersType(); }
/** * Create an instance of {@link ReferenceParametersType } * */ public ReferenceParametersType createReferenceParametersType() { return new ReferenceParametersType(); }
/** * Create an instance of {@link ReferenceParametersType } * */ public ReferenceParametersType createReferenceParametersType() { return new ReferenceParametersType(); }
/** * Create an instance of {@link ReferenceParametersType } * */ public ReferenceParametersType createReferenceParametersType() { return new ReferenceParametersType(); }
@Override public ReferenceParametersType create(Representation initRepresentation) { // Store xmlResource String uuid = UUID.randomUUID().toString(); Element representationEl = (Element) initRepresentation.getAny(); if (representationEl == null) { storage.put(uuid, ""); } else { storage.put(uuid, StaxUtils.toString(representationEl)); } Element uuidEl = DOMUtils.getEmptyDocument().createElementNS(REF_NAMESPACE, REF_LOCAL_NAME); uuidEl.setTextContent(uuid); // Create referenceParameter ReferenceParametersType refParam = new ReferenceParametersType(); refParam.getAny().add(uuidEl); return refParam; }
@Override public ReferenceParametersType create(Representation initRepresentation) { // Store xmlResource String uuid = UUID.randomUUID().toString(); Element representationEl = (Element) initRepresentation.getAny(); if (representationEl == null) { storage.put(uuid, ""); } else { storage.put(uuid, StaxUtils.toString(representationEl)); } Element uuidEl = DOMUtils.getEmptyDocument().createElementNS(REF_NAMESPACE, REF_LOCAL_NAME); uuidEl.setTextContent(uuid); // Create referenceParameter ReferenceParametersType refParam = new ReferenceParametersType(); refParam.getAny().add(uuidEl); return refParam; }
public void addReferenceParameter(Element element) { ReferenceParametersType refParams = implementation.getReferenceParameters(); if (refParams == null) { refParams = new ReferenceParametersType(); implementation.setReferenceParameters(refParams); } refParams.getAny().add(element); }
protected void grantSubscriptionManagerReference(SubscriptionTicket ticket, SubscriptionTicketGrantingResponse response) { EndpointReferenceType subscriptionManagerReference = new EndpointReferenceType(); subscriptionManagerReference.setAddress(getSubscriptionManagerAddress()); // generate a ID for this subscription UUID uuid = UUID.randomUUID(); JAXBElement<String> idqn = new JAXBElement<>(new QName(subscriptionIdNamespace, subscriptionIdElementName), String.class, uuid.toString()); subscriptionManagerReference.setReferenceParameters(new ReferenceParametersType()); subscriptionManagerReference.getReferenceParameters().getAny().add(idqn); ticket.setUuid(uuid); response.setSubscriptionManagerReference(subscriptionManagerReference); response.setUUID(uuid); }
protected void grantSubscriptionManagerReference(SubscriptionTicket ticket, SubscriptionTicketGrantingResponse response) { EndpointReferenceType subscriptionManagerReference = new EndpointReferenceType(); subscriptionManagerReference.setAddress(getSubscriptionManagerAddress()); // generate a ID for this subscription UUID uuid = UUID.randomUUID(); JAXBElement<String> idqn = new JAXBElement<>(new QName(subscriptionIdNamespace, subscriptionIdElementName), String.class, uuid.toString()); subscriptionManagerReference.setReferenceParameters(new ReferenceParametersType()); subscriptionManagerReference.getReferenceParameters().getAny().add(idqn); ticket.setUuid(uuid); response.setSubscriptionManagerReference(subscriptionManagerReference); response.setUUID(uuid); }
factory.setServiceClass(...); factory.setAddress(...); factory.getFeatures().add(new WSAddressingFeature()); SomePortType client = (SomePortType) factory.create(); AddressingProperties maps = new AddressingPropertiesImpl(); EndpointReferenceType epr = new EndpointReferenceType(); //Then you can add referenceParameters to the epr ReferenceParametersType ref = new ReferenceParametersType(); List<Object> paras = ref.getAny(); Country ctry = new Country("xx"); JAXBContext ctx = JAXBContext.newInstance(new Class[] {Country.class }); Marshaller marshaller = ctx.createMarshaller(); DOMResult res = new DOMResult(); marshaller.marshal(ctry, res); Element elt = ((Document) res.getNode()).getDocumentElement(); any.add(elt); epr.setReferenceParameters(ref); maps.setTo(epr); ((BindingProvider)client).getRequestContext() .put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, maps);
public void addReferenceParameter(Element refParam) { EndpointReferenceType eprt = implementation.getToEndpointReference(); ReferenceParametersType refParams = eprt.getReferenceParameters(); if (refParams == null) { refParams = new ReferenceParametersType(); eprt.setReferenceParameters(refParams); } eprt.getReferenceParameters().getAny().add(refParam); //implementation.getToEndpointReference().getReferenceParameters().getAny().add(refParam); }