com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants Java Examples

The following examples show how to use com.sun.xml.internal.ws.addressing.v200408.MemberSubmissionAddressingConstants. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WSDLPatcher.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void handleEndElement() throws XMLStreamException {
    QName name = in.getName();
    if (name.equals(WSDLConstants.QNAME_SERVICE)) {
        serviceName = null;
    } else if (name.equals(WSDLConstants.QNAME_PORT)) {
        portName = null;
    } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)
                    || name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) {
        if (inEpr) {
            inEpr = false;
        }
            } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)
                            || name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) {
                    if (inEprAddress) {
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
                            + " address with "+value);
                out.writeCharacters(value);
            }
            inEprAddress = false;
        }
    }
    super.handleEndElement();
}
 
Example #2
Source File: WSDLPatcher.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void handleEndElement() throws XMLStreamException {
    QName name = in.getName();
    if (name.equals(WSDLConstants.QNAME_SERVICE)) {
        serviceName = null;
    } else if (name.equals(WSDLConstants.QNAME_PORT)) {
        portName = null;
    } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)
                    || name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) {
        if (inEpr) {
            inEpr = false;
        }
            } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)
                            || name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) {
                    if (inEprAddress) {
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
                            + " address with "+value);
                out.writeCharacters(value);
            }
            inEprAddress = false;
        }
    }
    super.handleEndElement();
}
 
Example #3
Source File: WSDLPatcher.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void handleEndElement() throws XMLStreamException {
    QName name = in.getName();
    if (name.equals(WSDLConstants.QNAME_SERVICE)) {
        serviceName = null;
    } else if (name.equals(WSDLConstants.QNAME_PORT)) {
        portName = null;
    } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)
                    || name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) {
        if (inEpr) {
            inEpr = false;
        }
            } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)
                            || name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) {
                    if (inEprAddress) {
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
                            + " address with "+value);
                out.writeCharacters(value);
            }
            inEprAddress = false;
        }
    }
    super.handleEndElement();
}
 
Example #4
Source File: WSDLPatcher.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void handleEndElement() throws XMLStreamException {
    QName name = in.getName();
    if (name.equals(WSDLConstants.QNAME_SERVICE)) {
        serviceName = null;
    } else if (name.equals(WSDLConstants.QNAME_PORT)) {
        portName = null;
    } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)
                    || name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) {
        if (inEpr) {
            inEpr = false;
        }
            } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)
                            || name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) {
                    if (inEprAddress) {
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
                            + " address with "+value);
                out.writeCharacters(value);
            }
            inEprAddress = false;
        }
    }
    super.handleEndElement();
}
 
Example #5
Source File: WSDLPatcher.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void handleEndElement() throws XMLStreamException {
    QName name = in.getName();
    if (name.equals(WSDLConstants.QNAME_SERVICE)) {
        serviceName = null;
    } else if (name.equals(WSDLConstants.QNAME_PORT)) {
        portName = null;
    } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)
                    || name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) {
        if (inEpr) {
            inEpr = false;
        }
            } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)
                            || name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) {
                    if (inEprAddress) {
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
                            + " address with "+value);
                out.writeCharacters(value);
            }
            inEprAddress = false;
        }
    }
    super.handleEndElement();
}
 
Example #6
Source File: WSDLPatcher.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void handleEndElement() throws XMLStreamException {
    QName name = in.getName();
    if (name.equals(WSDLConstants.QNAME_SERVICE)) {
        serviceName = null;
    } else if (name.equals(WSDLConstants.QNAME_PORT)) {
        portName = null;
    } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)
                    || name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) {
        if (inEpr) {
            inEpr = false;
        }
            } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)
                            || name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) {
                    if (inEprAddress) {
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
                            + " address with "+value);
                out.writeCharacters(value);
            }
            inEprAddress = false;
        }
    }
    super.handleEndElement();
}
 
Example #7
Source File: WSDLPatcher.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void handleEndElement() throws XMLStreamException {
    QName name = in.getName();
    if (name.equals(WSDLConstants.QNAME_SERVICE)) {
        serviceName = null;
    } else if (name.equals(WSDLConstants.QNAME_PORT)) {
        portName = null;
    } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)
                    || name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) {
        if (inEpr) {
            inEpr = false;
        }
            } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)
                            || name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) {
                    if (inEprAddress) {
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
                            + " address with "+value);
                out.writeCharacters(value);
            }
            inEprAddress = false;
        }
    }
    super.handleEndElement();
}
 
Example #8
Source File: WSDLPatcher.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected void handleEndElement() throws XMLStreamException {
    QName name = in.getName();
    if (name.equals(WSDLConstants.QNAME_SERVICE)) {
        serviceName = null;
    } else if (name.equals(WSDLConstants.QNAME_PORT)) {
        portName = null;
    } else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)
                    || name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) {
        if (inEpr) {
            inEpr = false;
        }
            } else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)
                            || name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) {
                    if (inEprAddress) {
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
                            + " address with "+value);
                out.writeCharacters(value);
            }
            inEprAddress = false;
        }
    }
    super.handleEndElement();
}
 
Example #9
Source File: WSEndpointReference.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void writePartialEPRInfoset(StreamWriterBufferCreator writer, AddressingVersion version, String address, List<Element> referenceParameters, QName service, QName port, QName portType,
                                           List<Element> metadata, String wsdlAddress, String wsdlTargetNamespace, @Nullable Map<QName, String> attributes) throws XMLStreamException {
    //add extensibile attributes on the EPR element
    if (attributes != null) {
        for (Map.Entry<QName, String> entry : attributes.entrySet()) {
            QName qname = entry.getKey();
            writer.writeAttribute(qname.getPrefix(), qname.getNamespaceURI(), qname.getLocalPart(), entry.getValue());
        }
    }

    writer.writeStartElement(version.getPrefix(), version.eprType.address, version.nsUri);
    writer.writeCharacters(address);
    writer.writeEndElement();
    //When the size of ReferenceParametes is zero, the ReferenceParametes element will not be written.
    if(referenceParameters != null && referenceParameters.size() > 0) {
        writer.writeStartElement(version.getPrefix(), version.eprType.referenceParameters, version.nsUri);
        for (Element e : referenceParameters) {
            DOMUtil.serializeNode(e, writer);
        }
        writer.writeEndElement();
    }

    switch (version) {
        case W3C:
            writeW3CMetaData(writer, service, port, portType, metadata, wsdlAddress, wsdlTargetNamespace);
            break;

        case MEMBER:
            writeMSMetaData(writer, service, port, portType, metadata);
            if (wsdlAddress != null) {
                //Inline the wsdl as extensibility element
                //Write mex:Metadata wrapper
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI());
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getNamespaceURI());
                writer.writeAttribute(MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_ATTRIBUTE,
                        MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_VALUE);

                writeWsdl(writer, service, wsdlAddress);

                writer.writeEndElement();
                writer.writeEndElement();
            }

            break;
    }
}
 
Example #10
Source File: WSEndpointReference.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private static void writePartialEPRInfoset(StreamWriterBufferCreator writer, AddressingVersion version, String address, List<Element> referenceParameters, QName service, QName port, QName portType,
                                           List<Element> metadata, String wsdlAddress, String wsdlTargetNamespace, @Nullable Map<QName, String> attributes) throws XMLStreamException {
    //add extensibile attributes on the EPR element
    if (attributes != null) {
        for (Map.Entry<QName, String> entry : attributes.entrySet()) {
            QName qname = entry.getKey();
            writer.writeAttribute(qname.getPrefix(), qname.getNamespaceURI(), qname.getLocalPart(), entry.getValue());
        }
    }

    writer.writeStartElement(version.getPrefix(), version.eprType.address, version.nsUri);
    writer.writeCharacters(address);
    writer.writeEndElement();
    //When the size of ReferenceParametes is zero, the ReferenceParametes element will not be written.
    if(referenceParameters != null && referenceParameters.size() > 0) {
        writer.writeStartElement(version.getPrefix(), version.eprType.referenceParameters, version.nsUri);
        for (Element e : referenceParameters) {
            DOMUtil.serializeNode(e, writer);
        }
        writer.writeEndElement();
    }

    switch (version) {
        case W3C:
            writeW3CMetaData(writer, service, port, portType, metadata, wsdlAddress, wsdlTargetNamespace);
            break;

        case MEMBER:
            writeMSMetaData(writer, service, port, portType, metadata);
            if (wsdlAddress != null) {
                //Inline the wsdl as extensibility element
                //Write mex:Metadata wrapper
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI());
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getNamespaceURI());
                writer.writeAttribute(MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_ATTRIBUTE,
                        MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_VALUE);

                writeWsdl(writer, service, wsdlAddress);

                writer.writeEndElement();
                writer.writeEndElement();
            }

            break;
    }
}
 
Example #11
Source File: WSEndpointReference.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private static void writePartialEPRInfoset(StreamWriterBufferCreator writer, AddressingVersion version, String address, List<Element> referenceParameters, QName service, QName port, QName portType,
                                           List<Element> metadata, String wsdlAddress, String wsdlTargetNamespace, @Nullable Map<QName, String> attributes) throws XMLStreamException {
    //add extensibile attributes on the EPR element
    if (attributes != null) {
        for (Map.Entry<QName, String> entry : attributes.entrySet()) {
            QName qname = entry.getKey();
            writer.writeAttribute(qname.getPrefix(), qname.getNamespaceURI(), qname.getLocalPart(), entry.getValue());
        }
    }

    writer.writeStartElement(version.getPrefix(), version.eprType.address, version.nsUri);
    writer.writeCharacters(address);
    writer.writeEndElement();
    //When the size of ReferenceParametes is zero, the ReferenceParametes element will not be written.
    if(referenceParameters != null && referenceParameters.size() > 0) {
        writer.writeStartElement(version.getPrefix(), version.eprType.referenceParameters, version.nsUri);
        for (Element e : referenceParameters) {
            DOMUtil.serializeNode(e, writer);
        }
        writer.writeEndElement();
    }

    switch (version) {
        case W3C:
            writeW3CMetaData(writer, service, port, portType, metadata, wsdlAddress, wsdlTargetNamespace);
            break;

        case MEMBER:
            writeMSMetaData(writer, service, port, portType, metadata);
            if (wsdlAddress != null) {
                //Inline the wsdl as extensibility element
                //Write mex:Metadata wrapper
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI());
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getNamespaceURI());
                writer.writeAttribute(MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_ATTRIBUTE,
                        MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_VALUE);

                writeWsdl(writer, service, wsdlAddress);

                writer.writeEndElement();
                writer.writeEndElement();
            }

            break;
    }
}
 
Example #12
Source File: WSEndpointReference.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private static void writePartialEPRInfoset(StreamWriterBufferCreator writer, AddressingVersion version, String address, List<Element> referenceParameters, QName service, QName port, QName portType,
                                           List<Element> metadata, String wsdlAddress, String wsdlTargetNamespace, @Nullable Map<QName, String> attributes) throws XMLStreamException {
    //add extensibile attributes on the EPR element
    if (attributes != null) {
        for (Map.Entry<QName, String> entry : attributes.entrySet()) {
            QName qname = entry.getKey();
            writer.writeAttribute(qname.getPrefix(), qname.getNamespaceURI(), qname.getLocalPart(), entry.getValue());
        }
    }

    writer.writeStartElement(version.getPrefix(), version.eprType.address, version.nsUri);
    writer.writeCharacters(address);
    writer.writeEndElement();
    //When the size of ReferenceParametes is zero, the ReferenceParametes element will not be written.
    if(referenceParameters != null && referenceParameters.size() > 0) {
        writer.writeStartElement(version.getPrefix(), version.eprType.referenceParameters, version.nsUri);
        for (Element e : referenceParameters) {
            DOMUtil.serializeNode(e, writer);
        }
        writer.writeEndElement();
    }

    switch (version) {
        case W3C:
            writeW3CMetaData(writer, service, port, portType, metadata, wsdlAddress, wsdlTargetNamespace);
            break;

        case MEMBER:
            writeMSMetaData(writer, service, port, portType, metadata);
            if (wsdlAddress != null) {
                //Inline the wsdl as extensibility element
                //Write mex:Metadata wrapper
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI());
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getNamespaceURI());
                writer.writeAttribute(MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_ATTRIBUTE,
                        MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_VALUE);

                writeWsdl(writer, service, wsdlAddress);

                writer.writeEndElement();
                writer.writeEndElement();
            }

            break;
    }
}
 
Example #13
Source File: WSEndpointReference.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private static void writePartialEPRInfoset(StreamWriterBufferCreator writer, AddressingVersion version, String address, List<Element> referenceParameters, QName service, QName port, QName portType,
                                           List<Element> metadata, String wsdlAddress, String wsdlTargetNamespace, @Nullable Map<QName, String> attributes) throws XMLStreamException {
    //add extensibile attributes on the EPR element
    if (attributes != null) {
        for (Map.Entry<QName, String> entry : attributes.entrySet()) {
            QName qname = entry.getKey();
            writer.writeAttribute(qname.getPrefix(), qname.getNamespaceURI(), qname.getLocalPart(), entry.getValue());
        }
    }

    writer.writeStartElement(version.getPrefix(), version.eprType.address, version.nsUri);
    writer.writeCharacters(address);
    writer.writeEndElement();
    //When the size of ReferenceParametes is zero, the ReferenceParametes element will not be written.
    if(referenceParameters != null && referenceParameters.size() > 0) {
        writer.writeStartElement(version.getPrefix(), version.eprType.referenceParameters, version.nsUri);
        for (Element e : referenceParameters) {
            DOMUtil.serializeNode(e, writer);
        }
        writer.writeEndElement();
    }

    switch (version) {
        case W3C:
            writeW3CMetaData(writer, service, port, portType, metadata, wsdlAddress, wsdlTargetNamespace);
            break;

        case MEMBER:
            writeMSMetaData(writer, service, port, portType, metadata);
            if (wsdlAddress != null) {
                //Inline the wsdl as extensibility element
                //Write mex:Metadata wrapper
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI());
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getNamespaceURI());
                writer.writeAttribute(MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_ATTRIBUTE,
                        MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_VALUE);

                writeWsdl(writer, service, wsdlAddress);

                writer.writeEndElement();
                writer.writeEndElement();
            }

            break;
    }
}
 
Example #14
Source File: WSEndpointReference.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private static void writePartialEPRInfoset(StreamWriterBufferCreator writer, AddressingVersion version, String address, List<Element> referenceParameters, QName service, QName port, QName portType,
                                           List<Element> metadata, String wsdlAddress, String wsdlTargetNamespace, @Nullable Map<QName, String> attributes) throws XMLStreamException {
    //add extensibile attributes on the EPR element
    if (attributes != null) {
        for (Map.Entry<QName, String> entry : attributes.entrySet()) {
            QName qname = entry.getKey();
            writer.writeAttribute(qname.getPrefix(), qname.getNamespaceURI(), qname.getLocalPart(), entry.getValue());
        }
    }

    writer.writeStartElement(version.getPrefix(), version.eprType.address, version.nsUri);
    writer.writeCharacters(address);
    writer.writeEndElement();
    //When the size of ReferenceParametes is zero, the ReferenceParametes element will not be written.
    if(referenceParameters != null && referenceParameters.size() > 0) {
        writer.writeStartElement(version.getPrefix(), version.eprType.referenceParameters, version.nsUri);
        for (Element e : referenceParameters) {
            DOMUtil.serializeNode(e, writer);
        }
        writer.writeEndElement();
    }

    switch (version) {
        case W3C:
            writeW3CMetaData(writer, service, port, portType, metadata, wsdlAddress, wsdlTargetNamespace);
            break;

        case MEMBER:
            writeMSMetaData(writer, service, port, portType, metadata);
            if (wsdlAddress != null) {
                //Inline the wsdl as extensibility element
                //Write mex:Metadata wrapper
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI());
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getNamespaceURI());
                writer.writeAttribute(MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_ATTRIBUTE,
                        MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_VALUE);

                writeWsdl(writer, service, wsdlAddress);

                writer.writeEndElement();
                writer.writeEndElement();
            }

            break;
    }
}
 
Example #15
Source File: WSEndpointReference.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private static void writePartialEPRInfoset(StreamWriterBufferCreator writer, AddressingVersion version, String address, List<Element> referenceParameters, QName service, QName port, QName portType,
                                           List<Element> metadata, String wsdlAddress, String wsdlTargetNamespace, @Nullable Map<QName, String> attributes) throws XMLStreamException {
    //add extensibile attributes on the EPR element
    if (attributes != null) {
        for (Map.Entry<QName, String> entry : attributes.entrySet()) {
            QName qname = entry.getKey();
            writer.writeAttribute(qname.getPrefix(), qname.getNamespaceURI(), qname.getLocalPart(), entry.getValue());
        }
    }

    writer.writeStartElement(version.getPrefix(), version.eprType.address, version.nsUri);
    writer.writeCharacters(address);
    writer.writeEndElement();
    //When the size of ReferenceParametes is zero, the ReferenceParametes element will not be written.
    if(referenceParameters != null && referenceParameters.size() > 0) {
        writer.writeStartElement(version.getPrefix(), version.eprType.referenceParameters, version.nsUri);
        for (Element e : referenceParameters) {
            DOMUtil.serializeNode(e, writer);
        }
        writer.writeEndElement();
    }

    switch (version) {
        case W3C:
            writeW3CMetaData(writer, service, port, portType, metadata, wsdlAddress, wsdlTargetNamespace);
            break;

        case MEMBER:
            writeMSMetaData(writer, service, port, portType, metadata);
            if (wsdlAddress != null) {
                //Inline the wsdl as extensibility element
                //Write mex:Metadata wrapper
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI());
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getNamespaceURI());
                writer.writeAttribute(MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_ATTRIBUTE,
                        MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_VALUE);

                writeWsdl(writer, service, wsdlAddress);

                writer.writeEndElement();
                writer.writeEndElement();
            }

            break;
    }
}
 
Example #16
Source File: WSEndpointReference.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private static void writePartialEPRInfoset(StreamWriterBufferCreator writer, AddressingVersion version, String address, List<Element> referenceParameters, QName service, QName port, QName portType,
                                           List<Element> metadata, String wsdlAddress, String wsdlTargetNamespace, @Nullable Map<QName, String> attributes) throws XMLStreamException {
    //add extensibile attributes on the EPR element
    if (attributes != null) {
        for (Map.Entry<QName, String> entry : attributes.entrySet()) {
            QName qname = entry.getKey();
            writer.writeAttribute(qname.getPrefix(), qname.getNamespaceURI(), qname.getLocalPart(), entry.getValue());
        }
    }

    writer.writeStartElement(version.getPrefix(), version.eprType.address, version.nsUri);
    writer.writeCharacters(address);
    writer.writeEndElement();
    //When the size of ReferenceParametes is zero, the ReferenceParametes element will not be written.
    if(referenceParameters != null && referenceParameters.size() > 0) {
        writer.writeStartElement(version.getPrefix(), version.eprType.referenceParameters, version.nsUri);
        for (Element e : referenceParameters) {
            DOMUtil.serializeNode(e, writer);
        }
        writer.writeEndElement();
    }

    switch (version) {
        case W3C:
            writeW3CMetaData(writer, service, port, portType, metadata, wsdlAddress, wsdlTargetNamespace);
            break;

        case MEMBER:
            writeMSMetaData(writer, service, port, portType, metadata);
            if (wsdlAddress != null) {
                //Inline the wsdl as extensibility element
                //Write mex:Metadata wrapper
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA.getNamespaceURI());
                writer.writeStartElement(MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getPrefix(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getLocalPart(),
                        MemberSubmissionAddressingConstants.MEX_METADATA_SECTION.getNamespaceURI());
                writer.writeAttribute(MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_ATTRIBUTE,
                        MemberSubmissionAddressingConstants.MEX_METADATA_DIALECT_VALUE);

                writeWsdl(writer, service, wsdlAddress);

                writer.writeEndElement();
                writer.writeEndElement();
            }

            break;
    }
}