本文整理汇总了C++中KDSoapMessage::setMessageAddressingProperties方法的典型用法代码示例。如果您正苦于以下问题:C++ KDSoapMessage::setMessageAddressingProperties方法的具体用法?C++ KDSoapMessage::setMessageAddressingProperties怎么用?C++ KDSoapMessage::setMessageAddressingProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDSoapMessage
的用法示例。
在下文中一共展示了KDSoapMessage::setMessageAddressingProperties方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shouldWriteAProperSoapMessageWithRightsAddressingProperties
void shouldWriteAProperSoapMessageWithRightsAddressingProperties()
{
// GIVEN
HttpServerThread server(emptyResponse(), HttpServerThread::Public);
KDSoapClientInterface client(server.endPoint(), "http://www.ecerami.com/wsdl/HelloService");
KDSoapMessage message;
KDSoapMessageAddressingProperties map;
// with some message addressing properties
map.setAction("sayHello");
map.setDestination("http://www.ecerami.com/wsdl/HelloService");
map.setSourceEndpointAddress("http://www.ecerami.com/wsdl/source");
map.setFaultEndpoint(KDSoapEndpointReference("http://www.ecerami.com/wsdl/fault"));
map.setMessageID("uuid:e197db59-0982-4c9c-9702-4234d204f7f4");
map.setReplyEndpointAddress(KDSoapMessageAddressingProperties::predefinedAddressToString(KDSoapMessageAddressingProperties::Anonymous));
// two relationships related to previous message
KDSoapMessageRelationship::Relationship relationship("uuid:http://www.ecerami.com/wsdl/someUniqueString"); // no type means implicit Reply
KDSoapMessageRelationship::Relationship relationshipBis("uuid:http://www.ecerami.com/wsdl/someUniqueStringBis", "CustomTypeReply");
map.addRelationship(relationship);
map.addRelationship(relationshipBis);
// some reference parameters...
// one with a value
KDSoapValue refParam("myReferenceParameter", "ReferencParameterContent");
map.addReferenceParameter(refParam);
// an other one, with children
KDSoapValue childOne("myReferenceParameterChildOne", "ChildOneContent");
KDSoapValue childTwo("myReferenceParameterChildTwo", "ChildTwoContent");
KDSoapValueList childrenList;
childrenList << childOne << childTwo;
KDSoapValue refParamWithChildren("myReferenceParameterWithChildren", childrenList);
map.addReferenceParameter(refParamWithChildren);
// some metadata
KDSoapValueList metadataContainer;
KDSoapValue metadata("myMetadata", "MetadataContent");
metadataContainer << metadata;
KDSoapValue child("myMetadataBisChild", "MetadataBisChildContent");
KDSoapValueList childList; childList << child;
KDSoapValue metadataBis("myMetadataBis", childList);
map.setMetadata(metadataContainer);
map.addMetadata(metadataBis);
// and some request content
const QString action = QString::fromLatin1("sayHello");
message.setUse(KDSoapMessage::EncodedUse);
message.addArgument(QString::fromLatin1("msg"), QVariant::fromValue(QString("HelloContentMessage")), KDSoapNamespaceManager::xmlSchema2001(), QString::fromLatin1("string"));
message.setNamespaceUri(QString::fromLatin1("http://www.ecerami.com/wsdl/HelloService.wsdl"));
// WHEN
message.setMessageAddressingProperties(map);
KDSoapMessage reply = client.call(QLatin1String("sayHello"), message, action);
// THEN
QVERIFY(xmlBufferCompare(server.receivedData(), expectedSoapMessage()));
}