VirtualBox

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

Last change on this file since 39091 was 39091, checked in by vboxsync, 13 years ago

More parameter warning fixes; made PciIch9 check the saved state version.

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