MetadataType metadata = ...; Node oaidcNode = (Node)metadata.getAny(); // org.w3c.dom.Node JAXBContext oaidcContext = ...; Unmarshaller oaidcUnmarshaller = oaidcContext.createUnmarshaller(); // use Unmarshaller.unmarshal(Node) or Unmarshaller.unmarshal(Node, Class<T>)
/** * Sets the service and port name of the provided endpoint reference. * @param ref the endpoint reference. * @param serviceName the name of service. * @param portName the port name. */ public static void setServiceAndPortName(EndpointReferenceType ref, QName serviceName, String portName) { if (null != serviceName) { JAXBElement<ServiceNameType> jaxbElement = getServiceNameType(serviceName, portName); MetadataType mt = WSAEndpointReferenceUtils.getSetMetadata(ref); mt.getAny().add(jaxbElement); } }
public static void setPortName(EndpointReferenceType ref, String portName) { MetadataType metadata = ref.getMetadata(); if (metadata != null) { for (Object obj : metadata.getAny()) { if (obj instanceof Element) { Element node = (Element)obj; if (node.getNodeName().contains("ServiceName") && (node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAW) || node.getNamespaceURI().equals(NS_WSAW_2005) || node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAM))) { node.setAttribute(JAXWSAConstants.WSAM_ENDPOINT_NAME, portName); } } else if (obj instanceof JAXBElement) { Object val = ((JAXBElement<?>)obj).getValue(); if (val instanceof ServiceNameType) { ((ServiceNameType)val).setEndpointName(portName); } } else if (obj instanceof ServiceNameType) { ((ServiceNameType)obj).setEndpointName(portName); } } } }
public static String findMEXLocation(EndpointReferenceType ref) { if (ref.getMetadata() != null && ref.getMetadata().getAny() != null) { for (Object any : ref.getMetadata().getAny()) { if (any instanceof Element) { String addr = findMEXLocation((Element)any); if (addr != null) { return addr; } } } } return null; }
/** * Sets the service and port name of the provided endpoint reference. * @param ref the endpoint reference. * @param serviceName the name of service. * @param portName the port name. */ public static void setServiceAndPortName(EndpointReferenceType ref, QName serviceName, String portName) { if (null != serviceName) { JAXBElement<ServiceNameType> jaxbElement = getServiceNameType(serviceName, portName); MetadataType mt = getSetMetadata(ref); mt.getAny().add(jaxbElement); } }
/** * Sets the service and port name of the provided endpoint reference. * @param ref the endpoint reference. * @param serviceName the name of service. * @param portName the port name. */ public static void setServiceAndPortName(EndpointReferenceType ref, QName serviceName, String portName) { if (null != serviceName) { JAXBElement<ServiceNameType> jaxbElement = getServiceNameType(serviceName, portName); MetadataType mt = getSetMetadata(ref); mt.getAny().add(jaxbElement); } }
/** * Sets the service and port name of the provided endpoint reference. * @param ref the endpoint reference. * @param serviceName the name of service. * @param portName the port name. */ public static void setServiceAndPortName(EndpointReferenceType ref, QName serviceName, String portName) { if (null != serviceName) { JAXBElement<ServiceNameType> jaxbElement = getServiceNameType(serviceName, portName); MetadataType mt = WSAEndpointReferenceUtils.getSetMetadata(ref); mt.getAny().add(jaxbElement); } }
public static void setPortName(EndpointReferenceType ref, String portName) { MetadataType metadata = ref.getMetadata(); if (metadata != null) { for (Object obj : metadata.getAny()) { if (obj instanceof Element) { Element node = (Element)obj; if (node.getNodeName().contains("ServiceName") && (node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAW) || node.getNamespaceURI().equals(NS_WSAW_2005) || node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAM))) { node.setAttribute(JAXWSAConstants.WSAM_ENDPOINT_NAME, portName); } } else if (obj instanceof JAXBElement) { Object val = ((JAXBElement<?>)obj).getValue(); if (val instanceof ServiceNameType) { ((ServiceNameType)val).setEndpointName(portName); } } else if (obj instanceof ServiceNameType) { ((ServiceNameType)obj).setEndpointName(portName); } } } }
public static String findMEXLocation(EndpointReferenceType ref) { if (ref.getMetadata() != null && ref.getMetadata().getAny() != null) { for (Object any : ref.getMetadata().getAny()) { if (any instanceof Element) { String addr = findMEXLocation((Element)any); if (addr != null) { return addr; } } } } return null; }
/** * Gets the port name of the provided endpoint reference. * @param ref the endpoint reference. * @return the port name. */ public static String getPortName(EndpointReferenceType ref) { MetadataType metadata = ref.getMetadata(); if (metadata != null) { for (Object obj : metadata.getAny()) { if (obj instanceof Element) { Node node = (Element)obj; if ((node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAW) || node.getNamespaceURI().equals(NS_WSAW_2005) || node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAM)) && node.getNodeName().contains("ServiceName")) { Node item = node.getAttributes().getNamedItem("EndpointName"); return item != null ? item.getTextContent() : null; } } else if (obj instanceof JAXBElement) { Object val = ((JAXBElement<?>)obj).getValue(); if (val instanceof ServiceNameType) { return ((ServiceNameType)val).getEndpointName(); } } else if (obj instanceof ServiceNameType) { return ((ServiceNameType)obj).getEndpointName(); } } } return null; }
public static void setPortName(EndpointReferenceType ref, String portName) { MetadataType metadata = ref.getMetadata(); if (metadata != null) { for (Object obj : metadata.getAny()) { if (obj instanceof Element) { Element node = (Element)obj; if (node.getNodeName().contains("ServiceName") && (node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAW) || node.getNamespaceURI().equals(NS_WSAW_2005) || node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAM))) { node.setAttribute(JAXWSAConstants.WSAM_ENDPOINT_NAME, portName); } } else if (obj instanceof JAXBElement) { Object val = ((JAXBElement<?>)obj).getValue(); if (val instanceof ServiceNameType) { ((ServiceNameType)val).setEndpointName(portName); } } else if (obj instanceof ServiceNameType) { ((ServiceNameType)obj).setEndpointName(portName); } } } }
public static void setPortName(EndpointReferenceType ref, String portName) { MetadataType metadata = ref.getMetadata(); if (metadata != null) { for (Object obj : metadata.getAny()) { if (obj instanceof Element) { Element node = (Element)obj; if (node.getNodeName().contains("ServiceName") && (node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAW) || node.getNamespaceURI().equals(NS_WSAW_2005) || node.getNamespaceURI().equals(JAXWSAConstants.NS_WSAM))) { node.setAttribute(JAXWSAConstants.WSAM_ENDPOINT_NAME, portName); } } else if (obj instanceof JAXBElement) { Object val = ((JAXBElement<?>)obj).getValue(); if (val instanceof ServiceNameType) { ((ServiceNameType)val).setEndpointName(portName); } } else if (obj instanceof ServiceNameType) { ((ServiceNameType)obj).setEndpointName(portName); } } } }
protected String findMEXLocation(EndpointReferenceType ref, boolean useEPRWSAAddrAsMEXLocation) { if (ref.getMetadata() != null && ref.getMetadata().getAny() != null) { for (Object any : ref.getMetadata().getAny()) { if (any instanceof Element) { String addr = findMEXLocation((Element)any); if (addr != null) { return addr; } } } } return useEPRWSAAddrAsMEXLocation ? EndpointReferenceUtils.getAddress(ref) : null; }
/** * Adds service locator properties to an endpoint reference. * @param epr * @param props */ private static void addProperties(EndpointReferenceType epr, SLProperties props) { MetadataType metadata = WSAEndpointReferenceUtils.getSetMetadata(epr); ServiceLocatorPropertiesType jaxbProps = SLPropertiesConverter.toServiceLocatorPropertiesType(props); JAXBElement<ServiceLocatorPropertiesType> slp = SL_OBJECT_FACTORY.createServiceLocatorProperties(jaxbProps); metadata.getAny().add(slp); }
/** * Adds service locator properties to an endpoint reference. * @param epr * @param props */ private static void addProperties(EndpointReferenceType epr, SLProperties props) { MetadataType metadata = WSAEndpointReferenceUtils.getSetMetadata(epr); ServiceLocatorPropertiesType jaxbProps = SLPropertiesConverter.toServiceLocatorPropertiesType(props); JAXBElement<ServiceLocatorPropertiesType> slp = SL_OBJECT_FACTORY.createServiceLocatorProperties(jaxbProps); metadata.getAny().add(slp); }
protected String findMEXLocation(EndpointReferenceType ref, boolean useEPRWSAAddrAsMEXLocation) { if (ref.getMetadata() != null && ref.getMetadata().getAny() != null) { for (Object any : ref.getMetadata().getAny()) { if (any instanceof Element) { String addr = findMEXLocation((Element)any); if (addr != null) { return addr; } } } } return useEPRWSAAddrAsMEXLocation ? EndpointReferenceUtils.getAddress(ref) : null; }
public static void setInterfaceName(EndpointReferenceType ref, QName portTypeName) { if (null != portTypeName) { AttributedQNameType interfaceNameType = WSA_WSDL_OBJECT_FACTORY.createAttributedQNameType(); interfaceNameType.setValue(portTypeName); interfaceNameType.getOtherAttributes().put(XML_SCHEMA_NAMESPACE_NS, XML_SCHEMA_NAMESPACE); interfaceNameType.getOtherAttributes().put(XSI_TYPE, XML_SCHEMA_NAMESPACE_PREFIX + ":" + portTypeName.getClass().getSimpleName()); JAXBElement<AttributedQNameType> jaxbElement = WSA_WSDL_OBJECT_FACTORY.createInterfaceName(interfaceNameType); MetadataType mt = getSetMetadata(ref); mt.getAny().add(jaxbElement); } }
public static void setInterfaceName(EndpointReferenceType ref, QName portTypeName) { if (null != portTypeName) { AttributedQNameType interfaceNameType = WSA_WSDL_OBJECT_FACTORY.createAttributedQNameType(); interfaceNameType.setValue(portTypeName); interfaceNameType.getOtherAttributes().put(XML_SCHEMA_NAMESPACE_NS, XML_SCHEMA_NAMESPACE); interfaceNameType.getOtherAttributes().put(XSI_TYPE, XML_SCHEMA_NAMESPACE_PREFIX + ":" + portTypeName.getClass().getSimpleName()); JAXBElement<AttributedQNameType> jaxbElement = WSA_WSDL_OBJECT_FACTORY.createInterfaceName(interfaceNameType); MetadataType mt = WSAEndpointReferenceUtils.getSetMetadata(ref); mt.getAny().add(jaxbElement); } }
public static void setInterfaceName(EndpointReferenceType ref, QName portTypeName) { if (null != portTypeName) { AttributedQNameType interfaceNameType = WSA_WSDL_OBJECT_FACTORY.createAttributedQNameType(); interfaceNameType.setValue(portTypeName); interfaceNameType.getOtherAttributes().put(XML_SCHEMA_NAMESPACE_NS, XML_SCHEMA_NAMESPACE); interfaceNameType.getOtherAttributes().put(XSI_TYPE, XML_SCHEMA_NAMESPACE_PREFIX + ":" + portTypeName.getClass().getSimpleName()); JAXBElement<AttributedQNameType> jaxbElement = WSA_WSDL_OBJECT_FACTORY.createInterfaceName(interfaceNameType); MetadataType mt = getSetMetadata(ref); mt.getAny().add(jaxbElement); } }
public static void setInterfaceName(EndpointReferenceType ref, QName portTypeName) { if (null != portTypeName) { AttributedQNameType interfaceNameType = WSA_WSDL_OBJECT_FACTORY.createAttributedQNameType(); interfaceNameType.setValue(portTypeName); interfaceNameType.getOtherAttributes().put(XML_SCHEMA_NAMESPACE_NS, XML_SCHEMA_NAMESPACE); interfaceNameType.getOtherAttributes().put(XSI_TYPE, XML_SCHEMA_NAMESPACE_PREFIX + ":" + portTypeName.getClass().getSimpleName()); JAXBElement<AttributedQNameType> jaxbElement = WSA_WSDL_OBJECT_FACTORY.createInterfaceName(interfaceNameType); MetadataType mt = WSAEndpointReferenceUtils.getSetMetadata(ref); mt.getAny().add(jaxbElement); } }