Search in sources :

Example 76 with MessagePartInfo

use of org.apache.cxf.service.model.MessagePartInfo in project cxf by apache.

the class STSUtils method addCancelOperation.

private static OperationInfo addCancelOperation(InterfaceInfo ii, String namespace, String servNamespace) {
    OperationInfo oi = ii.addOperation(new QName(servNamespace, "CancelSecurityToken"));
    MessageInfo mii = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenMsg"), MessageInfo.Type.INPUT);
    oi.setInput("CancelSecurityTokenMsg", mii);
    MessagePartInfo mpi = mii.addMessagePart("request");
    mpi.setElementQName(new QName(namespace, "RequestSecurityToken"));
    MessageInfo mio = oi.createMessage(new QName(servNamespace, "CancelSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT);
    oi.setOutput("CancelSecurityTokenResponseMsg", mio);
    mpi = mio.addMessagePart("response");
    if (WST_NS_05_02.equals(namespace)) {
        mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse"));
    } else {
        mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection"));
    }
    return oi;
}
Also used : BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) SoapOperationInfo(org.apache.cxf.binding.soap.model.SoapOperationInfo) QName(javax.xml.namespace.QName) MessagePartInfo(org.apache.cxf.service.model.MessagePartInfo) MessageInfo(org.apache.cxf.service.model.MessageInfo)

Example 77 with MessagePartInfo

use of org.apache.cxf.service.model.MessagePartInfo in project cxf by apache.

the class STSUtils method addRenewOperation.

private static OperationInfo addRenewOperation(InterfaceInfo ii, String namespace, String servNamespace) {
    OperationInfo oi = ii.addOperation(new QName(servNamespace, "RenewSecurityToken"));
    MessageInfo mii = oi.createMessage(new QName(servNamespace, "RenewSecurityTokenMsg"), MessageInfo.Type.INPUT);
    oi.setInput("RenewSecurityTokenMsg", mii);
    MessagePartInfo mpi = mii.addMessagePart("request");
    mpi.setElementQName(new QName(namespace, "RequestSecurityToken"));
    MessageInfo mio = oi.createMessage(new QName(servNamespace, "RenewSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT);
    oi.setOutput("RenewSecurityTokenResponseMsg", mio);
    mpi = mio.addMessagePart("response");
    if (WST_NS_05_02.equals(namespace)) {
        mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse"));
    } else {
        mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection"));
    }
    return oi;
}
Also used : BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) SoapOperationInfo(org.apache.cxf.binding.soap.model.SoapOperationInfo) QName(javax.xml.namespace.QName) MessagePartInfo(org.apache.cxf.service.model.MessagePartInfo) MessageInfo(org.apache.cxf.service.model.MessageInfo)

Example 78 with MessagePartInfo

use of org.apache.cxf.service.model.MessagePartInfo in project cxf by apache.

the class STSUtils method addIssueOperation.

private static OperationInfo addIssueOperation(InterfaceInfo ii, String namespace, String servNamespace) {
    OperationInfo oi = ii.addOperation(new QName(servNamespace, "RequestSecurityToken"));
    MessageInfo mii = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenMsg"), MessageInfo.Type.INPUT);
    oi.setInput("RequestSecurityTokenMsg", mii);
    MessagePartInfo mpi = mii.addMessagePart("request");
    mpi.setElementQName(new QName(namespace, "RequestSecurityToken"));
    MessageInfo mio = oi.createMessage(new QName(servNamespace, "RequestSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT);
    oi.setOutput("RequestSecurityTokenResponseMsg", mio);
    mpi = mio.addMessagePart("response");
    if (WST_NS_05_02.equals(namespace)) {
        mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse"));
    } else {
        mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection"));
    }
    return oi;
}
Also used : BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) SoapOperationInfo(org.apache.cxf.binding.soap.model.SoapOperationInfo) QName(javax.xml.namespace.QName) MessagePartInfo(org.apache.cxf.service.model.MessagePartInfo) MessageInfo(org.apache.cxf.service.model.MessageInfo)

Example 79 with MessagePartInfo

use of org.apache.cxf.service.model.MessagePartInfo in project cxf by apache.

the class ReflectionServiceFactoryBean method setIndexes.

private void setIndexes(MessageInfo m) {
    int max = -1;
    for (MessagePartInfo mpi : m.getMessageParts()) {
        if (mpi.getIndex() > max && mpi.getIndex() != Integer.MAX_VALUE) {
            max = mpi.getIndex();
        }
    }
    for (MessagePartInfo mpi : m.getMessageParts()) {
        if (mpi.getIndex() == Integer.MAX_VALUE) {
            max++;
            mpi.setIndex(max);
        }
    }
}
Also used : MessagePartInfo(org.apache.cxf.service.model.MessagePartInfo) Endpoint(org.apache.cxf.endpoint.Endpoint)

Example 80 with MessagePartInfo

use of org.apache.cxf.service.model.MessagePartInfo in project cxf by apache.

the class ServiceWSDLBuilder method buildMessage.

protected void buildMessage(Message message, AbstractMessageContainer messageContainer, final Definition def) {
    addDocumentation(message, messageContainer.getMessageDocumentation());
    message.setQName(messageContainer.getName());
    message.setUndefined(false);
    def.addMessage(message);
    List<MessagePartInfo> messageParts = messageContainer.getMessageParts();
    Part messagePart = null;
    for (MessagePartInfo messagePartInfo : messageParts) {
        messagePart = def.createPart();
        messagePart.setName(messagePartInfo.getName().getLocalPart());
        if (messagePartInfo.isElement()) {
            messagePart.setElementName(messagePartInfo.getElementQName());
            addNamespace(messagePartInfo.getElementQName().getNamespaceURI(), def);
        } else if (messagePartInfo.getTypeQName() != null) {
            messagePart.setTypeName(messagePartInfo.getTypeQName());
            addNamespace(messagePartInfo.getTypeQName().getNamespaceURI(), def);
        }
        message.addPart(messagePart);
    }
}
Also used : Part(javax.wsdl.Part) MessagePartInfo(org.apache.cxf.service.model.MessagePartInfo)

Aggregations

MessagePartInfo (org.apache.cxf.service.model.MessagePartInfo)157 QName (javax.xml.namespace.QName)97 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)60 OperationInfo (org.apache.cxf.service.model.OperationInfo)44 Test (org.junit.Test)38 MessageInfo (org.apache.cxf.service.model.MessageInfo)36 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)27 Service (org.apache.cxf.service.Service)21 BindingMessageInfo (org.apache.cxf.service.model.BindingMessageInfo)21 Fault (org.apache.cxf.interceptor.Fault)20 BindingInfo (org.apache.cxf.service.model.BindingInfo)20 ArrayList (java.util.ArrayList)18 Endpoint (org.apache.cxf.endpoint.Endpoint)18 MessageContentsList (org.apache.cxf.message.MessageContentsList)18 SoapOperationInfo (org.apache.cxf.binding.soap.model.SoapOperationInfo)16 XMLStreamWriter (javax.xml.stream.XMLStreamWriter)15 XMLStreamReader (javax.xml.stream.XMLStreamReader)13 Exchange (org.apache.cxf.message.Exchange)13 XmlSchemaElement (org.apache.ws.commons.schema.XmlSchemaElement)12 FaultInfo (org.apache.cxf.service.model.FaultInfo)11