|
1 /* |
|
2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 // INCLUDE |
|
26 #include <SenServiceConnection.h> // error code definitions |
|
27 #include <SenDateUtils.h> |
|
28 #include <SenSoapFault.h> |
|
29 #include <SenWsSecurityHeader.h> |
|
30 #include <SenTransportProperties.h> |
|
31 #include <SenSoapConstants.h> // SOAPAction constants, like KSenSoapActionHeaderName |
|
32 |
|
33 #include "sendebug.h" |
|
34 #include "senlogger.h" |
|
35 |
|
36 #include "msencoreservicemanager.h" |
|
37 #include "senservicemanagerdefines.h" |
|
38 #include "senserviceinvocationframework.h" |
|
39 |
|
40 #include "midwsfsessionvalidator.h" |
|
41 #include "idwsfservicesession.h" |
|
42 #include "idwsfsessionconsumer.h" |
|
43 #include "idwsfserviceinstance.h" |
|
44 #include "seninternalcredential.h" |
|
45 #include <SenXmlReader.h> |
|
46 |
|
47 namespace |
|
48 { |
|
49 _LIT8(KSAML, "SAML"); |
|
50 _LIT8(KBEARER, "Bearer"); |
|
51 |
|
52 _LIT8(KProviderID, "<ProviderID>"); |
|
53 _LIT8(KProviderIDEnd, "</ProviderID>"); |
|
54 _LIT8(KResourceID, "<ResourceID>"); |
|
55 _LIT8(KResourceIDEnd, "</ResourceID>"); |
|
56 _LIT8(KTrustAnchor, "<TrustAnchor>"); |
|
57 _LIT8(KTrustAnchorEnd, "</TrustAnchor>"); |
|
58 _LIT8(KServiceInterval, "<ServiceInterval>"); |
|
59 _LIT8(KServiceIntervalEnd, "</ServiceInterval>"); |
|
60 |
|
61 _LIT8(KProviderIdElementLocalName, "ProviderID"); |
|
62 _LIT8(KResourceIDElementLocalName, "ResourceID"); |
|
63 _LIT8(TrustAnchorElementLocalName, "TrustAnchor"); |
|
64 //_LIT8(KServiceIntervalElementLocalName, "ServiceInterval"); |
|
65 |
|
66 const TInt KSubmitStateOK = 1; |
|
67 const TInt KSubmitStateInvalidCredentials = 2; |
|
68 const TInt KSubmitStateRevalidationAttempted = 3; |
|
69 const TInt KSubmitStateRevalidationFailed = 4; |
|
70 //const TInt KSubmitSateResend = 5; |
|
71 //const TInt KSubmitSateResendFailed = 6; |
|
72 } |
|
73 |
|
74 CIdWsfServiceSession* CIdWsfServiceSession::NewL(MSIF& aFramework) |
|
75 { |
|
76 CIdWsfServiceSession* self = CIdWsfServiceSession::NewLC(aFramework); |
|
77 CleanupStack::Pop(self); |
|
78 return self; |
|
79 } |
|
80 |
|
81 CIdWsfServiceSession* CIdWsfServiceSession::NewLC(MSIF& aFramework) |
|
82 { |
|
83 CIdWsfServiceSession* self = new (ELeave) CIdWsfServiceSession( |
|
84 MSenServiceDescription::EIdWSFServiceSession, aFramework); |
|
85 CleanupStack::PushL(self); |
|
86 self->ConstructL(); |
|
87 return self; |
|
88 } |
|
89 |
|
90 CIdWsfServiceSession::CIdWsfServiceSession(TDescriptionClassType aType, |
|
91 MSIF& aSIF) |
|
92 : CSenWebServiceSession(aType, aSIF), |
|
93 iProvider(NULL), |
|
94 ipResourceId(NULL), |
|
95 ipTrustAnchor(NULL), |
|
96 ipReceivedMessageId(NULL), |
|
97 ipSenSecurityMechanism(NULL), |
|
98 iMessageThread(EFalse), |
|
99 ipValidator(NULL), |
|
100 iSubmitState(KSubmitStateOK) |
|
101 { |
|
102 } |
|
103 |
|
104 CIdWsfServiceSession::~CIdWsfServiceSession() |
|
105 { |
|
106 delete iProvider; |
|
107 delete ipResourceId; |
|
108 delete ipTrustAnchor; |
|
109 delete ipReceivedMessageId; |
|
110 delete ipSenSecurityMechanism; |
|
111 |
|
112 TInt count(iConsumerList.Count()); |
|
113 for(TInt i=0; i<count; i++) |
|
114 { |
|
115 // we can assume that every remote consumer |
|
116 // has been wrapped inside IdWsfSessionConsumer |
|
117 // -wrapperclass. Cast and destroy: |
|
118 CIdWsfSessionConsumer* pConsumer |
|
119 = (CIdWsfSessionConsumer*) iConsumerList[i]; |
|
120 |
|
121 // this destroys the wrapper, but the remote |
|
122 // consumer objects ownership remains in either |
|
123 // XMLDao or ClientSession (etc) |
|
124 delete pConsumer; |
|
125 } |
|
126 } |
|
127 |
|
128 void CIdWsfServiceSession::ConstructL() |
|
129 { |
|
130 // sets local name to "ServiceDescription" and |
|
131 // initiates the inner ipElement |
|
132 CSenWebServiceSession::ConstructL(); |
|
133 } |
|
134 |
|
135 TInt CIdWsfServiceSession::AddConsumerL(MSenRemoteServiceConsumer& aConsumer) |
|
136 { |
|
137 const TInt consumerCount(iConsumerList.Count()); |
|
138 for(TInt i=0; i<consumerCount; i++) |
|
139 { |
|
140 if(iConsumerList[i]->Id() == aConsumer.Id()) |
|
141 return KErrAlreadyExists; // already added, nothing to do |
|
142 } |
|
143 |
|
144 CIdWsfSessionConsumer* pSessionConsumer = |
|
145 CIdWsfSessionConsumer::NewL(aConsumer, *Log()); |
|
146 |
|
147 iConsumerList.Append(pSessionConsumer); |
|
148 |
|
149 // clears the array and inserts item as the only one.. |
|
150 // remove next line, when NEW routing is in use: |
|
151 return KErrNone; |
|
152 } |
|
153 |
|
154 TInt CIdWsfServiceSession::RemoveConsumerL(MSenRemoteServiceConsumer& aConsumer) |
|
155 { |
|
156 const TInt consumerCount(iConsumerList.Count()); |
|
157 for(TInt i=0; i<consumerCount; i++) |
|
158 { |
|
159 if(iConsumerList[i]->Id() == aConsumer.Id()) |
|
160 { |
|
161 CIdWsfSessionConsumer* pConsumer |
|
162 = (CIdWsfSessionConsumer*) iConsumerList[i]; |
|
163 delete pConsumer; |
|
164 iConsumerList.Remove(i); |
|
165 break; |
|
166 } |
|
167 } |
|
168 return CSenServiceSession::RemoveConsumerL(aConsumer); |
|
169 } |
|
170 |
|
171 TPtrC8 CIdWsfServiceSession::FrameworkId() |
|
172 { |
|
173 return iFramework.Id(); |
|
174 } |
|
175 |
|
176 TInt CIdWsfServiceSession::MessageForSendingL(const TDesC8& aBody, |
|
177 const TDesC8& aSenderID, |
|
178 CSenSoapMessage*& aMessage) |
|
179 { |
|
180 CIdWsfSessionConsumer* pConsumer = NULL; |
|
181 TInt retVal = SessionConsumerL(aSenderID, pConsumer); |
|
182 if (retVal != KErrNone) |
|
183 { |
|
184 return retVal; |
|
185 } |
|
186 if(ipReceivedMessageId) |
|
187 { |
|
188 retVal = pConsumer->MessageForSendingL(aBody, |
|
189 *ipReceivedMessageId, |
|
190 (CIdWsfMessage*&)aMessage); |
|
191 } |
|
192 else |
|
193 { |
|
194 retVal = pConsumer->MessageForSendingL( aBody, |
|
195 KNullDesC8(), |
|
196 (CIdWsfMessage*&)aMessage); |
|
197 } |
|
198 if (retVal != KErrNone) |
|
199 { |
|
200 return retVal; |
|
201 } |
|
202 |
|
203 SetFrameworkHeadersL(*aMessage); |
|
204 return KErrNone; |
|
205 } |
|
206 |
|
207 TInt CIdWsfServiceSession::NewMessageL(CSenSoapMessage*& aMessage) |
|
208 { |
|
209 aMessage = CIdWsfMessage::NewL(); |
|
210 return KErrNone; |
|
211 } |
|
212 |
|
213 // from XML service description |
|
214 TInt CIdWsfServiceSession::InitializeFromL( |
|
215 MSenServiceDescription& aDescription) |
|
216 { |
|
217 CSenWebServiceSession::SetSecurityL(KNullDesC8); |
|
218 CSenWebServiceSession::InitializeFromL(aDescription); |
|
219 |
|
220 if ( StatusL() != KSenConnectionStatusReady ) |
|
221 { |
|
222 if ( TryToSearchValidCredentialL() == KErrNone ) //codescannerwarnings |
|
223 { |
|
224 SetStatusL(); |
|
225 } |
|
226 } |
|
227 |
|
228 aDescription.HasFacetL(KMessageThread,iMessageThread); |
|
229 |
|
230 TDescriptionClassType classType = aDescription.DescriptionClassType(); |
|
231 if( classType == MSenServiceDescription::EWSDescription |
|
232 || |
|
233 classType == MSenServiceDescription::EWSPattern |
|
234 || |
|
235 classType == MSenServiceDescription::EIdentityProvider |
|
236 ) |
|
237 { |
|
238 MSenElement& xmlSdAsElement = ( |
|
239 (CSenWSDescription*)&aDescription)->AsElement(); |
|
240 |
|
241 |
|
242 MSenElement* pElement = |
|
243 xmlSdAsElement.Element(KProviderIdElementLocalName); |
|
244 if(pElement) |
|
245 { |
|
246 TPtrC8 providerId = pElement->Content(); |
|
247 TPtrC8 endPoint = aDescription.Endpoint(); |
|
248 |
|
249 CIdWsfServiceProvider* pNewProvider = |
|
250 CIdWsfServiceProvider::NewL(providerId, endPoint); |
|
251 // now it is safe to free & re-assign |
|
252 delete iProvider; |
|
253 iProvider = pNewProvider; |
|
254 } |
|
255 |
|
256 pElement = xmlSdAsElement.Element(KResourceIDElementLocalName); |
|
257 if(pElement) |
|
258 { |
|
259 HBufC8* pNewResourceId = (pElement->Content()).AllocL(); |
|
260 // now it is safe to free & re-assign |
|
261 delete ipResourceId; |
|
262 ipResourceId = pNewResourceId; |
|
263 } |
|
264 |
|
265 pElement = xmlSdAsElement.Element(TrustAnchorElementLocalName); |
|
266 if(pElement) |
|
267 { |
|
268 HBufC8* pNewTrustAnchor = (pElement->Content()).AllocL(); |
|
269 delete ipTrustAnchor; |
|
270 ipTrustAnchor = pNewTrustAnchor; |
|
271 } |
|
272 } |
|
273 TPtrC8 contract = Contract(); |
|
274 if (contract == KNullDesC8) |
|
275 { |
|
276 return KErrSenNoContract; |
|
277 } |
|
278 return KErrNone; |
|
279 } |
|
280 |
|
281 TInt CIdWsfServiceSession::ParseMessageL(CSenSoapMessage& aSOAPMessage) |
|
282 { |
|
283 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"CIdWsfServiceSession::ParseMessageL"); |
|
284 |
|
285 if (iMessageThread) |
|
286 { |
|
287 delete ipReceivedMessageId; |
|
288 ipReceivedMessageId = |
|
289 ((CIdWsfMessage&)aSOAPMessage).MessageId().Alloc(); |
|
290 if (!ipReceivedMessageId) |
|
291 return KErrNoMemory; |
|
292 } |
|
293 |
|
294 TInt error = CSenWebServiceSession::ParseMessageL(aSOAPMessage); |
|
295 if (error != KErrNone) |
|
296 { |
|
297 return error; |
|
298 } |
|
299 |
|
300 CIdWsfMessage& message = (CIdWsfMessage&)aSOAPMessage; |
|
301 |
|
302 TTime serverTime; |
|
303 if (message.Timestamp().Length() > 0) |
|
304 { |
|
305 serverTime = SenDateUtils::FromXmlDateTimeL(message.Timestamp()); |
|
306 } |
|
307 else serverTime = Time::NullTTime(); |
|
308 |
|
309 TTime clientTime; |
|
310 clientTime.UniversalTime(); |
|
311 |
|
312 #ifdef _SENDEBUG |
|
313 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"CIdWsfServiceSession::ParseMessageL:"); |
|
314 if (clientTime != Time::NullTTime()) |
|
315 { |
|
316 TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts; |
|
317 SenDateUtils::ToXmlDateTimeUtf82L(ts, clientTime); |
|
318 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KNormalLogLevel ,_L8("- Client (device) time : %S"), &ts)); |
|
319 } |
|
320 #endif // _SENDEBUG |
|
321 |
|
322 if ( serverTime != Time::NullTTime() ) |
|
323 { |
|
324 #ifdef _SENDEBUG |
|
325 TBuf8<SenDateUtils::KXmlDateTimeMaxLength> ts2; |
|
326 SenDateUtils::ToXmlDateTimeUtf82L(ts2, serverTime); |
|
327 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KNormalLogLevel ,_L8("- Server (remote service) time : %S"), &ts2)); |
|
328 |
|
329 #endif // _SENDEBUG |
|
330 |
|
331 iClientServerInterval = serverTime.MicroSecondsFrom(clientTime); |
|
332 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KNormalLogLevel ,_L8("- Interval in microseconds : %d"), iClientServerInterval.Int64())); |
|
333 } |
|
334 |
|
335 delete ipReceivedMessageId; |
|
336 ipReceivedMessageId = NULL; |
|
337 ipReceivedMessageId = message.MessageId().AllocL(); |
|
338 |
|
339 CIdWsfSiuHeader* siuheader = message.SiuHeader(); |
|
340 if (siuheader) |
|
341 { |
|
342 error = UpdateFromL(*siuheader); |
|
343 if (error != KErrNone) return error; |
|
344 } |
|
345 return KErrNone; |
|
346 } |
|
347 |
|
348 TInt CIdWsfServiceSession::SendSoapMessageToConsumerL( CSenSoapMessage* apMessage, |
|
349 const TInt aTxnId, |
|
350 MSenRemoteServiceConsumer& aConsumer, |
|
351 MSenProperties* aResponseTransportProperties ) |
|
352 { |
|
353 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SendSoapMessageToConsumerL"); |
|
354 TInt retVal(KErrNone); |
|
355 |
|
356 if( apMessage ) |
|
357 { |
|
358 CleanupStack::PushL( apMessage ); // ownership is here |
|
359 |
|
360 CIdWsfMessage* pIdWsfMessage = (CIdWsfMessage*)apMessage; |
|
361 |
|
362 if ( iMessageThread ) |
|
363 { |
|
364 // store the Id of the last received message here: |
|
365 delete ipReceivedMessageId; |
|
366 ipReceivedMessageId = pIdWsfMessage->MessageId().Alloc(); |
|
367 if ( !ipReceivedMessageId ) |
|
368 { |
|
369 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- OOM occured!"); |
|
370 CleanupStack::PopAndDestroy( apMessage ); // de-alloc the response immediately |
|
371 retVal = SendErrorToConsumerL( KErrNoMemory, NULL, aTxnId, aConsumer, aResponseTransportProperties ); |
|
372 CSLOG_FORMAT((aConsumer.ConnectionId(), KMinLogLevel , _L8("- OOM occured. Sent KErrNoMemory to remote consumer. SendErrorToConsumerL returned: %d "), retVal)); |
|
373 return KErrNoMemory; |
|
374 } |
|
375 } |
|
376 |
|
377 CIdWsfSessionConsumer* pConsumer = NULL; |
|
378 // This takes care of messageIDs: |
|
379 retVal = SessionConsumerL( *pIdWsfMessage, pConsumer ); |
|
380 if (!pConsumer) |
|
381 { |
|
382 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- Session consumer not found! Invoking remote consumer via a call to base class functionality."); |
|
383 CleanupStack::Pop( apMessage ); // Next method takes ownership: |
|
384 retVal = CSenWebServiceSession::SendSoapMessageToConsumerL( apMessage, aTxnId, aConsumer, aResponseTransportProperties ); |
|
385 CSLOG_FORMAT((aConsumer.ConnectionId(), KNormalLogLevel , _L8("- SendSoapMessageToConsumerL returned: %d "), retVal)); |
|
386 return KErrNotFound; |
|
387 } |
|
388 else |
|
389 { |
|
390 //TSW ID: EMKY-6S4CGS & ID:EMKY-6N3AGA |
|
391 //check for completemessage flag |
|
392 TBool completeServerMessages; |
|
393 HasFacetL(KCompleteMessagesFacet, completeServerMessages); |
|
394 CleanupStack::Pop( apMessage ); // Next method takes ownership: |
|
395 retVal = pConsumer->HandleIdWsfMessageL( pIdWsfMessage, aTxnId, aResponseTransportProperties, completeServerMessages ); |
|
396 } |
|
397 } |
|
398 else // apMessage == NULL! |
|
399 { |
|
400 // There is no SOAP to handle |
|
401 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- Fatal(!): CIdWsfServiceSession::SendSoapMessageToConsumerL, apMessage == NULL, sending internal error to remote consumer!"); |
|
402 retVal = SendErrorToConsumerL( KErrSenInternal, NULL, aTxnId, aConsumer, aResponseTransportProperties ); |
|
403 } |
|
404 return retVal; |
|
405 } |
|
406 |
|
407 void CIdWsfServiceSession::SetEndPointL(const TDesC8& aURI) |
|
408 { |
|
409 CSenWebServiceSession::SetEndPointL(aURI); |
|
410 if(iProvider) |
|
411 { |
|
412 iProvider->SetEndPointL(aURI); |
|
413 } |
|
414 } |
|
415 |
|
416 void CIdWsfServiceSession::SetFrameworkHeadersL(CSenSoapMessage& aMsg) |
|
417 { |
|
418 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"CIdWsfServiceSession::SetFrameworkHeaders(CSenSoapMessage& aMsg)"); |
|
419 |
|
420 #ifdef _SENDEBUG |
|
421 if(ipSenSecurityMechanism) |
|
422 { |
|
423 TPtrC8 secMec = ipSenSecurityMechanism->Des(); |
|
424 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMaxLogLevel ,"Security mechanism: \n"); |
|
425 TLSLOG(KSenCoreServiceManagerLogChannelBase , KMaxLogLevel ,(secMec)); |
|
426 } |
|
427 else |
|
428 { |
|
429 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KNormalLogLevel ,"Note: ipSenSecurityMechanism == NULL!"); |
|
430 } |
|
431 |
|
432 if (ipSenSecurityMechanism && |
|
433 (*ipSenSecurityMechanism).Compare(KSecTlsBearer11) != 0 && |
|
434 (*ipSenSecurityMechanism).Compare(KSecNullBearer11) != 0 ) |
|
435 { |
|
436 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"CIdWsfServiceSession::SetFrameworkHeaders"); |
|
437 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ," - header for ID-WSF 1.0 needs to be used"); |
|
438 } |
|
439 else |
|
440 { |
|
441 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"CIdWsfServiceSession::SetFrameworkHeaders"); |
|
442 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ," - header for ID-WSF 1.1 needs to be used"); |
|
443 } |
|
444 #endif |
|
445 |
|
446 CIdWsfMessage& idWsfMessage = (CIdWsfMessage&)aMsg; |
|
447 idWsfMessage.SetSecurityMechanism(ipSenSecurityMechanism); |
|
448 CSenWebServiceSession::SetFrameworkHeadersL(aMsg); |
|
449 |
|
450 |
|
451 |
|
452 /* |
|
453 |
|
454 //Changes for IDWSF 1.1 support |
|
455 // Added the condition to add the old-style WsSecurity header |
|
456 // for non-IDWSF11 security mechanisms |
|
457 |
|
458 if (ipSenSecurityMechanism && |
|
459 (*ipSenSecurityMechanism).Compare(KSecTlsBearer11) != 0 && |
|
460 (*ipSenSecurityMechanism).Compare(KSecNullBearer11) != 0 ) |
|
461 { |
|
462 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SetFrameworkHeaders \ |
|
463 - Setting header for ID-WSF 1.0"); |
|
464 // Add new OLD WsSecurityHeader to msg |
|
465 |
|
466 |
|
467 CIdWsfSecurityHeader* pHeader = NULL; |
|
468 if(iSecurity) |
|
469 { |
|
470 pHeader = |
|
471 CIdWsfSecurityHeader::NewL(*iSecurity); |
|
472 } |
|
473 else |
|
474 { |
|
475 pHeader = |
|
476 CIdWsfSecurityHeader::NewL(); |
|
477 } |
|
478 aMsg.AddHeaderL( pHeader->AsElement() ) ; |
|
479 |
|
480 // Above is equal with next line, if an aMsg argument |
|
481 // is actually SenIdWsfSoapMessage(!), ID-WSF 1.1, matmatt |
|
482 //CSenWebServiceSession::SetFrameworkHeaders(aMsg); |
|
483 } |
|
484 else // NOTE: now we default to 1.1 if !ipSenSecurityMechanism |
|
485 { |
|
486 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SetFrameworkHeaders \ |
|
487 - Setting header for ID-WSF 1.1"); |
|
488 // We need to use (newer) security header for ID-WSF 1.1 |
|
489 // this could be done in IdWsfSoapMessage class, if it would |
|
490 // somehow know in NewSecurityHeaderL() method, that it is |
|
491 // actually 1.0 or 1.1. But this current solution is rather |
|
492 // clear also. Each new header type, we need a new |
|
493 // else-if code segment inside this session class method, |
|
494 // -> in here. |
|
495 CSenWsSecurityHeader* pHeader = NULL; |
|
496 |
|
497 if(iSecurity) |
|
498 { |
|
499 // ID-WSF 1.1, matmatt |
|
500 pHeader = |
|
501 CSenWsSecurityHeader::NewL(*iSecurity); |
|
502 } |
|
503 else |
|
504 { |
|
505 pHeader = |
|
506 CSenWsSecurityHeader::NewL(); |
|
507 } |
|
508 aMsg.AddHeaderL( pHeader->AsElement() ) ; |
|
509 } |
|
510 */ |
|
511 |
|
512 // CorrelationHeader adjustment is already done in the SessionConsumer |
|
513 |
|
514 } |
|
515 |
|
516 void CIdWsfServiceSession::WriteExtensionsAsXMLToL(RWriteStream& aWriteStream) |
|
517 { |
|
518 CSenWebServiceSession::WriteExtensionsAsXMLToL(aWriteStream); |
|
519 |
|
520 if(iProvider) |
|
521 { |
|
522 aWriteStream.WriteL(KProviderID); |
|
523 aWriteStream.WriteL(ProviderId()); |
|
524 aWriteStream.WriteL(KProviderIDEnd); |
|
525 } |
|
526 |
|
527 if(ipResourceId) |
|
528 { |
|
529 aWriteStream.WriteL(KResourceID); |
|
530 aWriteStream.WriteL(*ipResourceId); |
|
531 aWriteStream.WriteL(KResourceIDEnd); |
|
532 } |
|
533 |
|
534 if(ipTrustAnchor) |
|
535 { |
|
536 aWriteStream.WriteL(KTrustAnchor); |
|
537 aWriteStream.WriteL(*ipTrustAnchor); |
|
538 aWriteStream.WriteL(KTrustAnchorEnd); |
|
539 } |
|
540 |
|
541 if(iClientServerInterval.Int64() != 0) |
|
542 { |
|
543 aWriteStream.WriteL(KServiceInterval); |
|
544 TBuf8<64> buf; |
|
545 buf.AppendNum(iClientServerInterval.Int64()); |
|
546 aWriteStream.WriteL(buf); |
|
547 aWriteStream.WriteL(KServiceIntervalEnd); |
|
548 } |
|
549 } |
|
550 |
|
551 // Note: no ref-impl for this method in Java either yet |
|
552 TInt CIdWsfServiceSession::ConstructSecurityTokenL( |
|
553 const TDesC& /* aToken */, |
|
554 HBufC8*& /* aSecurityToken */) |
|
555 { |
|
556 return KErrNotSupported; |
|
557 } |
|
558 |
|
559 // from service instance |
|
560 // NOTE(!): returns KErrNotFound if no known security mechanism was found. |
|
561 TInt CIdWsfServiceSession::InitializeFromL( |
|
562 CIdWsfServiceInstance& aServiceInstance) |
|
563 { |
|
564 TLSLOG(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,(_L("CIdWsfServiceSession::InitializeFromL"))); |
|
565 CSenWebServiceSession::SetSecurityL(KNullDesC8); |
|
566 CSenWebServiceSession::InitializeFromL( |
|
567 (MSenServiceDescription&)aServiceInstance); |
|
568 |
|
569 TPtrC8 providerid = aServiceInstance.ProviderId(); |
|
570 if (providerid.Length()>0) |
|
571 { |
|
572 TPtrC8 endPoint = aServiceInstance.Endpoint(); |
|
573 CIdWsfServiceProvider* pProvider = CIdWsfServiceProvider::NewL(providerid, |
|
574 endPoint); |
|
575 delete iProvider; |
|
576 iProvider = pProvider; |
|
577 } |
|
578 |
|
579 // the description should support one, and only one(!) of mechanisms: |
|
580 |
|
581 if(aServiceInstance.SupportsMechanism(KSecNullBearer)) |
|
582 { |
|
583 TLSLOG(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,(KSecNullBearer())); |
|
584 delete ipSenSecurityMechanism; |
|
585 ipSenSecurityMechanism = KSecNullBearer().AllocL(); |
|
586 } |
|
587 else if(aServiceInstance.SupportsMechanism(KSecTlsBearer)) |
|
588 { |
|
589 TLSLOG(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,(KSecTlsBearer())); |
|
590 delete ipSenSecurityMechanism; |
|
591 ipSenSecurityMechanism = KSecTlsBearer().AllocL(); |
|
592 } |
|
593 else if(aServiceInstance.SupportsMechanism(KSecTlsNull)) |
|
594 { |
|
595 TLSLOG(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,(KSecTlsNull())); |
|
596 delete ipSenSecurityMechanism; |
|
597 ipSenSecurityMechanism = KSecTlsNull().AllocL(); |
|
598 } |
|
599 else if(aServiceInstance.SupportsMechanism(KSecNullNull)) |
|
600 { |
|
601 TLSLOG(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,(KSecNullNull())); |
|
602 delete ipSenSecurityMechanism; |
|
603 ipSenSecurityMechanism = KSecNullNull().AllocL(); |
|
604 } |
|
605 |
|
606 //Added following two conditions for ID-WSF 1.1 support |
|
607 else if(aServiceInstance.SupportsMechanism(KSecNullBearer11)) |
|
608 { |
|
609 TLSLOG(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,(KSecNullBearer11())); |
|
610 delete ipSenSecurityMechanism; |
|
611 ipSenSecurityMechanism = KSecNullBearer11().AllocL(); |
|
612 } |
|
613 else if(aServiceInstance.SupportsMechanism(KSecTlsBearer11)) |
|
614 { |
|
615 TLSLOG(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,(KSecTlsBearer11())); |
|
616 delete ipSenSecurityMechanism; |
|
617 ipSenSecurityMechanism = KSecTlsBearer11().AllocL(); |
|
618 } |
|
619 |
|
620 if(!ipSenSecurityMechanism) |
|
621 { |
|
622 _LIT(KInvalidDate,"19000101:"); //CodeScannerWarnigs |
|
623 TLSLOG(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,(_L("FATAL ERROR in CIdWsfServiceSession::InitializeFromL: \ |
|
624 ipSenSecurityMechanism == NULL!"))); |
|
625 |
|
626 // invalidate the session, because we don't know any mechanism |
|
627 // and we have no credential |
|
628 iValidUntil.Set(KInvalidDate); // way back in history: January 1st 1900 // CodeScannerWarnig |
|
629 SetStatusL(); |
|
630 return KErrNotFound; |
|
631 } |
|
632 |
|
633 if(IsBearerL(*ipSenSecurityMechanism) || IsSAMLL(*ipSenSecurityMechanism)) |
|
634 { |
|
635 TPtrC8 endpoint = Endpoint(); |
|
636 if(endpoint.Length() > 0) |
|
637 { |
|
638 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ," Adding credential, endpoint is:"); |
|
639 TLSLOG(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,(endpoint)); |
|
640 } |
|
641 else |
|
642 { |
|
643 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ," Endpoint <not set>, adding credential."); |
|
644 } |
|
645 |
|
646 CSenCredential* pCredential = (CSenCredential *) aServiceInstance.Credential(); |
|
647 |
|
648 if(pCredential) |
|
649 { |
|
650 /* |
|
651 if(IsBearerL(*ipSenSecurityMechanism)) |
|
652 { |
|
653 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"Sun does not send validUntil, so let's trust Bearer mech creds valid. Service will tell when they do expire"); |
|
654 iValidUntil.Set(_L("22000101:")); |
|
655 pCredential->SetValidUntil(iValidUntil); |
|
656 } |
|
657 */ |
|
658 AddCredentialL(*pCredential); |
|
659 } |
|
660 } |
|
661 |
|
662 TPtrC8 resourceId = aServiceInstance.ResourceId(); |
|
663 HBufC8* pResourceId = resourceId.AllocL(); |
|
664 delete ipResourceId; |
|
665 ipResourceId = pResourceId; |
|
666 SetOptionsFromL(aServiceInstance); |
|
667 |
|
668 /* |
|
669 if(IsBearerL(*ipSenSecurityMechanism)) |
|
670 { |
|
671 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"Sun does not send validUntil, so let's trus Bearer mech creds valid. Service will tell when they do expire"); |
|
672 iValidUntil.Set(_L("22000101:")); // way back in history: January 1st 1900 |
|
673 } |
|
674 */ |
|
675 SetStatusL(); |
|
676 |
|
677 return KErrNone; |
|
678 } |
|
679 |
|
680 TBool CIdWsfServiceSession::IsSAMLL(const TDesC8& aSecMechURI) |
|
681 { |
|
682 TInt index(KErrNotFound); |
|
683 |
|
684 index = aSecMechURI.Find(KSAML); |
|
685 |
|
686 TInt rightPosition = aSecMechURI.Length()-KSAML().Length(); |
|
687 |
|
688 if(rightPosition > 0 && index == rightPosition) |
|
689 { |
|
690 return ETrue; |
|
691 } |
|
692 else |
|
693 { |
|
694 return EFalse; |
|
695 } |
|
696 } |
|
697 |
|
698 TBool CIdWsfServiceSession::IsBearerL(const TDesC8& aSecMechURI) |
|
699 { |
|
700 TInt index(KErrNotFound); |
|
701 |
|
702 index = aSecMechURI.Find(KBEARER); |
|
703 |
|
704 TInt rightPosition = aSecMechURI.Length()-KBEARER().Length(); |
|
705 |
|
706 if(rightPosition > 0 && index == rightPosition) |
|
707 { |
|
708 return ETrue; |
|
709 } |
|
710 else |
|
711 { |
|
712 return EFalse; |
|
713 } |
|
714 } |
|
715 |
|
716 TPtrC8 CIdWsfServiceSession::ProviderId() |
|
717 { |
|
718 if(iProvider) |
|
719 { |
|
720 return iProvider->ProviderId(); |
|
721 } |
|
722 else |
|
723 { |
|
724 return KNullDesC8(); |
|
725 } |
|
726 } |
|
727 |
|
728 TPtrC8 CIdWsfServiceSession::ServiceType() |
|
729 { |
|
730 return CSenWebServiceSession::Contract(); |
|
731 } |
|
732 |
|
733 TInt CIdWsfServiceSession::UpdateFromL(CIdWsfSiuHeader& aHeader) |
|
734 { |
|
735 TInt retVal = KErrNone; |
|
736 |
|
737 if (aHeader.Endpoint().Length()>0) |
|
738 { |
|
739 TPtrC8 endpoint = aHeader.Endpoint(); |
|
740 SetEndPointL(endpoint); |
|
741 } |
|
742 |
|
743 if (aHeader.SecurityMechId().Length()>0) |
|
744 { |
|
745 TPtrC8 securityMechId = aHeader.SecurityMechId(); |
|
746 SetSenSecurityMechanismL(securityMechId); |
|
747 } |
|
748 |
|
749 if (aHeader.Credential()) |
|
750 { |
|
751 CSenWebServiceSession::SetSecurityL(KNullDesC8()); |
|
752 retVal = AddCredentialL(*aHeader.Credential()); |
|
753 } |
|
754 |
|
755 SaveL(); |
|
756 |
|
757 return retVal; |
|
758 } |
|
759 |
|
760 void CIdWsfServiceSession::SetProviderL(CIdWsfServiceProvider *aProvider) |
|
761 { |
|
762 delete iProvider; |
|
763 iProvider = aProvider; |
|
764 CSenWebServiceSession::SetEndPointL(aProvider->Endpoint()); |
|
765 } |
|
766 |
|
767 CIdWsfServiceProvider* CIdWsfServiceSession::Provider() |
|
768 { |
|
769 return iProvider; |
|
770 } |
|
771 |
|
772 void CIdWsfServiceSession::SetResourceIdL(const TDesC8& aURI) |
|
773 { |
|
774 HBufC8* pNew = NULL; |
|
775 if(aURI.Length()>0) |
|
776 pNew = aURI.AllocL(); |
|
777 delete ipResourceId; |
|
778 ipResourceId = pNew; |
|
779 } |
|
780 |
|
781 TPtrC8 CIdWsfServiceSession::ResourceId() |
|
782 { |
|
783 if(ipResourceId) |
|
784 return *ipResourceId; |
|
785 else |
|
786 return KNullDesC8(); |
|
787 } |
|
788 |
|
789 void CIdWsfServiceSession::SetServiceTypeL(const TDesC8& aURI) |
|
790 { |
|
791 if(aURI.Length()>0) |
|
792 { |
|
793 CSenWebServiceSession::SetContractL(aURI); |
|
794 } |
|
795 else |
|
796 { |
|
797 CSenWebServiceSession::SetContractL(KNullDesC8()); |
|
798 } |
|
799 } |
|
800 |
|
801 void CIdWsfServiceSession::SetTrustAnchorL(const TDesC8& aURI) |
|
802 { |
|
803 |
|
804 HBufC8* pNew = NULL; |
|
805 if(aURI.Length()>0) |
|
806 { |
|
807 pNew = aURI.AllocL(); |
|
808 } |
|
809 delete ipTrustAnchor; |
|
810 ipTrustAnchor = pNew; |
|
811 } |
|
812 TPtrC8 CIdWsfServiceSession::TrustAnchor() |
|
813 { |
|
814 if(ipTrustAnchor) |
|
815 return *ipTrustAnchor; |
|
816 else |
|
817 return KNullDesC8(); |
|
818 } |
|
819 |
|
820 void CIdWsfServiceSession::SetSenSecurityMechanismL( |
|
821 const TDesC8& aSenSecurityMechanism) |
|
822 { |
|
823 |
|
824 HBufC8* pNew = NULL; |
|
825 if(aSenSecurityMechanism.Length()>0) |
|
826 pNew = aSenSecurityMechanism.AllocL(); |
|
827 |
|
828 delete ipSenSecurityMechanism; |
|
829 ipSenSecurityMechanism = pNew; |
|
830 } |
|
831 |
|
832 TPtrC8 CIdWsfServiceSession::SenSecurityMechanism() |
|
833 { |
|
834 if(ipSenSecurityMechanism) |
|
835 { |
|
836 return *ipSenSecurityMechanism; |
|
837 } |
|
838 else |
|
839 { |
|
840 return KNullDesC8(); |
|
841 } |
|
842 } |
|
843 |
|
844 // Override the method from SenServiceSession to provide simple search from |
|
845 // list, because ID-WSF service sessions may have several consumers. |
|
846 MSenRemoteServiceConsumer* CIdWsfServiceSession::RemoteConsumerL( |
|
847 const TDesC8& aSenderID) |
|
848 { |
|
849 TInt consumersCount(iConsumerList.Count()); |
|
850 |
|
851 for(TInt i=0; i<consumersCount; i++) |
|
852 { |
|
853 if(iConsumerList[i]->Id() == aSenderID) |
|
854 { |
|
855 return iConsumerList[i]; |
|
856 } |
|
857 } |
|
858 return NULL; // not found |
|
859 } |
|
860 |
|
861 |
|
862 TInt CIdWsfServiceSession::SessionConsumerL( |
|
863 CIdWsfMessage& aMessage, |
|
864 CIdWsfSessionConsumer*& aSessionConsumer) |
|
865 { |
|
866 TInt consumersCount(iConsumerList.Count()); |
|
867 |
|
868 for(TInt i=0; i<consumersCount; i++) |
|
869 { |
|
870 CIdWsfSessionConsumer* pConsumer = |
|
871 (CIdWsfSessionConsumer*) iConsumerList[i]; |
|
872 if (pConsumer->Expects(aMessage.RefToMessageId())) |
|
873 { |
|
874 aSessionConsumer = pConsumer; |
|
875 return KErrNone; |
|
876 } |
|
877 } |
|
878 |
|
879 aSessionConsumer = NULL; // not found |
|
880 return KErrNotFound; |
|
881 } |
|
882 |
|
883 TInt CIdWsfServiceSession::SessionConsumerL(const TDesC8& aSenderID, |
|
884 CIdWsfSessionConsumer*& aSessionConsumer) |
|
885 { |
|
886 aSessionConsumer = (CIdWsfSessionConsumer*) RemoteConsumerL(aSenderID); |
|
887 if(aSessionConsumer) |
|
888 { |
|
889 return KErrNone; |
|
890 } |
|
891 else |
|
892 { |
|
893 return KErrNotFound; |
|
894 } |
|
895 } |
|
896 |
|
897 // SYNC IMPLEMENTATION(!) |
|
898 // aSOAPMessage.IsFault() should always be TRUE. |
|
899 |
|
900 /** |
|
901 * Method checks if ID-WSF framework can handle this fault, if not, then |
|
902 * error is delivered to session consumer |
|
903 */ |
|
904 TInt CIdWsfServiceSession::HandleSoapFaultL(CSenSoapMessage* apSOAPMessage, |
|
905 HBufC8*& aResponse) |
|
906 { |
|
907 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"CIdWsfServiceSession::HandleSoapFaultL [sync]"); |
|
908 |
|
909 TInt retVal(KErrNone); |
|
910 |
|
911 if ( apSOAPMessage ) |
|
912 { |
|
913 |
|
914 CIdWsfMessage& idWsfMessage = (CIdWsfMessage&)*apSOAPMessage; |
|
915 CleanupStack::PushL( apSOAPMessage ); // ownerhip is here |
|
916 |
|
917 TInt answer = CanHandleErrorL(idWsfMessage); |
|
918 |
|
919 if(answer == KErrSenReinitRequired) // ESenReAuthAndResendNeeded |
|
920 { |
|
921 TBool status(EFalse); |
|
922 SetValidator(NULL); |
|
923 iFramework.Manager().NotifyFrameworksL( |
|
924 KDefaultIdWsfFrameworkID, |
|
925 KSenEventIdWsfSessionValidatorRequested); |
|
926 |
|
927 MIdWsfSessionValidator* pValidator = Validator(); |
|
928 if (pValidator) |
|
929 { |
|
930 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KNormalLogLevel ,"* validator is available *"); |
|
931 TInt retVal(KErrNone); |
|
932 iSubmitState = KSubmitStateInvalidCredentials; |
|
933 // invalidate the current session |
|
934 SetStatusL(); |
|
935 iSubmitState = KSubmitStateRevalidationAttempted; |
|
936 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KNormalLogLevel ,_L8("Validator ptr: 0x%x"), pValidator)); |
|
937 |
|
938 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"Looking for session consumer."); |
|
939 CIdWsfSessionConsumer* pConsumer = NULL; |
|
940 |
|
941 // this takes care of messageIDs |
|
942 TInt getConsumerRetVal = SessionConsumerL(idWsfMessage, pConsumer); |
|
943 if(getConsumerRetVal != KErrNone) |
|
944 { |
|
945 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KMinLogLevel , |
|
946 _L8(" - SessionConsumerL returned an error: %d"), |
|
947 getConsumerRetVal)); |
|
948 status = EFalse; |
|
949 } |
|
950 else if(!pConsumer) |
|
951 { |
|
952 // consumer not found |
|
953 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ," - Consumer not found!"); |
|
954 status = EFalse; |
|
955 } |
|
956 else |
|
957 { |
|
958 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,_L8("Revalidating needed"))); |
|
959 retVal = pValidator->ValidateL(*this, *pConsumer); // this actually can call either ASC or DSC |
|
960 status = (retVal == KErrNone) && IsReadyL(); |
|
961 } |
|
962 } |
|
963 |
|
964 #ifdef _SENDEBUG |
|
965 if(status) |
|
966 { |
|
967 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"HandleErrorL: InappropriateCredentials -> TRUE"); |
|
968 } |
|
969 else |
|
970 { |
|
971 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"HandleErrorL: InappropriateCredentials -> FALSE"); |
|
972 } |
|
973 #endif |
|
974 if( !status ) |
|
975 { |
|
976 // notify consumers (applications) about expired connection |
|
977 SetStatusL(); |
|
978 answer = KErrNone; |
|
979 // Change state to "re-validation failed" in order to indicate other, |
|
980 // pending async messages that there is no use re-sending as one lacks |
|
981 // valid credential(s) |
|
982 iSubmitState = KSubmitStateRevalidationFailed; |
|
983 } |
|
984 } |
|
985 |
|
986 if (iSubmitState != KSubmitStateRevalidationFailed && ( answer > KErrNone || answer == KErrSenReinitRequired || answer == KErrSenResendRequired )) |
|
987 { |
|
988 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"CanHandleErrorL == TRUE"); |
|
989 |
|
990 CIdWsfSessionConsumer* pConsumer = NULL; |
|
991 |
|
992 // this takes care of messageIDs |
|
993 retVal = SessionConsumerL(idWsfMessage, pConsumer); |
|
994 if(retVal != KErrNone) |
|
995 { |
|
996 CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed |
|
997 return retVal; |
|
998 } |
|
999 else if(!pConsumer) |
|
1000 { |
|
1001 CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed |
|
1002 // consumer not found |
|
1003 return KErrNotFound; |
|
1004 } |
|
1005 |
|
1006 TDesC8* pBody = pConsumer->BodyL(idWsfMessage.RefToMessageId()); |
|
1007 if (pBody) |
|
1008 { |
|
1009 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"Re-submitting the request"); |
|
1010 retVal = SubmitL(*pBody, KNullDesC8, *pConsumer, aResponse); |
|
1011 } |
|
1012 } |
|
1013 else |
|
1014 { |
|
1015 CSenSoapFault* pDetached = idWsfMessage.DetachFaultL(); |
|
1016 if(pDetached) |
|
1017 { |
|
1018 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"Detached a SOAP fault"); |
|
1019 CleanupStack::PushL(pDetached); |
|
1020 aResponse = pDetached->AsXmlL(); |
|
1021 CleanupStack::PopAndDestroy(); // pDetached |
|
1022 CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed |
|
1023 return KErrSenSoapFault; // this is 2nd OK return code! |
|
1024 } |
|
1025 else |
|
1026 { |
|
1027 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"No SOAP fault was received."); |
|
1028 retVal = KErrSenInternal; |
|
1029 } |
|
1030 } |
|
1031 CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed |
|
1032 } |
|
1033 |
|
1034 return retVal; |
|
1035 } |
|
1036 |
|
1037 /** |
|
1038 * Method checks if ID-WSF framework can handle this fault, if not, then |
|
1039 * error is delivered to session consumer |
|
1040 */ |
|
1041 TInt CIdWsfServiceSession::HandleSoapFaultL(CSenSoapMessage* apSOAPMessage, |
|
1042 const TInt aErrorCode, |
|
1043 const TInt aTxnId, |
|
1044 MSenRemoteServiceConsumer& aConsumer, |
|
1045 MSenProperties* aResponseTransportProperties) |
|
1046 { |
|
1047 CSLOG_L(aConsumer.ConnectionId() ,KMinLogLevel ,"CIdWsfServiceSession::HandleSoapFaultL [async]"); |
|
1048 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::HandleSoapFaultL [async]"); |
|
1049 |
|
1050 TInt retVal(KErrNone); |
|
1051 |
|
1052 if ( apSOAPMessage ) |
|
1053 { |
|
1054 CIdWsfMessage& idWsfMessage = (CIdWsfMessage&)*apSOAPMessage; |
|
1055 CleanupStack::PushL( apSOAPMessage ); // ownerhip is here |
|
1056 |
|
1057 TInt answer = CanHandleErrorL(idWsfMessage); |
|
1058 if ( answer > KErrNone || answer == KErrSenReinitRequired || answer == KErrSenResendRequired ) |
|
1059 { |
|
1060 CSLOG_L(aConsumer.ConnectionId(), KNormalLogLevel ,"CanHandleErrorL == TRUE"); |
|
1061 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"CanHandleErrorL == TRUE"); |
|
1062 |
|
1063 aConsumer.HandleErrorL(NULL, answer, aTxnId, aResponseTransportProperties); |
|
1064 } |
|
1065 else |
|
1066 { |
|
1067 CSenSoapFault* pDetached = idWsfMessage.DetachFaultL(); |
|
1068 if(pDetached) |
|
1069 { |
|
1070 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"Detached a SOAP fault"); |
|
1071 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"Detached a SOAP fault"); |
|
1072 CleanupStack::PushL(pDetached); |
|
1073 // pass KErrSenSoapFault // which is 2nd "OK" return code! |
|
1074 HBufC8* pAsXml = pDetached->AsXmlL(); |
|
1075 if(pAsXml) |
|
1076 { |
|
1077 aConsumer.HandleErrorL(pAsXml, KErrSenSoapFault, aTxnId, aResponseTransportProperties); |
|
1078 } |
|
1079 CleanupStack::PopAndDestroy(); // pDetached |
|
1080 retVal = KErrNone; // OK |
|
1081 } |
|
1082 else |
|
1083 { |
|
1084 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"No SOAP fault was received."); |
|
1085 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"No SOAP fault was received."); |
|
1086 aConsumer.HandleErrorL(NULL, aErrorCode, aTxnId, aResponseTransportProperties); |
|
1087 retVal = KErrSenInternal; // one *could* pass on the orig error code |
|
1088 } |
|
1089 } |
|
1090 CleanupStack::PopAndDestroy( apSOAPMessage ); // not needed |
|
1091 } |
|
1092 |
|
1093 return retVal; |
|
1094 } |
|
1095 |
|
1096 TInt CIdWsfServiceSession::CanHandleErrorL(CIdWsfMessage& aMessage) |
|
1097 { |
|
1098 TInt answer(KErrNone); |
|
1099 |
|
1100 const TDesC8* pCode = aMessage.StatusCodeL(); |
|
1101 |
|
1102 if(pCode) |
|
1103 { |
|
1104 if(SenXmlUtils::EndsWith(*pCode, KStatusEndpointMoved)) |
|
1105 { |
|
1106 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"CanHandleErrorL: Endpoint moved -> TRUE"); |
|
1107 // We could probably re-submit the body of our outgoing message |
|
1108 // check if we received a SIU header with an endpoint |
|
1109 CIdWsfSiuHeader* pSIUHeader = aMessage.SiuHeader(); |
|
1110 if(pSIUHeader && pSIUHeader->Endpoint().Length() > 0) |
|
1111 { |
|
1112 answer = KErrSenResendRequired; // ESenResendNeeded; |
|
1113 } |
|
1114 } |
|
1115 else if(SenXmlUtils::EndsWith(*pCode, KStatusInappropriateCredentials)) |
|
1116 { |
|
1117 _LIT(KInvalidDate,"18000101:"); |
|
1118 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"CanHandleErrorL: InappropriateCredentials -> invalidating this session"); |
|
1119 // ensure that session is CERTAINLY INVALID! |
|
1120 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KMinLogLevel , |
|
1121 _L8("Credentials expired. Handling SOAP fault %S"), |
|
1122 &KStatusInappropriateCredentials() )); |
|
1123 |
|
1124 iValidUntil.Set(KInvalidDate); // way way back in history: January 1st 1800 //CodescannerWarnings |
|
1125 |
|
1126 |
|
1127 if (iSubmitState == KSubmitStateOK) |
|
1128 { |
|
1129 // Clear the current validator |
|
1130 SetValidator(NULL); |
|
1131 iFramework.Manager().NotifyFrameworksL( |
|
1132 KDefaultIdWsfFrameworkID, |
|
1133 KSenEventIdWsfSessionValidatorRequested); |
|
1134 |
|
1135 MIdWsfSessionValidator* pValidator = Validator(); |
|
1136 if (pValidator) |
|
1137 { |
|
1138 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KNormalLogLevel ,"* validator is available *"); |
|
1139 iSubmitState = KSubmitStateInvalidCredentials; |
|
1140 // Invalidate the current session |
|
1141 SetStatusL(); |
|
1142 iSubmitState = KSubmitStateRevalidationAttempted; |
|
1143 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KNormalLogLevel ,_L8("Validator ptr: 0x%x"), pValidator)); |
|
1144 |
|
1145 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"Looking for session consumer."); |
|
1146 CIdWsfSessionConsumer* pConsumer = NULL; |
|
1147 |
|
1148 // This takes care of messageIDs |
|
1149 TInt getConsumerRetVal = SessionConsumerL(aMessage, pConsumer); |
|
1150 if(getConsumerRetVal != KErrNone) |
|
1151 { |
|
1152 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KMinLogLevel , |
|
1153 _L8(" - SessionConsumerL returned an error: %d"), |
|
1154 getConsumerRetVal)); |
|
1155 answer = KErrNone; |
|
1156 } |
|
1157 else if(!pConsumer) |
|
1158 { |
|
1159 // Consumer not found |
|
1160 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ," - Consumer not found!"); |
|
1161 answer = KErrNone; |
|
1162 } |
|
1163 else |
|
1164 { |
|
1165 TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,_L8("- Revalidation needed"))); |
|
1166 answer = KErrSenReinitRequired; // ESenReAuthAndResendNeeded; |
|
1167 } |
|
1168 } |
|
1169 |
|
1170 } |
|
1171 else if ( iSubmitState == KSubmitStateRevalidationAttempted ) |
|
1172 { |
|
1173 // Another message already triggered the re-validation phase, |
|
1174 // so: this operation requires re-sending only |
|
1175 answer = KErrSenResendRequired; // ESenResendNeeded; |
|
1176 iSubmitState = KSubmitStateRevalidationFailed; //ESenResend |
|
1177 } |
|
1178 //else if ( iSubmitState == KSubmitSateResend ) |
|
1179 // { |
|
1180 // answer = KErrSenResendComplete; //ESenResendFailed |
|
1181 // iSubmitState = KSubmitSateResendFailed; //ESenResendFailed |
|
1182 // } |
|
1183 } |
|
1184 } |
|
1185 |
|
1186 return answer; |
|
1187 } |
|
1188 |
|
1189 TBool CIdWsfServiceSession::Matches(MSenServiceDescription& aPattern) |
|
1190 { |
|
1191 TBool matches = CSenWebServiceSession::Matches(aPattern); |
|
1192 |
|
1193 // for now the only interesting facet is the messageThread facet |
|
1194 // if this session uses messageThreads it should not match any |
|
1195 // description, as it essentially makes the session unique |
|
1196 // (unless nobody is using this session). |
|
1197 if (iMessageThread && HasConsumer()) |
|
1198 { |
|
1199 // a new session is needed in any case |
|
1200 matches = EFalse; |
|
1201 } |
|
1202 else |
|
1203 { |
|
1204 TBool hasFacet(EFalse); |
|
1205 TInt leaveCode(KErrNone); |
|
1206 TRAP( leaveCode, aPattern.HasFacetL(KMessageThread, hasFacet); ) |
|
1207 if (leaveCode != KErrNone) |
|
1208 { |
|
1209 TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KMinLogLevel ,"CIdWsfServiceSession::Matches - HasFacetL() leaved!"); |
|
1210 matches = EFalse; |
|
1211 } |
|
1212 if (hasFacet) |
|
1213 { |
|
1214 if (matches && !HasConsumer()) matches = ETrue; |
|
1215 else matches = EFalse; |
|
1216 } |
|
1217 } |
|
1218 return matches; |
|
1219 } |
|
1220 |
|
1221 void CIdWsfServiceSession::CopyFacetsFromL(MSenServiceDescription& aPattern) |
|
1222 { |
|
1223 aPattern.HasFacetL(KMessageThread,iMessageThread); |
|
1224 |
|
1225 if (iMessageThread) |
|
1226 { |
|
1227 CSenFacet* pNewFacet = CSenFacet::NewL(); |
|
1228 CleanupStack::PushL(pNewFacet); |
|
1229 pNewFacet->SetValueL(KSenFacetValTrue); |
|
1230 SetFacetL(*pNewFacet); |
|
1231 CleanupStack::Pop(); // pNewFacet |
|
1232 } |
|
1233 else |
|
1234 { |
|
1235 RemoveFacet(KMessageThread); |
|
1236 } |
|
1237 } |
|
1238 |
|
1239 TInt CIdWsfServiceSession::SetOptionsFromL(MSenServiceDescription& aPattern) |
|
1240 { |
|
1241 RFacetArray options; |
|
1242 CleanupClosePushL(options); |
|
1243 |
|
1244 CIdWsfDiscoveryServiceClient::DSOptionsL(options, aPattern); |
|
1245 if (options.Count() > 0) |
|
1246 { |
|
1247 TInt count(options.Count()); |
|
1248 for (TInt i=0; i<count; i++) |
|
1249 { |
|
1250 SetFacetL(*options[i]); |
|
1251 } |
|
1252 } |
|
1253 options.ResetAndDestroy(); |
|
1254 CleanupStack::Pop(); //options |
|
1255 |
|
1256 return KErrNone; |
|
1257 } |
|
1258 |
|
1259 void CIdWsfServiceSession::StartTransaction() |
|
1260 { |
|
1261 iMessageThread = ETrue; |
|
1262 } |
|
1263 |
|
1264 void CIdWsfServiceSession::TransactionCompleted() |
|
1265 { |
|
1266 delete ipReceivedMessageId; |
|
1267 ipReceivedMessageId = NULL; |
|
1268 } |
|
1269 |
|
1270 void CIdWsfServiceSession::SetValidator(MIdWsfSessionValidator* aValidator) |
|
1271 { |
|
1272 ipValidator = aValidator; |
|
1273 } |
|
1274 |
|
1275 MIdWsfSessionValidator* CIdWsfServiceSession::Validator() |
|
1276 { |
|
1277 return ipValidator; |
|
1278 } |
|
1279 |
|
1280 TInt CIdWsfServiceSession::SendL( const TDesC8& aMessage, |
|
1281 const TDesC8& aTransportProperties, |
|
1282 MSenRemoteServiceConsumer& aConsumer, |
|
1283 TInt& aTxnId, |
|
1284 HBufC8*& aRevalidationError ) |
|
1285 { |
|
1286 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SendL"); |
|
1287 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SendL"); |
|
1288 // Temporary START |
|
1289 MSenTransport& transport = aConsumer.TransportL(); |
|
1290 SetFrameworkPropertiesL( transport ); // retVal surpressed |
|
1291 // Temporary END |
|
1292 TInt retVal = CSenWebServiceSession::SendL( aMessage, aTransportProperties, aConsumer, aTxnId, aRevalidationError ); |
|
1293 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SendL:"); |
|
1294 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SendL:"); |
|
1295 CSLOG_FORMAT((aConsumer.ConnectionId(), KNormalLogLevel , _L8("- Return value from CSenWebServiceSession::SendL %d: "), retVal)); |
|
1296 //TLSLOG_FORMAT(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,(_L8("- Return value from CSenWebServiceSession::SendL %d: "), retVal)); |
|
1297 CSLOG_FORMAT((aConsumer.ConnectionId(), KNormalLogLevel , _L8("- Transaction ID (from transport): %d"), aTxnId)); |
|
1298 //TLSLOG_FORMAT(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,(_L8("- Transaction ID (from transport): %d"), aTxnId)); |
|
1299 return retVal; |
|
1300 } |
|
1301 |
|
1302 TInt CIdWsfServiceSession::SubmitL( const TDesC8& aMessage, |
|
1303 const TDesC8& aTransportProperties, |
|
1304 MSenRemoteServiceConsumer& aConsumer, |
|
1305 HBufC8*& aResponse ) |
|
1306 { |
|
1307 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SubmitL"); |
|
1308 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SubmitL"); |
|
1309 MSenTransport& transport = aConsumer.TransportL(); |
|
1310 SetFrameworkPropertiesL(transport); // retVal surpressed |
|
1311 TInt retVal = CSenWebServiceSession::SubmitL( aMessage, aTransportProperties, aConsumer, aResponse); |
|
1312 if (retVal == KErrNone) |
|
1313 { |
|
1314 iSubmitState = KSubmitStateOK; |
|
1315 } |
|
1316 return retVal; |
|
1317 } |
|
1318 |
|
1319 TInt CIdWsfServiceSession::SetStatusL() |
|
1320 { |
|
1321 // check if we are re-submitting |
|
1322 if ( iSubmitState == KSubmitStateInvalidCredentials ) |
|
1323 { |
|
1324 TInt count(iConsumerList.Count()); |
|
1325 |
|
1326 // Create a local array to hold pointer(s) to consumer(s) |
|
1327 RServiceConsumerArray consumerList; |
|
1328 CleanupClosePushL(consumerList); |
|
1329 |
|
1330 // Copy the consumers into temporary array |
|
1331 for (TInt i=0; i<count; i++) |
|
1332 { |
|
1333 TInt errorCode = consumerList.Append(iConsumerList[i]); |
|
1334 if(errorCode!=KErrNone) |
|
1335 { |
|
1336 User::Leave(errorCode); // out-of-memory occurred |
|
1337 } |
|
1338 } |
|
1339 // Clear the actual array to prevent false |
|
1340 // callbacks to SetStatusL() etc: |
|
1341 iConsumerList.Reset(); |
|
1342 |
|
1343 // Now it is safe to calculate the status |
|
1344 TInt retVal = CSenWebServiceSession::SetStatusL(); |
|
1345 |
|
1346 // The iConsumerList may be populated with original |
|
1347 // consumer(s) |
|
1348 for ( TInt j = 0; j < count; j++ ) |
|
1349 { |
|
1350 iConsumerList.Append(consumerList[j]); |
|
1351 } |
|
1352 |
|
1353 // Reset the temporary array and let it go out of scope |
|
1354 consumerList.Reset(); |
|
1355 CleanupStack::Pop(); //consumerList |
|
1356 return retVal; |
|
1357 } |
|
1358 |
|
1359 // Note: call to SetStatusL() can always result consumers being |
|
1360 // notified of their state changed |
|
1361 return CSenWebServiceSession::SetStatusL(); |
|
1362 } |
|
1363 |
|
1364 /* |
|
1365 * ID-WSF always expect that consumer application is providing the application body only. |
|
1366 * So, we are extracting the Soap body from aSoapMessage and SendL of |
|
1367 * ID-WSF has been called |
|
1368 */ |
|
1369 TInt CIdWsfServiceSession::SendSoapL( const TDesC8& aSoapMessage, |
|
1370 const TDesC8& aTransportProperties, |
|
1371 MSenRemoteServiceConsumer& aConsumer, |
|
1372 TInt& aTxnId, |
|
1373 HBufC8*& aRevalidationError ) |
|
1374 { |
|
1375 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SendSoapL(TDesC8&, ...)"); |
|
1376 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SendSoapL(TDesC8&, ...)"); |
|
1377 |
|
1378 TInt retVal(KErrNone); |
|
1379 CSenXmlReader* pReader = iFramework.Manager().XMLReader(); // re-use the XML reader instance owned by core |
|
1380 CSenSoapMessage* pMsg = CSenSoapMessage::NewL(); |
|
1381 CleanupStack::PushL( pMsg ); |
|
1382 pMsg->SetReader( *pReader ); |
|
1383 pReader->SetContentHandler( *pMsg ); |
|
1384 TInt leaveCode( KErrNone ); |
|
1385 TRAP( leaveCode, pMsg->ParseL( aSoapMessage ); ) |
|
1386 if ( leaveCode ) |
|
1387 { |
|
1388 CSLOG_FORMAT((aConsumer.ConnectionId(), KMinLogLevel , _L8("- Parsing descriptor into SOAP-MSG object failed, leave code: %d"), leaveCode )); |
|
1389 //TLSLOG_FORMAT(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,( _L("- Parsing descriptor into SOAP-MSG object failed, leave code: %d"), leaveCode )); |
|
1390 CleanupStack::PopAndDestroy( pMsg ); // de-alloc the SOAP-MSG object immediately |
|
1391 retVal = leaveCode; |
|
1392 } |
|
1393 else // parsing ok |
|
1394 { |
|
1395 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- Successfully parsed descriptor into SOAP-MSG."); |
|
1396 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"- Successfully parsed descriptor into SOAP-MSG."); |
|
1397 HBufC8* pHttpBody = pMsg->BodyAsStringL(); // extract the SOAP body |
|
1398 CleanupStack::PopAndDestroy( pMsg ); |
|
1399 CleanupStack::PushL( pHttpBody ); |
|
1400 retVal = SendL( *pHttpBody, aTransportProperties, aConsumer, aTxnId, aRevalidationError ); |
|
1401 CleanupStack::PopAndDestroy( pHttpBody ); // assert in proper order |
|
1402 } |
|
1403 return retVal; |
|
1404 } |
|
1405 |
|
1406 /* |
|
1407 * ID-WSF always expect that consumer application is providing the application body only. |
|
1408 * So, we are extracting the Soap body from aSoapMessage and SubmitL of |
|
1409 * ID-WSF has been called |
|
1410 */ |
|
1411 TInt CIdWsfServiceSession::SubmitSoapL( const TDesC8& aSoapMessage, |
|
1412 const TDesC8& aTransportProperties, |
|
1413 MSenRemoteServiceConsumer& aConsumer, |
|
1414 HBufC8*& aResponse ) |
|
1415 { |
|
1416 #ifdef _SENDEBUG |
|
1417 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"CIdWsfServiceSession::SubmitSoapL(TDesC8, ..."); |
|
1418 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"CIdWsfServiceSession::SubmitSoapL(TDesC8, ..."); |
|
1419 CSLOG_L(aConsumer.ConnectionId(), KMaxLogLevel ,"///////////////////////////////////////////////////////"); |
|
1420 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"///////////////////////////////////////////////////////"); |
|
1421 CSLOG_FORMAT((aConsumer.ConnectionId(), KMaxLogLevel , _L8("- Message (%d bytes):"), aSoapMessage.Length())); |
|
1422 //TLSLOG_FORMAT(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,(_L8("- Message (%d bytes):"), aSoapMessage.Length())); |
|
1423 CSLOG_ALL(aConsumer.ConnectionId(), KMaxLogLevel ,(aSoapMessage)); |
|
1424 //TLSLOG_ALL(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,(aSoapMessage)); |
|
1425 CSLOG_L(aConsumer.ConnectionId(), KMaxLogLevel ,"///////////////////////////////////////////////////////"); |
|
1426 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"///////////////////////////////////////////////////////"); |
|
1427 #endif |
|
1428 TInt retVal(KErrNone); |
|
1429 CSenXmlReader* pReader = iFramework.Manager().XMLReader(); // re-use the XML reader instance owned by core |
|
1430 CSenSoapMessage* pMsg = CSenSoapMessage::NewL(); |
|
1431 CleanupStack::PushL( pMsg ); |
|
1432 pMsg->SetReader( *pReader ); |
|
1433 pReader->SetContentHandler( *pMsg ); |
|
1434 TInt leaveCode( KErrNone ); |
|
1435 TRAP( leaveCode, pMsg->ParseL( aSoapMessage ); ) |
|
1436 if ( leaveCode ) |
|
1437 { |
|
1438 CSLOG_FORMAT((aConsumer.ConnectionId(), KMinLogLevel , _L8("- Parsing descriptor into SOAP-MSG object failed, leave code: %d"), leaveCode )); |
|
1439 //TLSLOG_FORMAT(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,( _L("- Parsing descriptor into SOAP-MSG object failed, leave code: %d"), leaveCode )); |
|
1440 CleanupStack::PopAndDestroy( pMsg ); // de-alloc the SOAP-MSG object immediately |
|
1441 retVal = leaveCode; |
|
1442 } |
|
1443 else // parsing ok |
|
1444 { |
|
1445 CSLOG_L(aConsumer.ConnectionId(), KMinLogLevel ,"- Successfully parsed descriptor into SOAP-MSG."); |
|
1446 //TLSLOG_L(KSenCoreServiceManagerLogChannelBase , KSenCoreServiceManagerLogLevel ,"- Successfully parsed descriptor into SOAP-MSG."); |
|
1447 HBufC8* pHttpBody = pMsg->BodyAsStringL(); //Extracting the body |
|
1448 CleanupStack::PopAndDestroy( pMsg ); |
|
1449 CleanupStack::PushL( pHttpBody ); |
|
1450 retVal = SubmitL(*pHttpBody, aTransportProperties, aConsumer, aResponse); |
|
1451 CleanupStack::PopAndDestroy( pHttpBody ); // assert proper order |
|
1452 } |
|
1453 return retVal; |
|
1454 } |
|
1455 |
|
1456 |
|
1457 TBool CIdWsfServiceSession::HasSuperClass( TDescriptionClassType aType ) |
|
1458 { |
|
1459 if ( aType == MSenServiceDescription::EWebServiceSession ) // direct superclass! |
|
1460 { |
|
1461 // If asked type is the know *direct* father/mother, return true: |
|
1462 return ETrue; |
|
1463 } |
|
1464 else |
|
1465 { |
|
1466 // Otherwise, ask from superclass (chain, recursively) |
|
1467 return CSenWebServiceSession::HasSuperClass( aType ); |
|
1468 } |
|
1469 } |
|
1470 |
|
1471 // Temporary |
|
1472 TInt CIdWsfServiceSession::SetFrameworkPropertiesL(MSenTransport& aTransport) |
|
1473 { |
|
1474 return iFramework.SetTransportPropertiesL(aTransport); |
|
1475 } |
|
1476 |
|
1477 void CIdWsfServiceSession::FillCredentialIdentifierL(CSenCredentialIdentifier& aIdentifier) |
|
1478 { |
|
1479 CSenWebServiceSession::FillCredentialIdentifierL(aIdentifier); |
|
1480 |
|
1481 _LIT8(KProviderIdElementLocalName, "ProviderID"); |
|
1482 aIdentifier.SetPropertyL(KProviderIdElementLocalName, ProviderId()); |
|
1483 } |
|
1484 |
|
1485 |
|
1486 // End of file |
|
1487 |
|
1488 |