Java源码示例:com.sun.xml.internal.ws.wsdl.parser.WSDLConstants

示例1
@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();
}
 
示例2
@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();
}
 
示例3
@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();
}
 
示例4
@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();
}
 
示例5
@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();
}
 
示例6
@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();
}
 
示例7
@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();
}
 
示例8
@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();
}
 
示例9
private static void writeWsdl(StreamWriterBufferCreator writer, QName service, String wsdlAddress) throws XMLStreamException {
    // Inline-wsdl
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_DEFINITIONS.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeNamespace(WSDLConstants.PREFIX_NS_WSDL, WSDLConstants.NS_WSDL);
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_IMPORT.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeAttribute("namespace", service.getNamespaceURI());
    writer.writeAttribute("location", wsdlAddress);
    writer.writeEndElement();
    writer.writeEndElement();
}
 
示例10
/**
 * Constructs a Source containing the wsdl from the MemberSubmissionEndpointReference
 *
 * @return Source A source object containing the wsdl in the MemeberSubmissionEndpointReference, if present.
 */
public Source toWSDLSource() {
    Element wsdlElement = null;

    for (Element elem : elements) {
        if (elem.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
                elem.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
            wsdlElement = elem;
        }
    }

    return new DOMSource(wsdlElement);
}
 
示例11
@Override
protected void handleAttribute(int i) throws XMLStreamException {
    QName name = in.getName();
    String attLocalName = in.getAttributeLocalName(i);

    if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_IMPORT_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_REDEFINE_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(WSDLConstants.QNAME_IMPORT)  && attLocalName.equals("location"))) {
        // patch this attribute value.

        String relPath = in.getAttributeValue(i);
        String actualPath = getPatchedImportLocation(relPath);
        if (actualPath == null) {
            return; // skip this attribute to leave it up to "implicit reference".
        }

        logger.fine("Fixing the relative location:"+relPath
                +" with absolute location:"+actualPath);
        writeAttribute(i, actualPath);
        return;
    }

    if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
        name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {

        if(attLocalName.equals("location")) {
            portAddress = in.getAttributeValue(i);
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Service:"+serviceName+ " port:"+portName
                        + " current address "+portAddress+" Patching it with "+value);
                writeAttribute(i, value);
                return;
            }
        }
    }

    super.handleAttribute(i);
}
 
示例12
private static void writeWsdl(StreamWriterBufferCreator writer, QName service, String wsdlAddress) throws XMLStreamException {
    // Inline-wsdl
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_DEFINITIONS.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeNamespace(WSDLConstants.PREFIX_NS_WSDL, WSDLConstants.NS_WSDL);
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_IMPORT.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeAttribute("namespace", service.getNamespaceURI());
    writer.writeAttribute("location", wsdlAddress);
    writer.writeEndElement();
    writer.writeEndElement();
}
 
示例13
/**
 * Constructs a Source containing the wsdl from the MemberSubmissionEndpointReference
 *
 * @return Source A source object containing the wsdl in the MemeberSubmissionEndpointReference, if present.
 */
public Source toWSDLSource() {
    Element wsdlElement = null;

    for (Element elem : elements) {
        if (elem.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
                elem.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
            wsdlElement = elem;
        }
    }

    return new DOMSource(wsdlElement);
}
 
示例14
@Override
protected void handleAttribute(int i) throws XMLStreamException {
    QName name = in.getName();
    String attLocalName = in.getAttributeLocalName(i);

    if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_IMPORT_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_REDEFINE_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(WSDLConstants.QNAME_IMPORT)  && attLocalName.equals("location"))) {
        // patch this attribute value.

        String relPath = in.getAttributeValue(i);
        String actualPath = getPatchedImportLocation(relPath);
        if (actualPath == null) {
            return; // skip this attribute to leave it up to "implicit reference".
        }

        logger.fine("Fixing the relative location:"+relPath
                +" with absolute location:"+actualPath);
        writeAttribute(i, actualPath);
        return;
    }

    if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
        name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {

        if(attLocalName.equals("location")) {
            portAddress = in.getAttributeValue(i);
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Service:"+serviceName+ " port:"+portName
                        + " current address "+portAddress+" Patching it with "+value);
                writeAttribute(i, value);
                return;
            }
        }
    }

    super.handleAttribute(i);
}
 
示例15
private static void writeWsdl(StreamWriterBufferCreator writer, QName service, String wsdlAddress) throws XMLStreamException {
    // Inline-wsdl
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_DEFINITIONS.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeNamespace(WSDLConstants.PREFIX_NS_WSDL, WSDLConstants.NS_WSDL);
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_IMPORT.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeAttribute("namespace", service.getNamespaceURI());
    writer.writeAttribute("location", wsdlAddress);
    writer.writeEndElement();
    writer.writeEndElement();
}
 
示例16
/**
 * Constructs a Source containing the wsdl from the MemberSubmissionEndpointReference
 *
 * @return Source A source object containing the wsdl in the MemeberSubmissionEndpointReference, if present.
 */
public Source toWSDLSource() {
    Element wsdlElement = null;

    for (Element elem : elements) {
        if (elem.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
                elem.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
            wsdlElement = elem;
        }
    }

    return new DOMSource(wsdlElement);
}
 
示例17
@Override
protected void handleAttribute(int i) throws XMLStreamException {
    QName name = in.getName();
    String attLocalName = in.getAttributeLocalName(i);

    if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_IMPORT_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_REDEFINE_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(WSDLConstants.QNAME_IMPORT)  && attLocalName.equals("location"))) {
        // patch this attribute value.

        String relPath = in.getAttributeValue(i);
        String actualPath = getPatchedImportLocation(relPath);
        if (actualPath == null) {
            return; // skip this attribute to leave it up to "implicit reference".
        }

        logger.fine("Fixing the relative location:"+relPath
                +" with absolute location:"+actualPath);
        writeAttribute(i, actualPath);
        return;
    }

    if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
        name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {

        if(attLocalName.equals("location")) {
            portAddress = in.getAttributeValue(i);
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Service:"+serviceName+ " port:"+portName
                        + " current address "+portAddress+" Patching it with "+value);
                writeAttribute(i, value);
                return;
            }
        }
    }

    super.handleAttribute(i);
}
 
示例18
private static void writeWsdl(StreamWriterBufferCreator writer, QName service, String wsdlAddress) throws XMLStreamException {
    // Inline-wsdl
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_DEFINITIONS.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeNamespace(WSDLConstants.PREFIX_NS_WSDL, WSDLConstants.NS_WSDL);
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_IMPORT.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeAttribute("namespace", service.getNamespaceURI());
    writer.writeAttribute("location", wsdlAddress);
    writer.writeEndElement();
    writer.writeEndElement();
}
 
示例19
/**
 * Constructs a Source containing the wsdl from the MemberSubmissionEndpointReference
 *
 * @return Source A source object containing the wsdl in the MemeberSubmissionEndpointReference, if present.
 */
public Source toWSDLSource() {
    Element wsdlElement = null;

    for (Element elem : elements) {
        if (elem.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
                elem.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
            wsdlElement = elem;
        }
    }

    return new DOMSource(wsdlElement);
}
 
示例20
@Override
protected void handleAttribute(int i) throws XMLStreamException {
    QName name = in.getName();
    String attLocalName = in.getAttributeLocalName(i);

    if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_IMPORT_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_REDEFINE_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(WSDLConstants.QNAME_IMPORT)  && attLocalName.equals("location"))) {
        // patch this attribute value.

        String relPath = in.getAttributeValue(i);
        String actualPath = getPatchedImportLocation(relPath);
        if (actualPath == null) {
            return; // skip this attribute to leave it up to "implicit reference".
        }

        logger.fine("Fixing the relative location:"+relPath
                +" with absolute location:"+actualPath);
        writeAttribute(i, actualPath);
        return;
    }

    if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
        name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {

        if(attLocalName.equals("location")) {
            portAddress = in.getAttributeValue(i);
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Service:"+serviceName+ " port:"+portName
                        + " current address "+portAddress+" Patching it with "+value);
                writeAttribute(i, value);
                return;
            }
        }
    }

    super.handleAttribute(i);
}
 
示例21
private static void writeWsdl(StreamWriterBufferCreator writer, QName service, String wsdlAddress) throws XMLStreamException {
    // Inline-wsdl
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_DEFINITIONS.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeNamespace(WSDLConstants.PREFIX_NS_WSDL, WSDLConstants.NS_WSDL);
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_IMPORT.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeAttribute("namespace", service.getNamespaceURI());
    writer.writeAttribute("location", wsdlAddress);
    writer.writeEndElement();
    writer.writeEndElement();
}
 
示例22
/**
 * Constructs a Source containing the wsdl from the MemberSubmissionEndpointReference
 *
 * @return Source A source object containing the wsdl in the MemeberSubmissionEndpointReference, if present.
 */
public Source toWSDLSource() {
    Element wsdlElement = null;

    for (Element elem : elements) {
        if (elem.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
                elem.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
            wsdlElement = elem;
        }
    }

    return new DOMSource(wsdlElement);
}
 
示例23
@Override
protected void handleAttribute(int i) throws XMLStreamException {
    QName name = in.getName();
    String attLocalName = in.getAttributeLocalName(i);

    if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_IMPORT_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_REDEFINE_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(WSDLConstants.QNAME_IMPORT)  && attLocalName.equals("location"))) {
        // patch this attribute value.

        String relPath = in.getAttributeValue(i);
        String actualPath = getPatchedImportLocation(relPath);
        if (actualPath == null) {
            return; // skip this attribute to leave it up to "implicit reference".
        }

        logger.fine("Fixing the relative location:"+relPath
                +" with absolute location:"+actualPath);
        writeAttribute(i, actualPath);
        return;
    }

    if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
        name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {

        if(attLocalName.equals("location")) {
            portAddress = in.getAttributeValue(i);
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Service:"+serviceName+ " port:"+portName
                        + " current address "+portAddress+" Patching it with "+value);
                writeAttribute(i, value);
                return;
            }
        }
    }

    super.handleAttribute(i);
}
 
示例24
private static void writeWsdl(StreamWriterBufferCreator writer, QName service, String wsdlAddress) throws XMLStreamException {
    // Inline-wsdl
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_DEFINITIONS.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeNamespace(WSDLConstants.PREFIX_NS_WSDL, WSDLConstants.NS_WSDL);
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_IMPORT.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeAttribute("namespace", service.getNamespaceURI());
    writer.writeAttribute("location", wsdlAddress);
    writer.writeEndElement();
    writer.writeEndElement();
}
 
示例25
/**
 * Constructs a Source containing the wsdl from the MemberSubmissionEndpointReference
 *
 * @return Source A source object containing the wsdl in the MemeberSubmissionEndpointReference, if present.
 */
public Source toWSDLSource() {
    Element wsdlElement = null;

    for (Element elem : elements) {
        if (elem.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
                elem.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
            wsdlElement = elem;
        }
    }

    return new DOMSource(wsdlElement);
}
 
示例26
@Override
protected void handleAttribute(int i) throws XMLStreamException {
    QName name = in.getName();
    String attLocalName = in.getAttributeLocalName(i);

    if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_IMPORT_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_REDEFINE_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(WSDLConstants.QNAME_IMPORT)  && attLocalName.equals("location"))) {
        // patch this attribute value.

        String relPath = in.getAttributeValue(i);
        String actualPath = getPatchedImportLocation(relPath);
        if (actualPath == null) {
            return; // skip this attribute to leave it up to "implicit reference".
        }

        logger.fine("Fixing the relative location:"+relPath
                +" with absolute location:"+actualPath);
        writeAttribute(i, actualPath);
        return;
    }

    if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
        name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {

        if(attLocalName.equals("location")) {
            portAddress = in.getAttributeValue(i);
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Service:"+serviceName+ " port:"+portName
                        + " current address "+portAddress+" Patching it with "+value);
                writeAttribute(i, value);
                return;
            }
        }
    }

    super.handleAttribute(i);
}
 
示例27
private static void writeWsdl(StreamWriterBufferCreator writer, QName service, String wsdlAddress) throws XMLStreamException {
    // Inline-wsdl
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_DEFINITIONS.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeNamespace(WSDLConstants.PREFIX_NS_WSDL, WSDLConstants.NS_WSDL);
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_IMPORT.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeAttribute("namespace", service.getNamespaceURI());
    writer.writeAttribute("location", wsdlAddress);
    writer.writeEndElement();
    writer.writeEndElement();
}
 
示例28
/**
 * Constructs a Source containing the wsdl from the MemberSubmissionEndpointReference
 *
 * @return Source A source object containing the wsdl in the MemeberSubmissionEndpointReference, if present.
 */
public Source toWSDLSource() {
    Element wsdlElement = null;

    for (Element elem : elements) {
        if (elem.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
                elem.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
            wsdlElement = elem;
        }
    }

    return new DOMSource(wsdlElement);
}
 
示例29
@Override
protected void handleAttribute(int i) throws XMLStreamException {
    QName name = in.getName();
    String attLocalName = in.getAttributeLocalName(i);

    if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_IMPORT_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(SCHEMA_REDEFINE_QNAME)  && attLocalName.equals("schemaLocation"))
    || (name.equals(WSDLConstants.QNAME_IMPORT)  && attLocalName.equals("location"))) {
        // patch this attribute value.

        String relPath = in.getAttributeValue(i);
        String actualPath = getPatchedImportLocation(relPath);
        if (actualPath == null) {
            return; // skip this attribute to leave it up to "implicit reference".
        }

        logger.fine("Fixing the relative location:"+relPath
                +" with absolute location:"+actualPath);
        writeAttribute(i, actualPath);
        return;
    }

    if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
        name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {

        if(attLocalName.equals("location")) {
            portAddress = in.getAttributeValue(i);
            String value = getAddressLocation();
            if (value != null) {
                logger.fine("Service:"+serviceName+ " port:"+portName
                        + " current address "+portAddress+" Patching it with "+value);
                writeAttribute(i, value);
                return;
            }
        }
    }

    super.handleAttribute(i);
}
 
示例30
private static void writeWsdl(StreamWriterBufferCreator writer, QName service, String wsdlAddress) throws XMLStreamException {
    // Inline-wsdl
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_DEFINITIONS.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeNamespace(WSDLConstants.PREFIX_NS_WSDL, WSDLConstants.NS_WSDL);
    writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
            WSDLConstants.QNAME_IMPORT.getLocalPart(),
            WSDLConstants.NS_WSDL);
    writer.writeAttribute("namespace", service.getNamespaceURI());
    writer.writeAttribute("location", wsdlAddress);
    writer.writeEndElement();
    writer.writeEndElement();
}