28 appendChild( createProcessingInstruction(
"xml-stylesheet",
29 R
"(type="text/xsl" href="/xslt/service.xslt")" ));
35 QString sTargetNamespace = "http://mythtv.org";
37 m_oRoot = createElementNS(
"http://schemas.xmlsoap.org/wsdl/",
"definitions");
39 m_oRoot.setAttribute(
"targetNamespace", sTargetNamespace );
41 m_oRoot.setAttribute(
"xmlns:soap",
"http://schemas.xmlsoap.org/wsdl/soap/" );
42 m_oRoot.setAttribute(
"xmlns:xs" ,
"http://www.w3.org/2001/XMLSchema" );
43 m_oRoot.setAttribute(
"xmlns:soap",
"http://schemas.xmlsoap.org/wsdl/soap/" );
44 m_oRoot.setAttribute(
"xmlns:tns" , sTargetNamespace );
45 m_oRoot.setAttribute(
"xmlns:wsaw",
"http://www.w3.org/2006/05/addressing/wsdl" );
47 m_oRoot.setAttribute(
"name", QString(
"%1Services" ).arg( sClassName ) );
65 QDomElement oImportNode = createElement(
"xs:schema" );
66 oImportNode.setAttribute(
"targetNamespace" ,
"http://MythTV.org/Imports" );
72 oNode = createElement(
"xs:schema" );
73 oNode.setAttribute(
"targetNamespace" , sTargetNamespace );
74 oNode.setAttribute(
"elementFormDefault",
"qualified" );
83 m_oBindings.setAttribute(
"name", QString(
"BasicHttpBinding_%1").arg( sClassName ));
84 m_oBindings.setAttribute(
"type", QString(
"tns:%1" ).arg( sClassName ));
86 oNode = createElement(
"soap:binding" );
88 oNode.setAttribute(
"transport",
"http://schemas.xmlsoap.org/soap/http" );
104 QString sRequestTypeName = oInfo.
m_sName;
105 QString sResponseTypeName = oInfo.
m_sName +
"Response";
107 QString sInputMsgName = QString(
"%1_%2_InputMessage" )
110 QString sOutputMsgName = QString(
"%1_%2_OutputMessage" )
118 QDomElement oOp = createElement(
"operation" );
120 oOp.setAttribute(
"name", oInfo.
m_sName );
126 QString sDescription;
129 sDescription =
"POST ";
131 sDescription =
"GET ";
136 oNode = createElement(
"documentation" );
137 oNode.appendChild( createTextNode( sDescription ));
139 oOp.appendChild( oNode );
145 oNode = createElement(
"input" );
146 oNode.setAttribute(
"wsaw:Action", QString(
"%1/%2/%3" )
147 .arg( sTargetNamespace,
150 oNode.setAttribute(
"message" ,
"tns:" + sInputMsgName );
152 oOp.appendChild( oNode );
158 oNode = createElement(
"output" );
159 oNode.setAttribute(
"wsaw:Action", QString(
"%1/%2/%3Response" )
160 .arg( sTargetNamespace,
163 oNode.setAttribute(
"message",
"tns:" + sOutputMsgName );
165 oOp.appendChild( oNode );
173 QDomElement oMsg =
CreateMessage( sInputMsgName, sRequestTypeName );
210 QString sServiceName = QString(
"%1Services" ).arg( sClassName );
212 m_oService.setAttribute(
"name", sServiceName );
218 QString sDescription =
"Interface Version " +
225 oNode = createElement(
"documentation" );
226 oNode.appendChild( createTextNode( sDescription ));
234 QDomElement oPort = createElement(
"port" );
236 oPort.setAttribute(
"name" , QString(
"BasicHttpBinding_%1" ).arg( sClassName ));
237 oPort.setAttribute(
"binding", QString(
"tns:BasicHttpBinding_%1").arg( sClassName ));
239 oNode = createElement(
"soap:address" );
240 oNode.setAttribute(
"location",
"http://" +
244 oPort.appendChild( oNode );
261 QMap<QString, TypeInfo>::const_iterator it2 =
m_typesToInclude.constBegin();
264 QDomElement oIncNode = createElement(
"xs:import" );
265 QString sType = it2.key();
268 sType.remove(
"DTC::" );
270 QString sValue = QString(
"%1?%2=%3" ).arg( sBaseUri,
274 if (!
info.sContentType.isEmpty())
275 sValue +=
"&name=" +
info.sContentType;
277 oIncNode.setAttribute(
"schemaLocation", sValue );
278 oIncNode.setAttribute(
"namespace" ,
"http://mythtv.org" );
280 oImportNode.appendChild( oIncNode );
303 const QString &sClassName)
309 QDomElement oOp = createElement(
"operation" );
311 oOp.setAttribute(
"name", oInfo.
m_sName );
313 QDomElement oNode = createElement(
"soap:operation" );
314 oNode.setAttribute(
"soapAction", QString(
"http://mythtv.org/%1/%2" )
317 oNode.setAttribute(
"style" ,
"document" );
319 oOp.appendChild( oNode );
325 QDomElement oDirection = createElement(
"input" );
326 oNode = createElement(
"soap:body" );
327 oNode.setAttribute(
"use",
"literal" );
329 oDirection.appendChild( oNode );
330 oOp.appendChild( oDirection );
332 if (QString::compare( oInfo.
m_oMethod.typeName(),
"void", Qt::CaseInsensitive ) != 0)
336 oDirection = createElement(
"output" );
338 oNode = createElement(
"soap:body" );
339 oNode.setAttribute(
"use",
"literal" );
341 oDirection.appendChild( oNode );
342 oOp.appendChild( oDirection );
354 const QString& sTypeName )
356 QDomElement oMsg = createElement(
"message" );
358 oMsg.setAttribute(
"name", sMsgName );
360 QDomElement oNode = createElement(
"part" );
362 oNode.setAttribute(
"name" ,
"parameters" );
363 oNode.setAttribute(
"element",
"tns:" + sTypeName );
365 oMsg.appendChild( oNode );
378 QDomElement oElementNode = createElement(
"xs:element" );
380 oElementNode.setAttribute(
"name", sTypeName );
382 QDomElement oTypeNode = createElement(
"xs:complexType" );
383 QDomElement oSeqNode = createElement(
"xs:sequence" );
385 oElementNode.appendChild( oTypeNode );
386 oTypeNode .appendChild( oSeqNode );
394 QDomElement oNode = createElement(
"xs:element" );
396 QString sType = oInfo.
m_oMethod.typeName();
398 sTypeName.remove(
"Response" );
400 oNode.setAttribute(
"minOccurs", 0 );
401 oNode.setAttribute(
"name" , sTypeName +
"Result" );
402 oNode.setAttribute(
"nillable" ,
static_cast<int>(
true) );
408 QString sPrefix =
"xs:";
417 oNode.setAttribute(
"type", sPrefix + sType );
419 oSeqNode.appendChild( oNode );
423 QList<QByteArray> paramNames = oInfo.
m_oMethod.parameterNames();
424 QList<QByteArray> paramTypes = oInfo.
m_oMethod.parameterTypes();
426 for(
int nIdx = 0; nIdx < paramNames.length(); nIdx++ )
428 QString sName = paramNames[ nIdx ];
429 QString sParamType = paramTypes[ nIdx ];
435 QString sPrefix =
"xs:";
444 QDomElement oNode = createElement(
"xs:element" );
446 oNode.setAttribute(
"minOccurs", 0 );
447 oNode.setAttribute(
"name" , sName );
448 oNode.setAttribute(
"nillable" ,
static_cast<int>(
true) );
449 oNode.setAttribute(
"type" , sPrefix + sParamType );
451 oSeqNode.appendChild( oNode );
464 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
467 int id = QMetaType::fromName( sTypeName.toUtf8() ).id();
472 case QMetaType::QStringList:
473 case QMetaType::QVariantList:
474 case QMetaType::QVariantMap:
479 if (
id == qMetaTypeId<QFileInfo>())
484 return !(
id < QMetaType::User);
493 QString sCustomAttr =
"type";
498 if (sType.contains(
"::" ))
500 sType = sType.replace(
"::",
"." );
501 sCustomAttr =
"enum";
520 nIdx = pMeta->indexOfClassInfo( sKey.toUtf8() );
523 return pMeta->classInfo( nIdx ).value();