VirtualBox

source: vbox/trunk/src/VBox/Main/webservice/websrv-cpp.xsl@ 67414

Last change on this file since 67414 was 62486, checked in by vboxsync, 8 years ago

(C) 2016

  • Property svn:eol-style set to native
File size: 66.5 KB
Line 
1<?xml version="1.0"?>
2
3<!--
4 websrv-cpp.xsl:
5 XSLT stylesheet that generates methodmaps.cpp from
6 VirtualBox.xidl. This generated C++ code contains
7 all the service implementations that one would
8 normally have to implement manually to create a
9 web service; our generated code automatically maps
10 all SOAP calls into COM/XPCOM method calls.
11 See webservice/Makefile.kmk for an overview of all the things
12 generated for the webservice.
13
14 Copyright (C) 2007-2016 Oracle Corporation
15
16 This file is part of VirtualBox Open Source Edition (OSE), as
17 available from http://www.virtualbox.org. This file is free software;
18 you can redistribute it and/or modify it under the terms of the GNU
19 General Public License (GPL) as published by the Free Software
20 Foundation, in version 2 as it comes in the "COPYING" file of the
21 VirtualBox OSE distribution. VirtualBox OSE is distributed in the
22 hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
23-->
24
25<xsl:stylesheet
26 version="1.0"
27 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
28 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
29 xmlns:exsl="http://exslt.org/common"
30 extension-element-prefixes="exsl">
31
32 <xsl:output method="text"/>
33
34 <xsl:strip-space elements="*"/>
35
36<!-- - - - - - - - - - - - - - - - - - - - - - -
37 global XSLT variables
38 - - - - - - - - - - - - - - - - - - - - - - -->
39
40<xsl:variable name="G_xsltFilename" select="'websrv-cpp.xsl'" />
41
42<xsl:include href="../idl/typemap-shared.inc.xsl" />
43
44<!-- collect all interfaces with "wsmap='suppress'" in a global variable for
45 quick lookup -->
46<xsl:variable name="G_setSuppressedInterfaces"
47 select="//interface[@wsmap='suppress']" />
48
49<!-- - - - - - - - - - - - - - - - - - - - - - -
50 Keys for more efficiently looking up of types.
51 - - - - - - - - - - - - - - - - - - - - - - -->
52
53<xsl:key name="G_keyEnumsByName" match="//enum[@name]" use="@name"/>
54<xsl:key name="G_keyInterfacesByName" match="//interface[@name]" use="@name"/>
55
56<!-- - - - - - - - - - - - - - - - - - - - - - -
57 root match
58 - - - - - - - - - - - - - - - - - - - - - - -->
59
60<xsl:template match="/idl">
61 <xsl:text><![CDATA[
62/* DO NOT EDIT! This is a generated file.
63 * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
64 * Generator: src/VBox/Main/webservice/websrv-cpp.xsl
65 */
66
67// shared webservice header
68#include "vboxweb.h"
69
70// vbox headers
71#include <VBox/com/com.h>
72#include <VBox/com/array.h>
73#include <VBox/com/ErrorInfo.h>
74#include <VBox/com/errorprint.h>
75#include <VBox/VBoxAuth.h>
76
77#include <iprt/assert.h>
78#include <iprt/initterm.h>
79#include <iprt/stream.h>
80#include <iprt/string.h>
81
82// gSOAP headers (must come after vbox includes because it checks for conflicting defs)
83#include "soapH.h"
84
85// standard headers
86#include <map>
87#include <sstream>
88
89// shared strings for debug output
90const char *g_pcszCallingComMethod = " calling COM method %s\n";
91const char *g_pcszDoneCallingComMethod = " done calling COM method\n";
92const char *g_pcszConvertComOutputBack = " convert COM output \"%s\" back to caller format\n";
93const char *g_pcszDoneConvertingComOutputBack = " done converting COM output \"%s\" back to caller format\n";
94const char *g_pcszEntering = "-- entering %s\n";
95const char *g_pcszLeaving = "-- leaving %s, rc: %#lx (%d)\n";
96
97// generated string constants for all interface names
98const char *g_pcszIUnknown = "IUnknown";
99]]></xsl:text>
100
101 <xsl:for-each select="//interface">
102 <xsl:variable name="ifname" select="@name" />
103 <xsl:value-of select="concat('const char *g_pcsz', $ifname, ' = &quot;', $ifname, '&quot;;')" />
104 <xsl:call-template name="emitNewline" />
105 </xsl:for-each>
106 <xsl:apply-templates />
107</xsl:template>
108
109<!-- - - - - - - - - - - - - - - - - - - - - - -
110 if
111 - - - - - - - - - - - - - - - - - - - - - - -->
112
113<!--
114 * ignore all |if|s except those for WSDL target
115-->
116<xsl:template match="if">
117 <xsl:if test="@target='wsdl'">
118 <xsl:apply-templates/>
119 </xsl:if>
120</xsl:template>
121
122<!-- - - - - - - - - - - - - - - - - - - - - - -
123 cpp
124 - - - - - - - - - - - - - - - - - - - - - - -->
125
126<xsl:template match="cpp">
127<!-- ignore this -->
128</xsl:template>
129
130<!-- - - - - - - - - - - - - - - - - - - - - - -
131 library
132 - - - - - - - - - - - - - - - - - - - - - - -->
133
134<xsl:template match="library">
135 <xsl:text>
136/****************************************************************************
137 *
138 * types: enum converter helper functions
139 *
140 ****************************************************************************/
141 </xsl:text>
142 <!--
143 enum converter functions at top of file
144 -->
145 <xsl:for-each select="//enum">
146 <xsl:variable name="enumname" select="@name" />
147 <!-- generate enum converter for COM-to-SOAP -->
148 <xsl:call-template name="emitNewline" />
149 <xsl:value-of select="concat('vbox__', $enumname, ' ', $G_funcPrefixOutputEnumConverter, $enumname, '(', $enumname, '_T e)')" />
150 <xsl:call-template name="emitNewline" />
151 <xsl:text>{</xsl:text>
152 <xsl:call-template name="emitNewline" />
153 <xsl:value-of select="concat(' vbox__', $enumname, ' v;')" />
154 <xsl:call-template name="emitNewline" />
155 <xsl:call-template name="emitNewline" />
156 <xsl:text> switch(e)</xsl:text>
157 <xsl:call-template name="emitNewline" />
158 <xsl:text> {</xsl:text>
159 <xsl:call-template name="emitNewline" />
160 <xsl:for-each select="const[not(@wsmap='suppress')]">
161 <xsl:variable name="enumconst" select="@name" />
162 <xsl:value-of select="concat(' case ', $enumname, '_', $enumconst, ':')" />
163 <xsl:call-template name="emitNewlineIndent8" />
164 <xsl:value-of select="concat(' v = vbox__', $enumname, '__')" />
165 <!-- escape all "_" in $enumconst -->
166 <xsl:call-template name="escapeUnderscores">
167 <xsl:with-param name="string" select="$enumconst" />
168 </xsl:call-template>
169 <xsl:value-of select="';'" />
170 <xsl:call-template name="emitNewlineIndent8" />
171 <xsl:text>break;</xsl:text>
172 <xsl:call-template name="emitNewline" />
173 </xsl:for-each>
174 <!-- Add a default case so gcc gives us a rest, esp. on darwin. -->
175 <xsl:call-template name="emitNewlineIndent8" />
176 <xsl:text>default:</xsl:text>
177 <xsl:call-template name="emitNewlineIndent8" />
178 <xsl:text> AssertMsgFailed(("e=%d\n", (int)e));</xsl:text>
179 <xsl:call-template name="emitNewlineIndent8" />
180 <xsl:value-of select="concat(' v = (vbox__', $enumname, ')0x7fffdead;')" />
181 <xsl:call-template name="emitNewlineIndent8" />
182 <xsl:text>break; </xsl:text>
183 <xsl:call-template name="emitNewline" />
184 <xsl:text> }</xsl:text>
185 <xsl:call-template name="emitNewline" />
186 <xsl:call-template name="emitNewline" />
187 <xsl:text> return v;</xsl:text>
188 <xsl:call-template name="emitNewline" />
189 <xsl:text>}</xsl:text>
190 <xsl:call-template name="emitNewline" />
191 <!-- generate enum converter for SOAP-to-COM -->
192 <xsl:call-template name="emitNewline" />
193 <xsl:value-of select="concat($enumname, '_T ', $G_funcPrefixInputEnumConverter, $enumname, '(vbox__', $enumname, ' v)')" />
194 <xsl:call-template name="emitNewline" />
195 <xsl:text>{</xsl:text>
196 <xsl:call-template name="emitNewline" />
197 <xsl:value-of select="concat(' ', $enumname, '_T e;')" />
198 <xsl:call-template name="emitNewline" />
199 <xsl:call-template name="emitNewline" />
200 <xsl:text> switch(v)</xsl:text>
201 <xsl:call-template name="emitNewline" />
202 <xsl:text> {</xsl:text>
203 <xsl:call-template name="emitNewline" />
204 <xsl:for-each select="const[not(@wsmap='suppress')]">
205 <xsl:variable name="enumconst" select="@name" />
206 <xsl:value-of select="concat(' case vbox__', $enumname, '__')" />
207 <!-- escape all "_" in $enumconst -->
208 <xsl:call-template name="escapeUnderscores">
209 <xsl:with-param name="string" select="$enumconst" />
210 </xsl:call-template>
211 <xsl:value-of select="':'" />
212 <xsl:call-template name="emitNewlineIndent8" />
213 <xsl:value-of select="concat(' e = ', $enumname, '_', $enumconst, ';')" />
214 <xsl:call-template name="emitNewlineIndent8" />
215 <xsl:text>break;</xsl:text>
216 <xsl:call-template name="emitNewline" />
217 </xsl:for-each>
218 <!-- Insert a default case so gcc gives us a rest, esp. on darwin. -->
219 <xsl:call-template name="emitNewlineIndent8" />
220 <xsl:text>default:</xsl:text>
221 <xsl:call-template name="emitNewlineIndent8" />
222 <xsl:text> AssertMsgFailed(("v=%d\n", (int)v));</xsl:text>
223 <xsl:call-template name="emitNewlineIndent8" />
224 <xsl:value-of select="concat(' e = (', $enumname, '_T)0x7fffbeef;')" />
225 <xsl:call-template name="emitNewlineIndent8" />
226 <xsl:text>break; </xsl:text>
227 <xsl:call-template name="emitNewline" />
228 <xsl:text> }</xsl:text>
229 <xsl:call-template name="emitNewline" />
230 <xsl:call-template name="emitNewline" />
231 <xsl:text> return e;</xsl:text>
232 <xsl:call-template name="emitNewline" />
233 <xsl:text>}</xsl:text>
234 <xsl:call-template name="emitNewline" />
235 </xsl:for-each>
236
237 <xsl:text>
238/****************************************************************************
239 *
240 * types: struct converter helper functions
241 *
242 ****************************************************************************/
243 </xsl:text>
244
245 <xsl:for-each select="//interface[@wsmap='struct']">
246 <xsl:variable name="structname" select="@name" />
247
248 <xsl:call-template name="emitNewline" />
249 <xsl:value-of select="concat('// ', $structname, ' converter: called from method mappers to convert data from')" />
250 <xsl:call-template name="emitNewline" />
251 <xsl:value-of select="concat('// COM interface ', $structname, ', which has wsmap=&quot;struct&quot;, to SOAP structures')" />
252 <xsl:call-template name="emitNewline" />
253 <xsl:value-of select="concat('vbox__', $structname, '* ', $G_funcPrefixOutputStructConverter, $structname, '(')" />
254 <xsl:call-template name="emitNewline" />
255 <xsl:value-of select="' struct soap *soap,'" />
256 <xsl:call-template name="emitNewline" />
257 <xsl:value-of select="' const WSDLT_ID &amp;idThis,'" />
258 <xsl:call-template name="emitNewline" />
259 <xsl:value-of select="' HRESULT &amp;rc,'" />
260 <xsl:call-template name="emitNewline" />
261 <xsl:value-of select="concat(' ComPtr&lt;', $structname, '&gt; &amp;in)')" />
262 <xsl:call-template name="emitNewline" />
263 <xsl:text>{</xsl:text>
264 <xsl:call-template name="emitNewline" />
265
266 <xsl:value-of select="concat(' vbox__', $structname, ' *resp = NULL;')" />
267 <xsl:call-template name="emitNewline" />
268
269 <xsl:call-template name="emitPrologue"><xsl:with-param name="fSkipHRESULT" select="'1'"/></xsl:call-template>
270
271 <xsl:value-of select="concat(' resp = soap_new_vbox__', $structname, '(soap, -1);')" />
272 <xsl:call-template name="emitNewline" />
273 <xsl:text> if (!in)&#10;</xsl:text>
274 <xsl:text> {&#10;</xsl:text>
275 <xsl:text> // @todo ambiguous. Problem is the MOR for the object converted to struct&#10;</xsl:text>
276 <xsl:text> RaiseSoapInvalidObjectFault(soap, "");&#10;</xsl:text>
277 <xsl:text> break;&#10;</xsl:text>
278 <xsl:text> }&#10;</xsl:text>
279 <xsl:call-template name="emitNewline" />
280
281 <xsl:for-each select="key('G_keyInterfacesByName', $structname)/attribute">
282 <xsl:if test="not(@wsmap = 'suppress')">
283 <xsl:value-of select="concat(' // -- ', $structname, '.', @name)" />
284 <xsl:call-template name="emitNewline" />
285 <!-- recurse! -->
286 <xsl:call-template name="emitGetAttributeComCall">
287 <xsl:with-param name="ifname" select="$structname" />
288 <xsl:with-param name="object" select="'in'" />
289 <xsl:with-param name="attrname" select="@name" />
290 <xsl:with-param name="attrtype" select="@type" />
291 <xsl:with-param name="callerprefix" select="concat('out', '.')" />
292 </xsl:call-template>
293 <xsl:call-template name="emitNewline" />
294 </xsl:if>
295 </xsl:for-each>
296
297 <xsl:call-template name="emitEpilogue"><xsl:with-param name="fSkipHRESULT" select="'1'"/></xsl:call-template>
298
299 </xsl:for-each>
300
301 <xsl:apply-templates />
302</xsl:template>
303
304<!-- - - - - - - - - - - - - - - - - - - - - - -
305 class
306 - - - - - - - - - - - - - - - - - - - - - - -->
307
308<xsl:template match="module/class">
309<!-- TODO swallow for now -->
310</xsl:template>
311
312<!-- - - - - - - - - - - - - - - - - - - - - - -
313 enum
314 - - - - - - - - - - - - - - - - - - - - - - -->
315
316<xsl:template match="enum">
317</xsl:template>
318
319<!-- - - - - - - - - - - - - - - - - - - - - - -
320 const
321 - - - - - - - - - - - - - - - - - - - - - - -->
322
323<!--
324<xsl:template match="const">
325 <xsl:apply-templates />
326</xsl:template>
327-->
328
329<!-- - - - - - - - - - - - - - - - - - - - - - -
330 desc
331 - - - - - - - - - - - - - - - - - - - - - - -->
332
333<xsl:template match="desc">
334<!-- TODO swallow for now -->
335</xsl:template>
336
337<!-- - - - - - - - - - - - - - - - - - - - - - -
338 note
339 - - - - - - - - - - - - - - - - - - - - - - -->
340
341<xsl:template match="note">
342<!-- TODO -->
343 <xsl:apply-templates />
344</xsl:template>
345
346<!--
347 emitBeginOfFunctionHeader:
348-->
349
350<xsl:template name="emitBeginOfFunctionHeader">
351 <xsl:param name="ifname" />
352 <xsl:param name="method" />
353
354 <xsl:call-template name="emitNewline" />
355 <xsl:value-of select="concat('int __vbox__', $ifname, '_USCORE', $method, '(')" />
356 <xsl:call-template name="emitNewline" />
357 <xsl:text> struct soap *soap</xsl:text>
358</xsl:template>
359
360<!--
361 emitCppTypeForIDLType:
362 emits the C++ type that corresponds to the given WSDL type in $type.
363 -->
364<xsl:template name="emitCppTypeForIDLType">
365 <xsl:param name="method" />
366 <xsl:param name="type" />
367 <xsl:param name="safearray" />
368 <xsl:param name="varprefix" /> <!-- only with nested get-attribute calls -->
369 <xsl:param name="inptr" /> <!-- whether to add INPTR to BSTR (Dmitry template magic) -->
370
371 <!-- look up C++ glue type from IDL type from table array in typemap-shared.inc.xsl -->
372 <xsl:variable name="gluetypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename" />
373
374 <xsl:choose>
375 <xsl:when test="$type='wstring' or $type='uuid'">
376 <xsl:choose>
377 <xsl:when test="$safearray='yes'">
378 <xsl:choose>
379 <xsl:when test="$inptr='yes'">
380 <xsl:value-of select="'com::SafeArray&lt;IN_BSTR&gt;'" /> <!-- input string arrays must use IN_BSTR (see com/array.h) -->
381 </xsl:when>
382 <xsl:otherwise>
383 <xsl:value-of select="'com::SafeArray&lt;BSTR&gt;'" /> <!-- output string arrays use raw BSTR -->
384 </xsl:otherwise>
385 </xsl:choose>
386 </xsl:when>
387 <xsl:otherwise>
388 <xsl:value-of select="'com::Bstr'" />
389 </xsl:otherwise>
390 </xsl:choose>
391 </xsl:when>
392 <!-- if above lookup in table succeeded, use that type -->
393 <xsl:when test="string-length($gluetypefield)">
394 <xsl:call-template name="emitTypeOrArray">
395 <xsl:with-param name="type" select="$gluetypefield"/>
396 <xsl:with-param name="safearray" select="$safearray"/>
397 </xsl:call-template>
398 </xsl:when>
399 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0">
400 <xsl:call-template name="emitTypeOrArray">
401 <xsl:with-param name="type" select="concat($type, '_T ')"/>
402 <xsl:with-param name="safearray" select="$safearray"/>
403 </xsl:call-template>
404 </xsl:when>
405 <xsl:when test="$type='$unknown'">
406 <xsl:choose>
407 <xsl:when test="$safearray='yes'">
408 <xsl:value-of select="'com::SafeIfaceArray&lt;IUnknown&gt;'" />
409 </xsl:when>
410 <xsl:otherwise>
411 <xsl:value-of select="'ComPtr&lt;IUnknown&gt;'" />
412 </xsl:otherwise>
413 </xsl:choose>
414 </xsl:when>
415 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0">
416 <xsl:variable name="thatif" select="key('G_keyInterfacesByName', $type)" />
417 <xsl:variable name="thatifname" select="$thatif/@name" />
418 <xsl:choose>
419 <xsl:when test="$safearray='yes'">
420 <xsl:value-of select="concat('com::SafeIfaceArray&lt;', $thatifname, '&gt;')" />
421 </xsl:when>
422 <xsl:otherwise>
423 <xsl:value-of select="concat('ComPtr&lt;', $thatifname, '&gt;')" />
424 </xsl:otherwise>
425 </xsl:choose>
426 </xsl:when>
427 <xsl:otherwise>
428 <xsl:call-template name="fatalError">
429 <xsl:with-param name="msg" select="concat('emitCppTypeForIDLType: Type &quot;', $type, '&quot; in method &quot;', $method, '&quot; is not supported.')" />
430 </xsl:call-template>
431 </xsl:otherwise>
432 </xsl:choose>
433</xsl:template>
434
435
436<!--
437 emitDocumentStyleArgStructs:
438 with WSDL "document" style only, emits those lengthy structs for
439 the input and output argument in the function header.
440-->
441<xsl:template name="emitDocumentStyleArgStructs">
442 <xsl:param name="ifname" />
443 <xsl:param name="methodname" />
444 <xsl:param name="fOutputs" /> <!-- if 1, emit output struct as well -->
445
446 <xsl:text>,</xsl:text>
447 <xsl:call-template name="emitNewline" />
448 <xsl:value-of select="concat(' _vbox__', $ifname, '_USCORE', $methodname, $G_requestMessageElementSuffix, ' *', $G_requestElementVarName)" />
449 <xsl:if test="$fOutputs">
450 <xsl:text>,</xsl:text>
451 <xsl:call-template name="emitNewline" />
452 <xsl:value-of select="concat(' _vbox__', $ifname, '_USCORE', $methodname, $G_responseMessageElementSuffix, ' *', $G_responseElementVarName)" />
453 <!-- <xsl:value-of select="concat(' struct ', $ifname, '__', $methodname, 'Response &amp;', $G_result)" /> -->
454 </xsl:if>
455
456</xsl:template>
457
458<!--
459 emitPrologue:
460 emits the closing ")" for the parameter list and the beginning
461 of the function body.
462 -->
463<xsl:template name="emitPrologue">
464 <xsl:text> WEBDEBUG((g_pcszEntering, __FUNCTION__));
465
466 do {</xsl:text>
467 <xsl:call-template name="emitNewline" />
468</xsl:template>
469
470<!--
471 emitEpilogue
472 -->
473<xsl:template name="emitEpilogue">
474 <xsl:param name="fSkipHRESULT" />
475
476 <xsl:text> } while (0);</xsl:text>
477 <xsl:call-template name="emitNewline" />
478 <xsl:call-template name="emitNewline" />
479 <xsl:text> WEBDEBUG((g_pcszLeaving, __FUNCTION__, rc, rc));</xsl:text>
480 <xsl:call-template name="emitNewline" />
481 <xsl:if test="not($fSkipHRESULT)">
482 <xsl:text>
483 if (FAILED(rc))
484 return SOAP_FAULT;
485 return SOAP_OK;</xsl:text>
486 </xsl:if>
487 <xsl:if test="$fSkipHRESULT">
488 <xsl:text> return resp;</xsl:text>
489 </xsl:if>
490 <xsl:call-template name="emitNewline" />
491 <xsl:text>}</xsl:text>
492 <xsl:call-template name="emitNewline" />
493</xsl:template>
494
495<!--
496 emitObjForMethod:
497 after the function prologue, emit a "pObj" object that
498 specifies the object upon which the method should be invoked.
499-->
500<xsl:template name="emitObjForMethod">
501 <xsl:param name="ifname" />
502 <xsl:param name="wsmap" />
503 <xsl:param name="structprefix" /> <!-- with WSDL document style: req element prefix, like "vbox__IVirtualBox_USCOREcreateMachineRequestElement->" -->
504
505 <xsl:choose>
506 <xsl:when test="$wsmap='global'">
507 <xsl:choose>
508 <xsl:when test="$ifname='IVirtualBox'">
509 <xsl:text> // invoke method on global IVirtualBox instance</xsl:text>
510 <xsl:call-template name="emitNewlineIndent8" />
511 <xsl:text>ComPtr&lt;IVirtualBox&gt; pObj = G_pVirtualBox;</xsl:text>
512 <xsl:call-template name="emitNewline" />
513 </xsl:when>
514 <xsl:otherwise>
515 <xsl:call-template name="fatalError">
516 <xsl:with-param name="msg" select="concat('emitObjForMethod: Unknown interface &quot;', $ifname, '&quot; with wsmap=global in XIDL.')" />
517 </xsl:call-template>
518 </xsl:otherwise>
519 </xsl:choose>
520 </xsl:when>
521 <xsl:when test="($wsmap='managed')">
522 <xsl:text> // look up managed object reference for method call&#10;</xsl:text>
523 <xsl:value-of select="concat(' ComPtr&lt;', $ifname, '&gt; pObj;&#10;')" />
524 <xsl:value-of select="concat(' if (!', $G_requestElementVarName, ')&#10;')" />
525 <xsl:text> {&#10;</xsl:text>
526 <xsl:text> RaiseSoapInvalidObjectFault(soap, "");&#10;</xsl:text>
527 <xsl:text> break;&#10;</xsl:text>
528 <xsl:text> }&#10;</xsl:text>
529 <xsl:value-of select="concat(' const WSDLT_ID &amp;idThis = ', $structprefix, $G_nameObjectRefEncoded, ';&#10;')" />
530 <xsl:value-of select="' if ((rc = findComPtrFromId(soap, idThis, pObj, false)))&#10;'" />
531 <xsl:text> break;&#10;</xsl:text>
532 </xsl:when>
533 </xsl:choose>
534</xsl:template>
535
536<!--
537 emitInputArgConverter:
538 another type converter (from wsdl type to COM types),
539 that generates temporary variables on the stack with
540 the WSDL input parameters converted to the COM types,
541 so we can then pass them to the actual COM method call.
542-->
543<xsl:template name="emitInputArgConverter">
544 <xsl:param name="ifname" />
545 <xsl:param name="object" /> <!-- normally "pObj" -->
546 <xsl:param name="method" />
547 <xsl:param name="methodname" />
548 <xsl:param name="structprefix" /> <!-- with WSDL document style: req element prefix, like "vbox__IVirtualBox_USCOREcreateMachineRequestElement->" -->
549 <xsl:param name="name" />
550 <xsl:param name="type" />
551 <xsl:param name="safearray" />
552
553 <xsl:value-of select="concat(' // convert input arg ', $name, '(safearray: ', $safearray, ')')" />
554 <xsl:call-template name="emitNewlineIndent8" />
555
556 <xsl:choose>
557 <xsl:when test="$safearray='yes' and $type='octet'">
558 <xsl:value-of select="concat('com::SafeArray&lt;BYTE&gt; comcall_',$name, ';')" />
559 <xsl:call-template name="emitNewlineIndent8" />
560 <xsl:value-of select="concat('Base64DecodeByteArray(soap, ',$structprefix,$name,', ComSafeArrayAsOutParam(comcall_',$name, '), idThis, &quot;', $ifname, '::', $methodname, '&quot;, ', $object, ', COM_IIDOF(', $ifname, '));')" />
561 </xsl:when>
562
563 <xsl:when test="$safearray='yes'">
564 <xsl:value-of select="concat('size_t c', $name, ' = ', $structprefix, $name, '.size();')" />
565 <xsl:call-template name="emitNewlineIndent8" />
566 <xsl:call-template name="emitCppTypeForIDLType">
567 <xsl:with-param name="method" select="$method"/>
568 <xsl:with-param name="type" select="$type"/>
569 <xsl:with-param name="safearray" select="$safearray"/>
570 <xsl:with-param name="inptr" select="'yes'"/>
571 </xsl:call-template>
572 <xsl:value-of select="concat(' comcall_', $name, '(c', $name, ');')" />
573 <xsl:call-template name="emitNewlineIndent8" />
574 <xsl:value-of select="concat('for (size_t i = 0; i &lt; c', $name, '; ++i)')" />
575 <xsl:call-template name="emitNewlineIndent8" />
576 <xsl:value-of select="'{'" />
577 <xsl:call-template name="emitNewlineIndent8" />
578 <xsl:choose>
579 <xsl:when test="$type='$unknown'">
580 <xsl:value-of select="' ComPtr&lt;IUnknown&gt; tmpObject;'" />
581 <xsl:call-template name="emitNewlineIndent8" />
582 <xsl:value-of select="concat(' if ((rc = findComPtrFromId(soap, ', $structprefix, $name, '[i], tmpObject, true)))')" />
583 <xsl:call-template name="emitNewlineIndent8" />
584 <xsl:text> break;</xsl:text>
585 <xsl:call-template name="emitNewlineIndent8" />
586 <xsl:value-of select="concat(' IUnknown *tmpObject2(tmpObject); tmpObject2->AddRef(); comcall_', $name, '[i] = tmpObject;')" />
587 </xsl:when>
588 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0">
589 <xsl:value-of select="concat(' ComPtr&lt;', $type, '&gt; tmpObject;')" />
590 <xsl:call-template name="emitNewlineIndent8" />
591 <xsl:value-of select="concat(' if ((rc = findComPtrFromId(soap, ', $structprefix, $name, '[i], tmpObject, true)))')" />
592 <xsl:call-template name="emitNewlineIndent8" />
593 <xsl:text> break;</xsl:text>
594 <xsl:call-template name="emitNewlineIndent8" />
595 <xsl:value-of select="concat(' ', $type, ' *tmpObject2(tmpObject); tmpObject2->AddRef(); comcall_', $name, '[i] = tmpObject;')" />
596 </xsl:when>
597 <xsl:when test="$type='wstring'">
598 <xsl:value-of select="concat(' com::Bstr tmpObject(', $structprefix, $name, '[i].c_str());')" />
599 <xsl:call-template name="emitNewlineIndent8" />
600 <xsl:value-of select="' BSTR tmpObjectB;'" />
601 <xsl:call-template name="emitNewlineIndent8" />
602 <xsl:value-of select="' tmpObject.detachTo(&amp;tmpObjectB);'" />
603 <xsl:call-template name="emitNewlineIndent8" />
604 <xsl:value-of select="concat(' comcall_', $name, '[i] = tmpObjectB;')" />
605 </xsl:when>
606 <xsl:when test="$type='long'">
607 <xsl:call-template name="emitNewlineIndent8" />
608 <xsl:value-of select="concat(' comcall_', $name, '[i] = ', $structprefix, $name, '[i];')" />
609 </xsl:when>
610 <xsl:when test="$type='long long'">
611 <xsl:call-template name="emitNewlineIndent8" />
612 <xsl:value-of select="concat(' comcall_', $name, '[i] = ', $structprefix, $name, '[i];')" />
613 </xsl:when>
614 <xsl:when test="$type='boolean'">
615 <xsl:call-template name="emitNewlineIndent8" />
616 <xsl:value-of select="concat(' comcall_', $name, '[i] = ', $structprefix, $name, '[i];')" />
617 </xsl:when>
618 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0">
619 <xsl:call-template name="emitNewlineIndent8" />
620 <xsl:value-of select="concat(' comcall_', $name, '[i] = ', $G_funcPrefixInputEnumConverter, $type, '(', $structprefix, $name, '[i]);')" />
621 </xsl:when>
622 <xsl:otherwise>
623 <xsl:call-template name="fatalError">
624 <xsl:with-param name="msg" select="concat('emitInputArgConverter Type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $method, '&quot; is not yet supported in safearrays.')" />
625 </xsl:call-template>
626 </xsl:otherwise>
627 </xsl:choose>
628 <xsl:call-template name="emitNewlineIndent8" />
629 <xsl:value-of select="'}'" />
630 <xsl:call-template name="emitNewline" />
631 </xsl:when>
632 <xsl:otherwise>
633 <xsl:call-template name="emitCppTypeForIDLType">
634 <xsl:with-param name="method" select="$method"/>
635 <xsl:with-param name="type" select="$type"/>
636 <xsl:with-param name="safearray" select="$safearray"/>
637 <xsl:with-param name="inptr" select="'yes'"/>
638 </xsl:call-template>
639 <xsl:choose>
640 <xsl:when test="$type='wstring' or $type='uuid'">
641 <xsl:value-of select="concat(' comcall_', $name, '(', $structprefix, $name, '.c_str())')" />
642 </xsl:when>
643 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0">
644 <xsl:value-of select="concat(' comcall_', $name, ' = ', $G_funcPrefixInputEnumConverter, $type, '(', $structprefix, $name, ')')" />
645 </xsl:when>
646 <xsl:when test="$type='$unknown'">
647 <xsl:value-of select="concat(' comcall_', $name, ';')" />
648 <xsl:call-template name="emitNewlineIndent8" />
649 <xsl:value-of select="concat('if ((rc = findComPtrFromId(soap, ', $structprefix, $name, ', comcall_', $name,', true)))')" />
650 <xsl:call-template name="emitNewlineIndent8" />
651 <xsl:text> break</xsl:text>
652 </xsl:when>
653 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0">
654 <!-- the type is one of our own interfaces: then it must have a wsmap attr -->
655 <xsl:variable name="thatif" select="key('G_keyInterfacesByName', $type)" />
656 <xsl:variable name="wsmap" select="$thatif/@wsmap" />
657 <xsl:variable name="thatifname" select="$thatif/@name" />
658 <xsl:choose>
659 <xsl:when test="not($wsmap)">
660 <xsl:call-template name="fatalError">
661 <xsl:with-param name="msg" select="concat('emitInputArgConverter: Type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $method, '&quot; lacks wsmap attribute in XIDL.')" />
662 </xsl:call-template>
663 </xsl:when>
664 <xsl:when test="($wsmap='managed')">
665 <xsl:value-of select="concat(' comcall_', $name, ';')" />
666 <xsl:call-template name="emitNewlineIndent8" />
667 <xsl:value-of select="concat('if ((rc = findComPtrFromId(soap, ', $structprefix, $name, ', comcall_', $name,', true)))')" />
668 <xsl:call-template name="emitNewlineIndent8" />
669 <xsl:text> break</xsl:text>
670 </xsl:when>
671 <xsl:otherwise>
672 <xsl:call-template name="fatalError">
673 <xsl:with-param name="msg" select="concat('emitInputArgConverter: Type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $method, '&quot; has unsupported wsmap attribute value &quot;', $wsmap, '&quot; in XIDL.')" />
674 </xsl:call-template>
675 </xsl:otherwise>
676 </xsl:choose>
677 </xsl:when>
678 <xsl:otherwise>
679 <xsl:value-of select="concat(' comcall_', $name, ' = ', $structprefix, $name)" />
680 </xsl:otherwise>
681 </xsl:choose>
682 <xsl:text>;
683</xsl:text>
684 </xsl:otherwise>
685 </xsl:choose>
686
687</xsl:template>
688
689<!--
690 emitTypeOrArray
691-->
692
693<xsl:template name="emitTypeOrArray">
694 <xsl:param name="type" />
695 <xsl:param name="safearray" />
696
697 <xsl:choose>
698 <xsl:when test="$safearray='yes'">
699 <xsl:value-of select="concat('com::SafeArray&lt;', $type, '&gt;')" />
700 </xsl:when>
701 <xsl:otherwise>
702 <xsl:value-of select="$type" />
703 </xsl:otherwise>
704 </xsl:choose>
705</xsl:template>
706
707<!--
708 emitOutputArgBuffer:
709 another type converter (from wsdl type to COM types)
710 that generates a buffer variable which receives the
711 data from 'out' and 'return' parameters of the COM method call.
712-->
713<xsl:template name="emitOutputArgBuffer">
714 <xsl:param name="method" />
715 <xsl:param name="name" />
716 <xsl:param name="type" />
717 <xsl:param name="safearray" />
718 <xsl:param name="varprefix" /> <!-- only with nested get-attribute calls -->
719
720 <xsl:text> // com output arg for </xsl:text><xsl:value-of select="concat($name, ' (safearray: ', $safearray, ')')" /><xsl:text>
721 </xsl:text>
722 <xsl:call-template name="emitCppTypeForIDLType">
723 <xsl:with-param name="method" select="$method" />
724 <xsl:with-param name="type" select="$type" />
725 <xsl:with-param name="safearray" select="$safearray" />
726 </xsl:call-template>
727 <xsl:value-of select="concat(' comcall_', $varprefix, $name, ';')" />
728 <xsl:call-template name="emitNewline" />
729</xsl:template>
730
731<!--
732 emitInParam:
733-->
734<xsl:template name="emitInParam">
735 <xsl:param name="name" />
736 <xsl:param name="type" />
737 <xsl:param name="safearray" />
738 <xsl:param name="varprefix" /> <!-- only with nested set-attribute calls -->
739
740 <xsl:variable name="varname" select="concat('comcall_', $varprefix, $name)" />
741
742 <xsl:choose>
743 <xsl:when test="@safearray='yes'">
744 <xsl:value-of select="concat('ComSafeArrayAsInParam(', $varname, ')')" />
745 </xsl:when>
746 <xsl:otherwise>
747 <xsl:value-of select="$varname" />
748 <xsl:if test="@type='wstring' or @type='uuid'">
749 <xsl:text>.raw()</xsl:text>
750 </xsl:if>
751 </xsl:otherwise>
752 </xsl:choose>
753</xsl:template>
754
755<!--
756 emitOutParam:
757-->
758<xsl:template name="emitOutParam">
759 <xsl:param name="name" />
760 <xsl:param name="type" />
761 <xsl:param name="safearray" />
762 <xsl:param name="varprefix" /> <!-- only with nested get-attribute calls -->
763
764 <xsl:variable name="varname" select="concat('comcall_', $varprefix, $name)" />
765
766 <xsl:choose>
767 <xsl:when test="$safearray='yes'">
768 <xsl:value-of select="concat('ComSafeArrayAsOutParam(', $varname, ')')" />
769 </xsl:when>
770 <xsl:otherwise>
771 <xsl:choose>
772 <xsl:when test=" ($type='boolean')
773 or ($type='short')
774 or ($type='unsigned short')
775 or ($type='long')
776 or ($type='unsigned long')
777 or ($type='long long')
778 or ($type='unsigned long long')
779 or ($type='result')
780 or (count(key('G_keyEnumsByName', $type)) > 0)">
781 <xsl:text>&amp;</xsl:text><xsl:value-of select="$varname" />
782 </xsl:when>
783 <xsl:otherwise>
784 <xsl:value-of select="$varname" /><xsl:text>.asOutParam()</xsl:text>
785 </xsl:otherwise>
786 </xsl:choose>
787 </xsl:otherwise>
788 </xsl:choose>
789</xsl:template>
790
791<!--
792 emitComCall:
793 emits the actual method call with the arguments.
794-->
795<xsl:template name="emitComCall">
796 <xsl:param name="ifname" />
797 <xsl:param name="object" /> <!-- normally "pObj" -->
798 <xsl:param name="methodname" />
799 <xsl:param name="attrname" /> <!-- with attributes only -->
800 <xsl:param name="attrtype" /> <!-- with attributes only -->
801 <xsl:param name="attrsafearray" /> <!-- with attributes only -->
802 <xsl:param name="attrdir" /> <!-- with attributes only: "in" or "return" -->
803 <xsl:param name="varprefix" /> <!-- only with nested get-attribute calls -->
804
805 <xsl:call-template name="emitNewlineIndent8" />
806 <xsl:value-of select="concat('WEBDEBUG((g_pcszCallingComMethod, &quot;', $methodname, '&quot;));')" />
807 <xsl:call-template name="emitNewlineIndent8" />
808 <xsl:value-of select="concat('rc = ', $object, '-&gt;', $methodname, '(')" />
809 <xsl:if test="$attrtype">
810 <xsl:choose>
811 <xsl:when test="$attrdir='in'">
812 <xsl:call-template name="emitInParam">
813 <xsl:with-param name="name" select="$attrname" />
814 <xsl:with-param name="type" select="$attrtype" />
815 <xsl:with-param name="safearray" select="$attrsafearray" />
816 <xsl:with-param name="varprefix" select="$varprefix" />
817 </xsl:call-template>
818 </xsl:when>
819 <xsl:when test="$attrdir='return'">
820 <xsl:call-template name="emitOutParam">
821 <xsl:with-param name="name" select="$attrname" />
822 <xsl:with-param name="type" select="$attrtype" />
823 <xsl:with-param name="safearray" select="$attrsafearray" />
824 <xsl:with-param name="varprefix" select="$varprefix" />
825 </xsl:call-template>
826 </xsl:when>
827 </xsl:choose>
828 </xsl:if>
829 <xsl:for-each select="param">
830 <xsl:if test="position()=1">
831 <xsl:call-template name="emitNewline" />
832 </xsl:if>
833 <xsl:if test="position() > 1">
834 <xsl:text>,</xsl:text>
835 <xsl:call-template name="emitNewline" />
836 </xsl:if>
837 <xsl:text> </xsl:text>
838 <xsl:choose>
839 <xsl:when test="@dir='in'">
840 <xsl:call-template name="emitInParam">
841 <xsl:with-param name="name" select="@name" />
842 <xsl:with-param name="type" select="@type" />
843 <xsl:with-param name="safearray" select="@safearray" />
844 <xsl:with-param name="varprefix" select="$varprefix" />
845 </xsl:call-template>
846 </xsl:when>
847 <xsl:when test="@dir='out'">
848 <xsl:call-template name="emitOutParam">
849 <xsl:with-param name="name" select="@name" />
850 <xsl:with-param name="type" select="@type" />
851 <xsl:with-param name="safearray" select="@safearray" />
852 <xsl:with-param name="varprefix" select="$varprefix" />
853 </xsl:call-template>
854 </xsl:when>
855 <xsl:when test="@dir='return'">
856 <xsl:call-template name="emitOutParam">
857 <xsl:with-param name="name" select="$G_result" />
858 <xsl:with-param name="type" select="@type" />
859 <xsl:with-param name="safearray" select="@safearray" />
860 <xsl:with-param name="varprefix" select="$varprefix" />
861 </xsl:call-template>
862 </xsl:when>
863 </xsl:choose>
864 </xsl:for-each>
865 <xsl:text>);</xsl:text>
866 <xsl:call-template name="emitNewlineIndent8" />
867 <xsl:text>if (FAILED(rc))</xsl:text>
868 <xsl:call-template name="emitNewlineIndent8" />
869 <xsl:text>{</xsl:text>
870 <xsl:call-template name="emitNewlineIndent8" />
871 <xsl:value-of select="concat(' RaiseSoapRuntimeFault(soap, idThis, &quot;', $ifname, '::', $methodname,'&quot;, rc, ', $object, ', COM_IIDOF(', $ifname, '));')" />
872 <xsl:call-template name="emitNewlineIndent8" />
873 <xsl:text> break;</xsl:text>
874 <xsl:call-template name="emitNewlineIndent8" />
875 <xsl:text>}</xsl:text>
876 <xsl:call-template name="emitNewlineIndent8" />
877 <xsl:text>WEBDEBUG((g_pcszDoneCallingComMethod));</xsl:text>
878 <xsl:call-template name="emitNewline" />
879</xsl:template>
880
881<!--
882 emitOutputArgBackConverter2: implementation details of emitOutputArgBackConverter.
883 -->
884
885<xsl:template name="emitOutputArgBackConverter2">
886 <xsl:param name="name" />
887 <xsl:param name="varname" />
888 <xsl:param name="type" />
889 <xsl:param name="callerprefix" />
890
891 <xsl:choose>
892 <xsl:when test="$type='wstring' or $type='uuid'">
893 <xsl:value-of select="concat('ConvertComString(', $varname, ')')" />
894 </xsl:when>
895 <xsl:when test="$type='boolean'">
896 <!-- the "!!" avoids a microsoft compiler warning -->
897 <xsl:value-of select="concat('!!', $varname)" />
898 </xsl:when>
899 <xsl:when test=" ($type='octet')
900 or ($type='short')
901 or ($type='unsigned short')
902 or ($type='long')
903 or ($type='unsigned long')
904 or ($type='long long')
905 or ($type='unsigned long long')
906 or ($type='result')">
907 <xsl:value-of select="$varname" />
908 </xsl:when>
909 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0">
910 <xsl:value-of select="concat($G_funcPrefixOutputEnumConverter, $type, '(', $varname, ')')" />
911 </xsl:when>
912 <xsl:when test="$type='$unknown'">
913 <xsl:value-of select="concat('createOrFindRefFromComPtr(idThis, g_pcszIUnknown, ', $varname, ')')" />
914 </xsl:when>
915 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0">
916 <!-- the type is one of our own interfaces: then it must have a wsmap attr -->
917 <xsl:variable name="thatif" select="key('G_keyInterfacesByName', $type)" />
918 <xsl:variable name="wsmap" select="$thatif/@wsmap" />
919 <xsl:variable name="thatifname" select="$thatif/@name" />
920 <xsl:choose>
921 <xsl:when test=" ($wsmap='managed') or ($wsmap='global')">
922 <xsl:value-of select="concat('createOrFindRefFromComPtr(idThis, g_pcsz', $thatifname, ', ', $varname, ')')" />
923 </xsl:when>
924 <xsl:when test="$wsmap='struct'">
925 <!-- prevent infinite recursion -->
926 <!-- <xsl:call-template name="fatalError"><xsl:with-param name="msg" select="concat('emitOutputArgBackConverter2: attempted infinite recursion for type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $ifname, '::', $method)" /></xsl:call-template> -->
927 <xsl:if test="not($callerprefix)">
928 <xsl:value-of select="concat('/* convert COM interface to struct */ ', $G_funcPrefixOutputStructConverter, $type, '(soap, idThis, rc, ', $varname, ')')" />
929 </xsl:if>
930 </xsl:when>
931 <xsl:otherwise>
932 <xsl:call-template name="fatalError">
933 <xsl:with-param name="msg" select="concat('emitOutputArgBackConverter2: Type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $ifname, '::', $method, '&quot; has invalid wsmap attribute value &quot;', $wsmap, '&quot; in XIDL.')" />
934 </xsl:call-template>
935 </xsl:otherwise>
936 </xsl:choose>
937 </xsl:when>
938 <xsl:otherwise>
939 <xsl:call-template name="fatalError">
940 <xsl:with-param name="msg" select="concat('emitOutputArgBackConverter2: Type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $method, '&quot; is not supported.')" />
941 </xsl:call-template>
942 </xsl:otherwise>
943 </xsl:choose>
944
945</xsl:template>
946
947<!--
948 emitOutputArgBackConverter:
949 another type converter (from COM type back to WSDL)
950 which converts the output argument from the COM
951 method call back to the WSDL type passed in by the
952 caller.
953-->
954<xsl:template name="emitOutputArgBackConverter">
955 <xsl:param name="ifname" />
956 <xsl:param name="method" />
957 <xsl:param name="name" />
958 <xsl:param name="type" />
959 <xsl:param name="safearray" />
960 <xsl:param name="varprefix" /> <!-- only when called recursively from emitGetAttributeComCall -->
961 <xsl:param name="callerprefix" /> <!-- only for out params or when called recursively from emitGetAttributeComCall -->
962
963 <xsl:variable name="topname" select="$name" />
964 <xsl:variable name="varname" select="concat('comcall_', $varprefix, $name)" />
965
966 <xsl:call-template name="emitNewlineIndent8" />
967 <xsl:value-of select="concat('WEBDEBUG((g_pcszConvertComOutputBack, &quot;', $name, '&quot;));')" />
968 <xsl:call-template name="emitNewlineIndent8" />
969
970 <xsl:variable name="receiverVariable">
971 <xsl:choose>
972 <xsl:when test="(not($varprefix))">
973 <xsl:choose>
974 <xsl:when test="$callerprefix"> <!-- callerprefix set but varprefix not: then this is an out parameter :-) -->
975 <xsl:value-of select="concat($G_responseElementVarName, '-&gt;', $name)" />
976 </xsl:when>
977 <xsl:otherwise>
978 <xsl:value-of select="concat($G_responseElementVarName, '-&gt;', $G_result)" />
979 </xsl:otherwise>
980 </xsl:choose>
981 </xsl:when>
982 <xsl:otherwise>
983 <xsl:value-of select="concat($callerprefix, $G_result, '-&gt;', $name)" />
984 </xsl:otherwise>
985 </xsl:choose>
986 </xsl:variable>
987
988 <xsl:choose>
989 <xsl:when test="$safearray='yes' and $type='octet'">
990 <xsl:value-of select="concat($receiverVariable, ' = Base64EncodeByteArray(ComSafeArrayAsInParam(', $varname,'));')" />
991 <xsl:call-template name="emitNewlineIndent8" />
992 </xsl:when>
993
994 <xsl:when test="$safearray='yes'">
995 <xsl:value-of select="concat('for (size_t i = 0; i &lt; ', $varname, '.size(); ++i)')" />
996 <xsl:call-template name="emitNewlineIndent8" />
997 <xsl:value-of select="'{'" />
998 <xsl:call-template name="emitNewlineIndent8" />
999 <!-- look up C++ glue type from IDL type from table array in typemap-shared.inc.xsl -->
1000 <xsl:variable name="gluetypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename" />
1001 <xsl:choose>
1002 <xsl:when test="count(key('G_keyInterfacesByName', $type)) > 0">
1003 <xsl:value-of select="concat(' ComPtr&lt;', $type, '&gt; tmpObject(', $varname, '[i]);')" />
1004 </xsl:when>
1005 <xsl:when test="count(key('G_keyEnumsByName', $type)) > 0">
1006 <xsl:value-of select="concat(' ', $type, '_T tmpObject(', $varname, '[i]);')" />
1007 </xsl:when>
1008 <xsl:when test="$type='$unknown'">
1009 <xsl:value-of select="concat(' ComPtr&lt;IUnknown&gt; tmpObject(', $varname, '[i]);')" />
1010 </xsl:when>
1011 <xsl:when test="$type='wstring' or $type='uuid'">
1012 <xsl:value-of select="concat(' com::Bstr tmpObject(', $varname, '[i]);')" />
1013 </xsl:when>
1014 <xsl:when test="$gluetypefield">
1015 <xsl:value-of select="concat(' ', $gluetypefield, ' tmpObject(', $varname, '[i]);')" />
1016 </xsl:when>
1017 <xsl:otherwise>
1018 <xsl:call-template name="fatalError">
1019 <xsl:with-param name="msg" select="concat('emitOutputArgBackConverter (1): Type &quot;', $type, '&quot; in arg &quot;', $name, '&quot; of method &quot;', $method, '&quot; is not yet supported in safearrays.')" />
1020 </xsl:call-template>
1021
1022 </xsl:otherwise>
1023 </xsl:choose>
1024 <xsl:call-template name="emitNewlineIndent8" />
1025 <xsl:value-of select="concat(' ', $receiverVariable, '.push_back(')" />
1026 <xsl:call-template name="emitOutputArgBackConverter2">
1027 <xsl:with-param name="name" select="$name"/>
1028 <xsl:with-param name="varname" select="'tmpObject'"/>
1029 <xsl:with-param name="type" select="$type"/>
1030 <xsl:with-param name="callerprefix" select="$callerprefix"/>
1031 </xsl:call-template>
1032 <xsl:value-of select="');'" />
1033 <xsl:call-template name="emitNewlineIndent8" />
1034 <xsl:value-of select="'}'" />
1035 <xsl:call-template name="emitNewline" />
1036 </xsl:when>
1037 <xsl:otherwise>
1038 <!-- emit variable name: "resp->retval = " -->
1039 <xsl:value-of select="$receiverVariable" />
1040
1041 <xsl:value-of select="' = '" />
1042 <xsl:call-template name="emitOutputArgBackConverter2">
1043 <xsl:with-param name="name" select="$name"/>
1044 <xsl:with-param name="varname" select="$varname"/>
1045 <xsl:with-param name="type" select="$type"/>
1046 <xsl:with-param name="callerprefix" select="$callerprefix"/>
1047 </xsl:call-template>
1048 <xsl:value-of select="';'" />
1049 <xsl:call-template name="emitNewline" />
1050
1051 </xsl:otherwise>
1052 </xsl:choose>
1053
1054 <xsl:value-of select="concat(' WEBDEBUG((g_pcszDoneConvertingComOutputBack, &quot;', $name, '&quot;));')" />
1055 <xsl:call-template name="emitNewline" />
1056</xsl:template>
1057
1058<!--
1059 emitGetAttributeComCall
1060 -->
1061<xsl:template name="emitGetAttributeComCall">
1062 <xsl:param name="ifname" />
1063 <xsl:param name="object" /> <!-- normally "pObj->" -->
1064 <xsl:param name="attrname" />
1065 <xsl:param name="attrtype" />
1066 <xsl:param name="attrsafearray" />
1067 <xsl:param name="varprefix" /> <!-- only when called recursively from emitOutputArgBackConverter-->
1068 <xsl:param name="callerprefix" /> <!-- only when called recursively from emitOutputArgBackConverter-->
1069
1070 <xsl:variable name="gettername"><xsl:call-template name="makeGetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable>
1071 <xsl:call-template name="emitOutputArgBuffer">
1072 <xsl:with-param name="ifname"><xsl:value-of select="$ifname" /></xsl:with-param>
1073 <xsl:with-param name="method"><xsl:value-of select="$gettername" /></xsl:with-param>
1074 <xsl:with-param name="name" select="$attrname" />
1075 <xsl:with-param name="type" select="$attrtype" />
1076 <xsl:with-param name="safearray" select="$attrsafearray" />
1077 <xsl:with-param name="varprefix" select="$varprefix" />
1078 </xsl:call-template>
1079 <xsl:variable name="upperattrname"><xsl:call-template name="capitalize"><xsl:with-param name="str" select="$attrname" /></xsl:call-template></xsl:variable>
1080 <!-- actual COM method call -->
1081 <xsl:call-template name="emitComCall">
1082 <xsl:with-param name="ifname" select="$ifname" />
1083 <xsl:with-param name="methodname" select="concat('COMGETTER(', $upperattrname, ')')" />
1084 <xsl:with-param name="object" select="$object" />
1085 <xsl:with-param name="attrname" select="$attrname" />
1086 <xsl:with-param name="attrtype" select="$attrtype" />
1087 <xsl:with-param name="attrsafearray" select="$attrsafearray" />
1088 <xsl:with-param name="attrdir" select="'return'" />
1089 <xsl:with-param name="varprefix" select="$varprefix" />
1090 </xsl:call-template>
1091 <!-- convert back the output data -->
1092 <xsl:call-template name="emitOutputArgBackConverter">
1093 <xsl:with-param name="ifname"><xsl:value-of select="$ifname" /></xsl:with-param>
1094 <xsl:with-param name="method"><xsl:value-of select="$gettername" /></xsl:with-param>
1095 <xsl:with-param name="name" select="$attrname" />
1096 <xsl:with-param name="type" select="$attrtype" />
1097 <xsl:with-param name="safearray" select="$attrsafearray" />
1098 <xsl:with-param name="varprefix" select="$varprefix" />
1099 <xsl:with-param name="callerprefix" select="$callerprefix" />
1100 </xsl:call-template>
1101</xsl:template>
1102
1103<!--
1104 emitSetAttributeComCall
1105 -->
1106<xsl:template name="emitSetAttributeComCall">
1107 <xsl:param name="ifname" />
1108 <xsl:param name="object" /> <!-- normally "pObj->" -->
1109 <xsl:param name="attrname" />
1110 <xsl:param name="attrtype" />
1111 <xsl:param name="attrsafearray" />
1112 <xsl:param name="callerprefix" /> <!-- only when called recursively from emitOutputArgBackConverter-->
1113
1114 <xsl:variable name="settername"><xsl:call-template name="makeSetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable>
1115 <xsl:variable name="upperattrname"><xsl:call-template name="capitalize"><xsl:with-param name="str" select="$attrname" /></xsl:call-template></xsl:variable>
1116
1117 <xsl:call-template name="emitInputArgConverter">
1118 <xsl:with-param name="ifname" select="$ifname" />
1119 <xsl:with-param name="method" select="concat($ifname, '::', $settername)" />
1120 <xsl:with-param name="methodname" select="concat('COMSETTER(', $upperattrname, ')')" />
1121 <xsl:with-param name="object" select="$object" />
1122 <xsl:with-param name="name" select="$attrname" />
1123 <xsl:with-param name="structprefix" select="concat($G_requestElementVarName, '-&gt;')" />
1124 <xsl:with-param name="type" select="$attrtype" />
1125 <xsl:with-param name="safearray" select="$attrsafearray" />
1126 </xsl:call-template>
1127 <xsl:call-template name="emitComCall">
1128 <xsl:with-param name="ifname" select="$ifname" />
1129 <xsl:with-param name="methodname" select="concat('COMSETTER(', $upperattrname, ')')" />
1130 <xsl:with-param name="object" select="$object" />
1131 <xsl:with-param name="attrname" select="$attrname" />
1132 <xsl:with-param name="attrtype" select="$attrtype" />
1133 <xsl:with-param name="attrsafearray" select="$attrsafearray" />
1134 <xsl:with-param name="attrdir" select="'in'" />
1135 </xsl:call-template>
1136</xsl:template>
1137
1138<!--
1139 emitGetAttributeMapper
1140 -->
1141<xsl:template name="emitGetAttributeMapper">
1142 <xsl:param name="ifname" />
1143 <xsl:param name="wsmap" />
1144 <xsl:param name="attrname" />
1145 <xsl:param name="attrtype" />
1146 <xsl:param name="attrreadonly" />
1147 <xsl:param name="attrsafearray" />
1148
1149 <xsl:variable name="gettername"><xsl:call-template name="makeGetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable>
1150
1151 <xsl:call-template name="emitBeginOfFunctionHeader">
1152 <xsl:with-param name="ifname" select="$ifname" />
1153 <xsl:with-param name="method" select="$gettername" />
1154 </xsl:call-template>
1155
1156 <xsl:call-template name="emitDocumentStyleArgStructs">
1157 <xsl:with-param name="ifname" select="$ifname" />
1158 <xsl:with-param name="methodname" select="$gettername" />
1159 <xsl:with-param name="fOutputs" select="$attrtype" />
1160 </xsl:call-template>
1161
1162 <xsl:text>)</xsl:text>
1163 <xsl:call-template name="emitNewline" />
1164 <xsl:text>{</xsl:text>
1165 <xsl:call-template name="emitNewline" />
1166
1167 <xsl:value-of select="' HRESULT rc = S_OK;'" />
1168 <xsl:call-template name="emitNewline" />
1169
1170 <xsl:call-template name="emitPrologue" />
1171
1172 <!-- actual COM method call -->
1173 <!-- <xsl:choose>
1174 array attributes/parameters are not supported yet...
1175 <xsl:when test="@array or @safearray='yes'">
1176 <xsl:call-template name="warning"><xsl:with-param name="msg" select="concat('emitComCall: SKIPPING ATTRIBUTE IMPLEMENTATION for &quot;', $attrname, '&quot; because it has array type. THIS SOAP METHOD WILL NOT DO ANYTHING!')" /></xsl:call-template>
1177 </xsl:when>
1178 <xsl:otherwise> -->
1179 <xsl:call-template name="emitObjForMethod">
1180 <xsl:with-param name="ifname"><xsl:value-of select="$ifname" /></xsl:with-param>
1181 <xsl:with-param name="wsmap"><xsl:value-of select="$wsmap" /></xsl:with-param>
1182 <xsl:with-param name="structprefix" select="concat($G_requestElementVarName, '-&gt;')" />
1183 </xsl:call-template>
1184
1185 <xsl:call-template name="emitGetAttributeComCall">
1186 <xsl:with-param name="ifname"><xsl:value-of select="$ifname" /></xsl:with-param>
1187 <xsl:with-param name="object" select='"pObj"' />
1188 <xsl:with-param name="attrname"><xsl:value-of select="$attrname" /></xsl:with-param>
1189 <xsl:with-param name="attrtype"><xsl:value-of select="$attrtype" /></xsl:with-param>
1190 <xsl:with-param name="attrsafearray"><xsl:value-of select="$attrsafearray" /></xsl:with-param>
1191 </xsl:call-template>
1192 <!-- </xsl:otherwise>
1193 </xsl:choose> -->
1194
1195 <xsl:call-template name="emitEpilogue" />
1196</xsl:template>
1197
1198<!--
1199 emitSetAttributeMapper:
1200 -->
1201<xsl:template name="emitSetAttributeMapper">
1202 <xsl:param name="ifname" select="$ifname" />
1203 <xsl:param name="wsmap" select="$wsmap" />
1204 <xsl:param name="attrname" select="$attrname" />
1205 <xsl:param name="attrtype" select="$attrtype" />
1206 <xsl:param name="attrreadonly" select="$attrreadonly" />
1207 <xsl:param name="attrsafearray" select="$attrsafearray" />
1208
1209 <xsl:variable name="settername"><xsl:call-template name="makeSetterName"><xsl:with-param name="attrname" select="$attrname" /></xsl:call-template></xsl:variable>
1210
1211 <xsl:call-template name="emitBeginOfFunctionHeader">
1212 <xsl:with-param name="ifname" select="$ifname" />
1213 <xsl:with-param name="method" select="$settername" />
1214 </xsl:call-template>
1215
1216 <xsl:call-template name="emitDocumentStyleArgStructs">
1217 <xsl:with-param name="ifname" select="$ifname" />
1218 <xsl:with-param name="methodname" select="$settername" />
1219 <xsl:with-param name="fOutputs" select="1" />
1220 </xsl:call-template>
1221
1222 <xsl:text>)</xsl:text>
1223 <xsl:call-template name="emitNewline" />
1224 <xsl:text>{</xsl:text>
1225 <xsl:call-template name="emitNewline" />
1226 <xsl:value-of select="' HRESULT rc = S_OK;'" />
1227 <xsl:value-of select="concat(concat(' NOREF(', $G_responseElementVarName),');')" />
1228 <xsl:call-template name="emitNewline" />
1229 <xsl:call-template name="emitPrologue" />
1230
1231 <!-- actual COM method call -->
1232 <!-- <xsl:choose>
1233 array attributes/parameters are not supported yet...
1234 <xsl:when test="@array or @safearray='yes'">
1235 <xsl:call-template name="warning"><xsl:with-param name="msg" select="concat('emitComCall: SKIPPING ATTRIBUTE IMPLEMENTATION for &quot;', $attrname, '&quot; because it has array type. THIS SOAP METHOD WILL NOT DO ANYTHING!')" /></xsl:call-template>
1236 </xsl:when>
1237 <xsl:otherwise> -->
1238 <xsl:call-template name="emitObjForMethod">
1239 <xsl:with-param name="ifname"><xsl:value-of select="$ifname" /></xsl:with-param>
1240 <xsl:with-param name="wsmap"><xsl:value-of select="$wsmap" /></xsl:with-param>
1241 <xsl:with-param name="structprefix" select="concat($G_requestElementVarName, '-&gt;')" />
1242 </xsl:call-template>
1243 <xsl:call-template name="emitSetAttributeComCall">
1244 <xsl:with-param name="ifname"><xsl:value-of select="$ifname" /></xsl:with-param>
1245 <xsl:with-param name="object" select='"pObj"' />
1246 <xsl:with-param name="attrname"><xsl:value-of select="$attrname" /></xsl:with-param>
1247 <xsl:with-param name="attrtype"><xsl:value-of select="$attrtype" /></xsl:with-param>
1248 <xsl:with-param name="attrsafearray"><xsl:value-of select="$attrsafearray" /></xsl:with-param>
1249 </xsl:call-template>
1250 <!-- </xsl:otherwise>
1251 </xsl:choose> -->
1252
1253 <xsl:call-template name="emitEpilogue" />
1254</xsl:template>
1255
1256<!-- - - - - - - - - - - - - - - - - - - - - - -
1257 interface
1258 - - - - - - - - - - - - - - - - - - - - - - -->
1259
1260<xsl:template match="interface">
1261 <!-- remember the interface name in local variables -->
1262 <xsl:variable name="ifname"><xsl:value-of select="@name" /></xsl:variable>
1263 <xsl:variable name="wsmap"><xsl:value-of select="@wsmap" /></xsl:variable>
1264 <xsl:variable name="wscpp"><xsl:value-of select="@wscpp" /></xsl:variable>
1265
1266 <!-- we can save ourselves verifying the interface here as it's already
1267 done in the WSDL converter -->
1268
1269 <xsl:if test='not( ($wsmap="suppress") or ($wsmap="struct") or ($wscpp="hardcoded") )'>
1270 <xsl:text>
1271/****************************************************************************
1272 *
1273 * interface </xsl:text>
1274<xsl:copy-of select="$ifname" />
1275<xsl:text>
1276 *
1277 ****************************************************************************/</xsl:text>
1278 <xsl:call-template name="xsltprocNewlineOutputHack"/>
1279
1280 <!--
1281 here come the attributes
1282 -->
1283 <xsl:for-each select="attribute">
1284 <xsl:variable name="attrname"><xsl:value-of select="@name" /></xsl:variable>
1285 <xsl:variable name="attrtype"><xsl:value-of select="@type" /></xsl:variable>
1286 <xsl:variable name="attrreadonly"><xsl:value-of select="@readonly" /></xsl:variable>
1287 <xsl:variable name="attrsafearray"><xsl:value-of select="@safearray" /></xsl:variable>
1288 <xsl:call-template name="emitNewline" />
1289 <!-- skip this attribute if it has parameters of a type that has wsmap="suppress" -->
1290 <xsl:choose>
1291 <xsl:when test="( $attrtype=($G_setSuppressedInterfaces/@name) )">
1292 <xsl:value-of select="concat('// Skipping attribute ', $attrname, ' for it is of suppressed type ', $attrtype)" />
1293 </xsl:when>
1294 <xsl:when test="@wsmap = 'suppress'">
1295 <xsl:value-of select="concat('// Skipping attribute ', $attrname, ' for it is suppressed')" />
1296 </xsl:when>
1297 <xsl:otherwise>
1298 <xsl:choose>
1299 <xsl:when test="@readonly='yes'">
1300 <xsl:value-of select="concat('// read-only attribute ', $ifname, '::', $attrname, ' of type ', $attrtype)" />
1301 </xsl:when>
1302 <xsl:otherwise>
1303 <xsl:value-of select="concat('// read/write attribute ', $ifname, '::', $attrname, ' of type ', $attrtype)" />
1304 </xsl:otherwise>
1305 </xsl:choose>
1306 <xsl:value-of select="concat(' (safearray: ', $attrsafearray, ')')" />
1307 <!-- emit getter method -->
1308 <xsl:call-template name="emitGetAttributeMapper">
1309 <xsl:with-param name="ifname" select="$ifname" />
1310 <xsl:with-param name="wsmap" select="$wsmap" />
1311 <xsl:with-param name="attrname" select="$attrname" />
1312 <xsl:with-param name="attrtype" select="$attrtype" />
1313 <xsl:with-param name="attrreadonly" select="$attrreadonly" />
1314 <xsl:with-param name="attrsafearray" select="$attrsafearray" />
1315 </xsl:call-template>
1316 <!-- for read-write attributes, emit setter method -->
1317 <xsl:if test="not(@readonly='yes')">
1318 <xsl:call-template name="emitSetAttributeMapper">
1319 <xsl:with-param name="ifname" select="$ifname" />
1320 <xsl:with-param name="wsmap" select="$wsmap" />
1321 <xsl:with-param name="attrname" select="$attrname" />
1322 <xsl:with-param name="attrtype" select="$attrtype" />
1323 <xsl:with-param name="attrreadonly" select="$attrreadonly" />
1324 <xsl:with-param name="attrsafearray" select="$attrsafearray" />
1325 </xsl:call-template>
1326 </xsl:if>
1327 </xsl:otherwise> <!-- not wsmap=suppress -->
1328 </xsl:choose>
1329 </xsl:for-each>
1330
1331 <!--
1332 here come the real methods
1333 -->
1334
1335 <xsl:for-each select="method">
1336 <xsl:variable name="methodname"><xsl:value-of select="@name" /></xsl:variable>
1337 <!-- method header: return value "int", method name, soap arguments -->
1338 <!-- skip this method if it has parameters of a type that has wsmap="suppress" -->
1339 <xsl:choose>
1340 <xsl:when test=" (param[@type=($G_setSuppressedInterfaces/@name)])
1341 or (param[@mod='ptr'])" >
1342 <xsl:comment><xsl:value-of select="concat('Skipping method ', $methodname, ' for it has parameters with suppressed types')" /></xsl:comment>
1343 </xsl:when>
1344 <xsl:when test="@wsmap = 'suppress'">
1345 <xsl:comment><xsl:value-of select="concat('Skipping method ', $methodname, ' for it is suppressed')" /></xsl:comment>
1346 </xsl:when>
1347 <xsl:otherwise>
1348 <xsl:variable name="fHasReturnParms" select="param[@dir='return']" />
1349 <xsl:variable name="fHasOutParms" select="param[@dir='out']" />
1350
1351 <xsl:call-template name="emitNewline" />
1352 <xsl:value-of select="concat('/* method ', $ifname, '::', $methodname, '(')" />
1353 <xsl:for-each select="param">
1354 <xsl:call-template name="emitNewline" />
1355 <xsl:value-of select="concat(' [', @dir, '] ', @type, ' ', @name)" />
1356 <xsl:if test="@safearray='yes'">
1357 <xsl:text>[]</xsl:text>
1358 </xsl:if>
1359 <xsl:if test="not(position()=last())">
1360 <xsl:text>,</xsl:text>
1361 </xsl:if>
1362 </xsl:for-each>
1363 <xsl:text>)</xsl:text>
1364 <xsl:call-template name="emitNewline" />
1365 <xsl:text> */</xsl:text>
1366
1367 <xsl:call-template name="emitBeginOfFunctionHeader">
1368 <xsl:with-param name="ifname" select="$ifname" />
1369 <xsl:with-param name="method" select="$methodname" />
1370 </xsl:call-template>
1371
1372 <xsl:call-template name="emitDocumentStyleArgStructs">
1373 <xsl:with-param name="ifname" select="$ifname" />
1374 <xsl:with-param name="methodname" select="$methodname" />
1375 <xsl:with-param name="fOutputs" select="1" />
1376 </xsl:call-template>
1377 <xsl:text>)</xsl:text>
1378 <xsl:call-template name="emitNewline" />
1379 <xsl:text>{</xsl:text>
1380 <xsl:call-template name="emitNewline" />
1381 <xsl:value-of select="' HRESULT rc = S_OK;'" />
1382 <xsl:value-of select="concat(concat(' NOREF(', $G_responseElementVarName),');')" />
1383 <xsl:call-template name="emitNewline" />
1384 <xsl:call-template name="emitPrologue" />
1385
1386 <xsl:choose>
1387 <xsl:when test="param[@array]">
1388 <xsl:call-template name="warning"><xsl:with-param name="msg" select="concat('emitComCall: SKIPPING METHOD IMPLEMENTATION for &quot;', $methodname, '&quot; because it has arguments with &quot;array&quot; types. THIS SOAP METHOD WILL NOT DO ANYTHING!')" /></xsl:call-template>
1389 </xsl:when>
1390 <xsl:otherwise>
1391 <!-- emit the object upon which to invoke the method -->
1392 <xsl:call-template name="emitObjForMethod">
1393 <xsl:with-param name="ifname"><xsl:value-of select="$ifname" /></xsl:with-param>
1394 <xsl:with-param name="wsmap"><xsl:value-of select="$wsmap" /></xsl:with-param>
1395 <xsl:with-param name="structprefix" select="concat($G_requestElementVarName, '-&gt;')" />
1396 </xsl:call-template>
1397 <!-- next, emit storage variables to convert the SOAP/C++ arguments to COM types -->
1398 <xsl:for-each select="param">
1399 <xsl:variable name="dir" select="@dir" />
1400 <xsl:choose>
1401 <xsl:when test="$dir='in'">
1402 <xsl:call-template name="emitInputArgConverter">
1403 <xsl:with-param name="ifname" select="$ifname" />
1404 <xsl:with-param name="method" select="concat($ifname, '::', $methodname)" />
1405 <xsl:with-param name="methodname">
1406 <xsl:call-template name="capitalize">
1407 <xsl:with-param name="str" select="$methodname" />
1408 </xsl:call-template>
1409 </xsl:with-param>
1410 <xsl:with-param name="object" select='"pObj"' />
1411 <xsl:with-param name="structprefix" select="concat($G_requestElementVarName, '-&gt;')" />
1412 <xsl:with-param name="name" select="@name" />
1413 <xsl:with-param name="type" select="@type" />
1414 <xsl:with-param name="safearray" select="@safearray" />
1415 </xsl:call-template>
1416 </xsl:when>
1417 <xsl:when test="$dir='out'">
1418 <xsl:call-template name="emitOutputArgBuffer">
1419 <xsl:with-param name="method" select="concat($ifname, '::', $methodname)" />
1420 <xsl:with-param name="name" select="@name" />
1421 <xsl:with-param name="type" select="@type" />
1422 <xsl:with-param name="safearray" select="@safearray" />
1423 </xsl:call-template>
1424 </xsl:when>
1425 <xsl:when test="$dir='return'">
1426 <xsl:call-template name="emitOutputArgBuffer">
1427 <xsl:with-param name="method" select="concat($ifname, '::', $methodname)" />
1428 <xsl:with-param name="name" select="$G_result" />
1429 <xsl:with-param name="type" select="@type" />
1430 <xsl:with-param name="safearray" select="@safearray" />
1431 </xsl:call-template>
1432 </xsl:when>
1433 </xsl:choose>
1434 </xsl:for-each>
1435 <!-- actual COM method call -->
1436 <xsl:call-template name="emitComCall">
1437 <xsl:with-param name="ifname" select="$ifname" />
1438 <xsl:with-param name="object" select='"pObj"' />
1439 <xsl:with-param name="methodname">
1440 <xsl:call-template name="capitalize">
1441 <xsl:with-param name="str" select="$methodname" />
1442 </xsl:call-template>
1443 </xsl:with-param>
1444 </xsl:call-template>
1445 <!-- convert back the output data -->
1446 <xsl:for-each select="param">
1447 <xsl:variable name="dir" select="@dir" />
1448 <xsl:if test="$dir='out'">
1449 <xsl:call-template name="emitOutputArgBackConverter">
1450 <xsl:with-param name="ifname"><xsl:value-of select="$ifname" /></xsl:with-param>
1451 <xsl:with-param name="method" select="$methodname" />
1452 <xsl:with-param name="name"><xsl:value-of select="@name" /></xsl:with-param>
1453 <xsl:with-param name="type"><xsl:value-of select="@type" /></xsl:with-param>
1454 <xsl:with-param name="safearray"><xsl:value-of select="@safearray" /></xsl:with-param>
1455 <xsl:with-param name="callerprefix" select="'outparms.'"/>
1456 </xsl:call-template>
1457 </xsl:if>
1458 <xsl:if test="$dir='return'">
1459 <!-- return values _normally_ should convert to the input arg from the function prototype,
1460 except when there are both return and out params; in that case gsoap squeezes them all
1461 into the output args structure and the return thing is called "retval" -->
1462 <xsl:choose>
1463 <xsl:when test="$fHasOutParms">
1464 <xsl:call-template name="emitOutputArgBackConverter">
1465 <xsl:with-param name="ifname"><xsl:value-of select="$ifname" /></xsl:with-param>
1466 <xsl:with-param name="method" select="$methodname" />
1467 <xsl:with-param name="name"><xsl:value-of select="$G_result" /></xsl:with-param>
1468 <xsl:with-param name="type"><xsl:value-of select="@type" /></xsl:with-param>
1469 <xsl:with-param name="safearray"><xsl:value-of select="@safearray" /></xsl:with-param>
1470 <xsl:with-param name="callerprefix" select="'outparms.'"/>
1471 </xsl:call-template>
1472 </xsl:when>
1473 <xsl:otherwise>
1474 <xsl:call-template name="emitOutputArgBackConverter">
1475 <xsl:with-param name="ifname"><xsl:value-of select="$ifname" /></xsl:with-param>
1476 <xsl:with-param name="method" select="$methodname" />
1477 <xsl:with-param name="name"><xsl:value-of select="$G_result" /></xsl:with-param>
1478 <xsl:with-param name="type"><xsl:value-of select="@type" /></xsl:with-param>
1479 <xsl:with-param name="safearray"><xsl:value-of select="@safearray" /></xsl:with-param>
1480 </xsl:call-template>
1481 </xsl:otherwise>
1482 </xsl:choose>
1483 </xsl:if>
1484 </xsl:for-each>
1485 </xsl:otherwise>
1486 </xsl:choose>
1487 <xsl:call-template name="emitEpilogue" />
1488 </xsl:otherwise>
1489 </xsl:choose>
1490 </xsl:for-each>
1491 </xsl:if>
1492
1493</xsl:template>
1494
1495
1496</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette