Search in sources :

Example 1 with ServiceNameType

use of org.apache.cxf.ws.addressing.v200408.ServiceNameType in project cxf by apache.

the class VersionTransformer method convertTo200403.

/**
 * Convert from 2005/08 EndpointReferenceType to 2004/03 EndpointReferenceType.
 *
 * @param internal the 2005/08 EndpointReferenceType
 * @return an equivalent 2004/03 EndpointReferenceType
 */
public static org.apache.cxf.ws.addressing.v200403.EndpointReferenceType convertTo200403(EndpointReferenceType internal) {
    org.apache.cxf.ws.addressing.v200403.EndpointReferenceType exposed = Names200403.WSA_OBJECT_FACTORY.createEndpointReferenceType();
    exposed.setAddress(convertTo200403(internal.getAddress()));
    QName serviceQName = EndpointReferenceUtils.getServiceName(internal, null);
    if (serviceQName != null) {
        org.apache.cxf.ws.addressing.v200403.ServiceNameType serviceName = Names200403.WSA_OBJECT_FACTORY.createServiceNameType();
        serviceName.setValue(serviceQName);
        exposed.setServiceName(serviceName);
    }
    String portLocalName = EndpointReferenceUtils.getPortName(internal);
    if (portLocalName != null && serviceQName != null) {
        String namespace = serviceQName.getNamespaceURI() != null ? serviceQName.getNamespaceURI() : Names.WSDL_INSTANCE_NAMESPACE_NAME;
        QName portQName = new QName(namespace, portLocalName);
        org.apache.cxf.ws.addressing.v200403.AttributedQName portType = Names200403.WSA_OBJECT_FACTORY.createAttributedQName();
        portType.setValue(portQName);
        exposed.setPortType(portType);
    }
    // no direct analogue for Metadata
    addAll(exposed.getAny(), internal.getAny());
    putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
    return exposed;
}
Also used : AttributedQName(org.apache.cxf.ws.addressing.v200408.AttributedQName) QName(javax.xml.namespace.QName)

Example 2 with ServiceNameType

use of org.apache.cxf.ws.addressing.v200408.ServiceNameType in project cxf by apache.

the class VersionTransformer method convert.

/**
 * Convert from 2004/08 EndpointReferenceType to 2005/08
 * EndpointReferenceType.
 *
 * @param exposed the 2004/08 EndpointReferenceType
 * @return an equivalent 2005/08 EndpointReferenceType
 */
public static EndpointReferenceType convert(org.apache.cxf.ws.addressing.v200408.EndpointReferenceType exposed) {
    EndpointReferenceType internal = ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType();
    internal.setAddress(convert(exposed.getAddress()));
    internal.setReferenceParameters(convert(exposed.getReferenceParameters()));
    ServiceNameType serviceName = exposed.getServiceName();
    AttributedQName portName = exposed.getPortType();
    if (serviceName != null && portName != null) {
        EndpointReferenceUtils.setServiceAndPortName(internal, serviceName.getValue(), portName.getValue().getLocalPart());
    }
    // no direct analogue for ReferenceProperties
    addAll(internal.getAny(), exposed.getAny());
    putAll(internal.getOtherAttributes(), exposed.getOtherAttributes());
    return internal;
}
Also used : ServiceNameType(org.apache.cxf.ws.addressing.v200408.ServiceNameType) AttributedQName(org.apache.cxf.ws.addressing.v200408.AttributedQName)

Example 3 with ServiceNameType

use of org.apache.cxf.ws.addressing.v200408.ServiceNameType in project cxf by apache.

the class VersionTransformer method convert.

/**
 * Convert from 2005/08 EndpointReferenceType to 2004/08
 * EndpointReferenceType.
 *
 * @param internal the 2005/08 EndpointReferenceType
 * @return an equivalent 2004/08 EndpointReferenceType
 */
public static org.apache.cxf.ws.addressing.v200408.EndpointReferenceType convert(EndpointReferenceType internal) {
    org.apache.cxf.ws.addressing.v200408.EndpointReferenceType exposed = Names200408.WSA_OBJECT_FACTORY.createEndpointReferenceType();
    exposed.setAddress(convert(internal.getAddress()));
    exposed.setReferenceParameters(convert(internal.getReferenceParameters()));
    QName serviceQName = EndpointReferenceUtils.getServiceName(internal, null);
    if (serviceQName != null) {
        ServiceNameType serviceName = Names200408.WSA_OBJECT_FACTORY.createServiceNameType();
        serviceName.setValue(serviceQName);
        exposed.setServiceName(serviceName);
    }
    String portLocalName = EndpointReferenceUtils.getPortName(internal);
    if (portLocalName != null && serviceQName != null) {
        String namespace = serviceQName.getNamespaceURI() != null ? serviceQName.getNamespaceURI() : Names.WSDL_INSTANCE_NAMESPACE_NAME;
        QName portQName = new QName(namespace, portLocalName);
        AttributedQName portType = Names200408.WSA_OBJECT_FACTORY.createAttributedQName();
        portType.setValue(portQName);
        exposed.setPortType(portType);
    }
    // no direct analogue for Metadata
    addAll(exposed.getAny(), internal.getAny());
    putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
    return exposed;
}
Also used : AttributedQName(org.apache.cxf.ws.addressing.v200408.AttributedQName) QName(javax.xml.namespace.QName) ServiceNameType(org.apache.cxf.ws.addressing.v200408.ServiceNameType) AttributedQName(org.apache.cxf.ws.addressing.v200408.AttributedQName)

Aggregations

AttributedQName (org.apache.cxf.ws.addressing.v200408.AttributedQName)3 QName (javax.xml.namespace.QName)2 ServiceNameType (org.apache.cxf.ws.addressing.v200408.ServiceNameType)2