예제 #1
0
 /**
  * Given an address, create the WS-Addressing issuer
  *
  * @param addressUri
  * @return
  */
 public static EndpointReferenceType createIssuer(String addressUri) {
   AttributedURIType attributedURI = new AttributedURIType();
   attributedURI.setValue(addressUri);
   EndpointReferenceType endpointReference = new EndpointReferenceType();
   endpointReference.setAddress(attributedURI);
   return endpointReference;
 }
예제 #2
0
  /**
   * Creates an instance of {@code AppliesTo} using the specified endpoint address.
   *
   * @param endpointURI a {@code String} representing the endpoint URI.
   * @return the constructed {@code AppliesTo} instance.
   */
  public static AppliesTo createAppliesTo(String endpointURI) {
    AttributedURIType attributedURI = new AttributedURIType();
    attributedURI.setValue(endpointURI);
    EndpointReferenceType reference = new EndpointReferenceType();
    reference.setAddress(attributedURI);
    AppliesTo appliesTo = new AppliesTo();
    appliesTo.addAny(reference);

    return appliesTo;
  }
예제 #3
0
  public void write(EndpointReferenceType endpointReference) throws ProcessingException {
    StaxUtil.writeStartElement(writer, WSA_PREFIX, ENDPOINT_REFERENCE, WSA_NS);
    StaxUtil.writeNameSpace(writer, WSA_PREFIX, WSA_NS);

    AttributedURIType attributedURI = endpointReference.getAddress();
    if (attributedURI != null) {
      String value = attributedURI.getValue();

      StaxUtil.writeStartElement(writer, WSA_PREFIX, ADDRESS, WSA_NS);
      StaxUtil.writeCharacters(writer, value);
      StaxUtil.writeEndElement(writer);
    }

    StaxUtil.writeEndElement(writer);
    StaxUtil.flush(writer);
  }