Boolean User Properties always returns TRUE
Hi, I am trying to get some propeties from the user on the AD and I found out with the following issue, all the boolean attributes always return TRUE as value. The Code that I am using to extract them is the following
foreach ($objUser in $objUsers)
$bolPasswordNeverExpires = [boolean] $objUser.Properties['PasswordNeverExpires'];
$bolEnabled = [boolean] $objUser.Properties['Enabled'];
$bolAccountExpired = [boolean] $objUser.Properties['AccountExpired'];
Could you please guide me into the proper direction to solve it. I looked up in most of powershell related topic and did not find a way to solve it. I even attempt using UserAccountControl Attribute to check Enabled status do not matter agains which value
I check it, it always returns TRUE.
Thank´s for the tip. Unluckily when I attempt it, if I left only
$objUsers.PasswordNeverExpires or $objUsers.Enabled, it only return whites spaces and no comparison from True or False is feasible.
If I change it to [boolean] $objUsers.PasswordNeverExpires or $objUsers.Enabled instead of using the Properties option, it returns False for all values.
I attempt to use the UserAccountControl field for look up the property Ex: (objUser.UserAccountControl AND 2) for Enabled and it also returns True for all situation
I look up for the properties on the ISE interface and the only ones displayed are the following ones:
distinguishedname
displayname
whencreated
samaccountname
sn
accountexpires
pwdlastset
samaccounttype
adspath
useraccountcontrol
whenchanged
cn
userprincipalname
lastlogontimestamp
msds-user-account-control-computed
May it be an issue with the filter that does not load the specified properties?
Similar Messages
-
CI - Powershell Boolean Rule Always Returns True
I'm trying to create a configuration baseline / item for a particular piece of software using a powershell script of data type Boolean. However, I'm having the issue that the evaluation is always returning compliant whether the workstation is or not. The
script is as follows:
$ErrorActionPreference = "SilentlyContinue"
$Condition1 = (Test-Path -LiteralPath 'HKLM:\SOFTWARE\Adobe\Premiere Pro')
$Condition2 = (Test-Path -LiteralPath 'C:\Program Files\Adobe\Adobe Premiere Pro CS6\Presets\Textures\720_govt1_bar.png')
if ($Condition1) {
if ($Condition2) {echo $true}
else {echo $false}
else {echo $true}
This script works perfectly fine when run locally and always returns $true or $false as expected. However it only ever returns Compliant when used in a CI. It doesn't matter what the state of the 2 conditions are, it always evaluates Compliant.
Any ideas?I'm beginning to wonder if there is variation between how well this feature works on Windows 7 and Windows 8.1. I'm beginning to notice that it usually works well on 7 but I have constant hell with it on 8. The last thing I tried which seemed to work (assuming
it was not just randomness) was accepting the default "Platform" settings of the CI/CB. Before I had chosen Windows 7 and 8.1 only and was never able to return any value except Compliant on 8. Accepting the all platforms default Finally
allowed me to show a state of Non-Compliant on 8. This was using a powershell script of string data type as discussed previously.
My latest torment is discovering how to force a true re-evaluation of an updated CI/CB. In my non-compliant Win8 example, I have added a remediation script to an existing Monitor-Only CI and configured it to remediate. In my Win 7 members of the collection,
everything works successfully, the condition is remediated and the state reports Compliant but on the Win8, although the local Control Panel applet shows both the CB and CI to have new revisions and the evaluation shows it has run with a new date/time,
the remediation script never runs and changes to Compliant.
Any suggestions how I can force an updated CI/CB to really re-evaluate, not just report it has? -
HasEventListener and willTrigger always return true
Hi everybody.
I'm trying to achieve the following result.
I'm listing all items in a form.
When I encounter a button I check if it has already an event listener applied to it. If not , I apply the event Listener with addEventListener.
In this way, the next time I'll list the whole form I won't apply the event listener another time (if for example I apply the same event listener twice to a button which insert a new record in a database as result I'll have 2 records added also if the user clicked once...no good at all!!!)
To accomplish this task I'm using the Actionscript function hasEventListener(EventType) and here comes the weird thing.
Eveytime I invoke hasEventListener on the form's button it always returns true event if is the first time a list the form (so no event listener applied yet) , even if before to invoke hasEventListener I run removeEventListener.
I've got the same behavior when i use willTrigger() function, it always returns true no matter when i call it.
One possible solution could be set a global boolean property to store if Ialready listed the form and applied the event listener to it, but it would be better using hasEventListener, because I've got a class that perform this form listing , and this class is used on wide project, so if I get to fix this problem inside the class I would fix the problem in the entire project in on shot (I love oop programming!!!!)
Has anybody already addressed this problem?
Any advisement would be really appreciated.
Thanks in advance for the attention.
Best regards!!
LukeHi, flex harUI.
Thanks very much for your reply.
I knew that if I apply an event listener twice it should fire up only once, but this isn't what happen.
Here's my scenario:
- I've got a component with the form inside it
- Through a menu a go to the state the component is in and I call an "init" function inside the component
- In the init function I call the Class which activate the form by applying eventlistener on the button
- The user can navigate away from the component by click another menu item and then return to the component invoking again the form activation (and so let my application apply once again the addEventListener)
- Here's what happen: the second,third,... time the user return to the component, when he try - for example - to add a record, the record is added two,three... times according to how many times the users "reinitialized" the component. The same things happen when the user tries to delete a record, he is prompted two,three,.... times if he's sure to delete it.....
It's a really strange behaviour.
I've found i worked around, by setting a global bool var "initialized" and before call the form activation i check the value of this var, but It's not a very beautiful solution, 'cause I would prefer to fix this problem inside the class, so the fix the problem in the whole project just in one shot!!! (that's why I would like to use hasEventListener() to check if the button has already an eventListener)
Thaks anyway for the reply!
If I've some news I'll update ya.
Bye! -
HST65_DUTCH: Not_On_Stack_Yes always returns True
Hello,
It seems that the Not_On_Stack_Yet always returns true.
I used some trace commands to show the uk1 value in the Debug Monitor and everything seems right, allthough I get always a true... And prior to my trace output I see that funtion to validate if the BR is needed and I see the BR is added.
Could you confirm the Not_On_Stack_Yet is working properly.
I went through through the Headstart code myself, this are my remarks:
- See nothing strange !!
- The add_rule checks if the rule is allready on the stack. If not, the br will be added. The add_rule doens't uses the Not_On_Stack_Yet function !!!!!
Thanks for your help,
Marcel OverdijkMarc,
I made the following example. It's NOT working.
* 2 BusinessRules:
BR_JNT001_MOD (insert, update, delete)
BR_JNT002_TPL (insert, update)
Trigger When Condition
qms_transaction_mgt.not_on_stack_yet
( p_br_name => 'BR_JNT001_MOD'
, p_uk_comp1 => to_char(:new.bdt_id)
, p_uk_comp2 => to_char(:new.volgnummer)
* Debug Output:
19:17:41 - QMS_TRANSACTION_MGT.ADD_BUSINESS_RULE BR_JNT002_TPL
19:17:41 - MAS_DEV.MAS_JNT_CAPI.need_br_jnt002_tpl (f)
19:17:41 - QMS_TRANSACTION_MGT.ADD_BUSINESS_RULE BR_JNT001_MOD
19:17:41 - MAS_DEV.MAS_JNT_CAPI.need_br_jnt001_mod (f)
* PK components of table.
PROMPT Creating Primary Key on 'MAS_JOURNAALPOSTEN'
ALTER TABLE MAS_JOURNAALPOSTEN
ADD (CONSTRAINT MAS_JNT_PK PRIMARY KEY
(BDT_ID
,VOLGNUMMER))
* Need function in capi
function need_br_jnt002_tpl
return boolean
is
l_when_condition boolean;
l_updating boolean;
l_dml_operations boolean;
begin
trace('need_br_jnt002_tpl (f)');
l_when_condition := qms_transaction_mgt.not_on_stack_yet
( p_br_name => 'BR_JNT001_MOD'
, p_uk_comp1 => to_char(g_current_row.bdt_id)
, p_uk_comp2 => to_char(g_current_row.volgnummer)
g_current_ind.brutobedrag
:= g_current_ind.brutobedrag
and
(g_current_row.brutobedrag
<> g_current_old_row.brutobedrag
or
(g_current_row.brutobedrag is null
and
g_current_old_row.brutobedrag is not null
or
(g_current_row.brutobedrag is not null
and
g_current_old_row.brutobedrag is null
g_current_ind.btw_bedrag
:= g_current_ind.btw_bedrag
and
(g_current_row.btw_bedrag
<> g_current_old_row.btw_bedrag
or
(g_current_row.btw_bedrag is null
and
g_current_old_row.btw_bedrag is not null
or
(g_current_row.btw_bedrag is not null
and
g_current_old_row.btw_bedrag is null
g_current_ind.nettobedrag
:= g_current_ind.nettobedrag
and
(g_current_row.nettobedrag
<> g_current_old_row.nettobedrag
or
(g_current_row.nettobedrag is null
and
g_current_old_row.nettobedrag is not null
or
(g_current_row.nettobedrag is not null
and
g_current_old_row.nettobedrag is null
l_updating := g_updating
and (g_current_ind.brutobedrag
or
g_current_ind.btw_bedrag
or
g_current_ind.nettobedrag
l_dml_operations := g_inserting
or l_updating
if br_enabled('BR_JNT002_TPL')
then
return l_when_condition
and
(g_validate_all_static
or
l_dml_operations
else
return false;
end if; -- br_enabled
end need_br_jnt002_tpl; -
Exchange 2007 SP2: HasActiveSyncDevicePartnership Always Returns True
I am currently work with a customer in an Exchange Server 2007 SP2 environment. A Powershell script that is used for gathering mobile device information begins with at the mailbox level and filters with
HasActiveSyncDevicePartnership equal to true, as in -
Get-casmailbox -Filter {HasActivesyncDevicePartnership -eq $true }
We have discovered that it appears as though this flag is set to true for every mailbox account, despite the fact that only a few mailboxes have actual EAS partnerships with devices.
My understanding was that this flag should only ever return true if there is an actual ActiveSync partnership. Is there something I am missing here? Can the flag be true even if there is no (or has never been) a partnership?
Don Sorcinelli - Microsoft MVP, Mobile DevicesHi,
Yes, the value of the " HasActiveSyncDevicePartnership " will be set to true if there is an actual ActiveSync partnership. Also you can use the following command to
check the detail sync information such as device name, last sync time:
Get-ActivesyncDeviceStatistics -Mailbox [email protected]
If no statistics information returns, The most probable cause
should be that someone set the HasActiveSyncDevicePartnership to true for all mailbox users accidently. Please run the following command to change them back:
get-casmailbox |set-casmailbox -HasActivesyncDevicePartnership $false
Then set the
HasActiveSyncDevicePartnership to true for the users who have an actual ActiveSync partnership:
Set-casmailbox –identity
[email protected] -HasActivesyncDevicePartnership $true
Gen Lin
TechNet Subscriber Support
in forum
If you have any feedback on our support, please contact
[email protected]
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Thanks
Gen Lin-MSFT -
List E .add always returns true (or throws)?
http://download.java.net/jdk6/docs/api/java/util/List.html#add(E)
"Returns:
true (as specified by Collection.add(E))"
but http://download.java.net/jdk6/docs/api/java/util/Collection.html#add(E)
"Returns:
true if this collection changed as a result of the call"
and also says, "(Returns false if this collection does not permit duplicates and already contains the specified element.)"
I am implementing a list that doesn't allow duplicate elements -- which the List<E> doc says "is not inconceivable ... but we expect this usage to be rare." My rarity notwithstanding, I don't understand the parenthetical remark in the Returns doc for List, and I don't know whether to return false or throw if an attempt is made to add a duplicate to my list.Err... stupid me! I totally forgot about LinkedHashSet which looks like it will solve your problem directly, with no code!
Meanwhile, a question arose on my reading of the
javadoc on LinkedHashMap. It says, "It can be used
to produce a copy of a set that has the same order as
the original, regardless of the original set's
implementation:void foo(Set m) {
Set copy = new LinkedHashSet(m);
}I don't understand how the LinkedHashSet copy
constructor can produce a copy that "has the same
order" unless the implementation of the original set
-- in particular, I guess, its iterator -- guarantees
some ordering. But then that would contradict
"regardless of the original set's implementation."Looking at the implementation, I would suggest that the JavaDoc is poorly worded. What it means is that this copy constructor will copy everything out of the first set into the new set and the order of the new set will be consistent with the order of the elements returned by the first set's iterator. (Which, of course, is likely to be undefined for the majority of Set implementations.) -
KAudioSessionProperty_OtherAudioIsPlaying Always Returns True
I have followed as many different examples as I can, most of them in the Apple documentation, but I cannot find out the reason why kAudioSessionProperty_OtherAudioIsPlaying always returns a positive on my devices.
I have initialized and activated the session, yet it still returns positives when my music is paused.
Here is my code:
- (void)viewDidLoad
[super viewDidLoad];
AVAudioSession* session = [AVAudioSession sharedInstance];
NSError *activationError = nil;
BOOL success = [session setActive: YES error: &activationError];
if (!success) { NSLog(@"%@", activationError); }
UInt32 otherAudioIsPlaying;
UInt32 propertySize = sizeof (otherAudioIsPlaying);
AudioSessionGetProperty (
kAudioSessionProperty_OtherAudioIsPlaying,
&propertySize,
&otherAudioIsPlaying
if (otherAudioIsPlaying) {
[session setCategory: AVAudioSessionCategoryAmbient error: nil];
} else {
[session setCategory: AVAudioSessionCategorySoloAmbient error: nil];
What am I doing wrong?I have followed as many different examples as I can, most of them in the Apple documentation, but I cannot find out the reason why kAudioSessionProperty_OtherAudioIsPlaying always returns a positive on my devices.
I have initialized and activated the session, yet it still returns positives when my music is paused.
Here is my code:
- (void)viewDidLoad
[super viewDidLoad];
AVAudioSession* session = [AVAudioSession sharedInstance];
NSError *activationError = nil;
BOOL success = [session setActive: YES error: &activationError];
if (!success) { NSLog(@"%@", activationError); }
UInt32 otherAudioIsPlaying;
UInt32 propertySize = sizeof (otherAudioIsPlaying);
AudioSessionGetProperty (
kAudioSessionProperty_OtherAudioIsPlaying,
&propertySize,
&otherAudioIsPlaying
if (otherAudioIsPlaying) {
[session setCategory: AVAudioSessionCategoryAmbient error: nil];
} else {
[session setCategory: AVAudioSessionCategorySoloAmbient error: nil];
What am I doing wrong? -
Custom Login Module - Commit Method return TRUE always?
Hi,
I am creating a custom login module for my portal authentication.
For the login module, should the commit() method always return TRUE?
The example code on help.sap.com indicates yes to this question.
However, the JAVA Sun standard indicates that commit should return FALSE if the preceding login method returned FALSE.
Does the SAP example stray from the SUN standard? How should I code the commit() method such that it works (Always TRUE, or follow lead of login() method)?
Regards,
KevinHi Kevin,
I'm actually working with this document: <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/webinars/jaas%20login%20module%20development%20on%20webas%20java%20640.pdf#search=%22classloader%20sda%20jar%20reference%22">JAAS Login Modules</a>.
There is also example code. If it should be ignored they return false, otherwise true (page 32).
Regards,
Marcus
Message was edited by: Marcus Freiheit -
ExternalInterface.available returns true in standalone
Incredibly frustrating - no matter what I try, in standalone test environment it always returns true - it should return false - any thoughts on this anyone.
Its just ridiculous that Bugs like this occur.......
Cheers,To add to this - I also have incubator "Molehill" build.
I can simply create a new document - place the following on the root timeline
trace(ExternalInterface.available);
and it will return true.
Anyone help with this ? Adobe needs to be aware of this as it may be an incubator issue, and therefore serious. -
Boolean always returning false;
Ok so i have this
public static boolean testAuth(){
try{
BufferedReader authReader = new BufferedReader(new FileReader("auth.txt"));
String auth = authReader.readLine();
authReader.close();
URL authUrl = new URL("http://hvc3.com/authTest.php?auth="+auth);
BufferedReader urlReader = new BufferedReader(new InputStreamReader(authUrl.openStream()));
String authResponse = urlReader.readLine();
System.out.println(authResponse);
if(authResponse == "active"){
return true;
}else{
return false;
}catch (IOException e){
return false;
}this is my console outpot:
kevin-roses-computer:~/Desktop kevinrose$ java test
active
NOO
sorry its not the exception i dot knw whats wong:
Message was edited by:
krrose27if(authResponse.equalsIgnoreCase("active"))
{And in this case just write:
return authResponse.equalsIgnoreCase("active");:-)
-Puce -
Call thirty party java web service but always return null
hi
I call a java web service in my application visual studio 2008 c#, but always return NULL.
I used Tool Fiddler to monitor the traffic between my client and the web service server, it showed the return is not Null.
Here is my code, please see if anything I do wrong.
namespace CanOfficer_THQ_vs_IHQ.TestWebReferenceAppointment {
using System.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="AppointmentServiceSoapBinding", Namespace="http://service.ips.salvationarmy.org/")]
public partial class AppointmentService : Microsoft.Web.Services3.WebServicesClientProtocol {
private System.Threading.SendOrPostCallback deleteAppOperationCompleted;
private System.Threading.SendOrPostCallback importAppOperationCompleted;
private System.Threading.SendOrPostCallback editAppOperationCompleted;
private bool useDefaultCredentialsSetExplicitly;
/// <remarks/>
public AppointmentService() {
this.Url = global::CanOfficer_THQ_vs_IHQ.Properties.Settings.Default.CanOfficer_THQ_vs_IHQ_TestWebReferenceAppointment_AppointmentService;
if ((this.IsLocalFileSystemWebService(this.Url) == true)) {
this.UseDefaultCredentials = true;
this.useDefaultCredentialsSetExplicitly = false;
else {
this.useDefaultCredentialsSetExplicitly = true;
public new string Url {
get {
return base.Url;
set {
if ((((this.IsLocalFileSystemWebService(base.Url) == true)
&& (this.useDefaultCredentialsSetExplicitly == false))
&& (this.IsLocalFileSystemWebService(value) == false))) {
base.UseDefaultCredentials = false;
base.Url = value;
public new bool UseDefaultCredentials {
get {
return base.UseDefaultCredentials;
set {
base.UseDefaultCredentials = value;
this.useDefaultCredentialsSetExplicitly = true;
/// <remarks/>
public event deleteAppCompletedEventHandler deleteAppCompleted;
/// <remarks/>
public event importAppCompletedEventHandler importAppCompleted;
/// <remarks/>
public event editAppCompletedEventHandler editAppCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute(
RequestNamespace="http://service.ips.salvationarmy.org/",
ResponseNamespace="http://service.ips.salvationarmy.org/",
Use=System.Web.Services.Description.SoapBindingUse.Encoded,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string deleteApp([System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] int id) {
object[] results = this.Invoke("deleteApp", new object[] {
id});
return ((string)(results[0]));
/// <remarks/>
public void deleteAppAsync(int id) {
this.deleteAppAsync(id, null);
/// <remarks/>
public void deleteAppAsync(int id, object userState) {
if ((this.deleteAppOperationCompleted == null)) {
this.deleteAppOperationCompleted = new System.Threading.SendOrPostCallback(this.OndeleteAppOperationCompleted);
this.InvokeAsync("deleteApp", new object[] {
id}, this.deleteAppOperationCompleted, userState);
private void OndeleteAppOperationCompleted(object arg) {
if ((this.deleteAppCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.deleteAppCompleted(this, new deleteAppCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute(
RequestNamespace="http://service.ips.salvationarmy.org/",
ResponseNamespace="http://service.ips.salvationarmy.org/",
Use=System.Web.Services.Description.SoapBindingUse.Encoded,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string importApp(
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] int person,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string name,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string territory,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string location,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] bool primary,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> start,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> end,
[System.Xml.Serialization.XmlElementAttribute("categories", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string[] categories) {
object[] results = this.Invoke("importApp", new object[] {
person,
name,
territory,
location,
primary,
start,
end,
categories});
return ((string)(results[0]));
/// <remarks/>
public void importAppAsync(int person, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories) {
this.importAppAsync(person, name, territory, location, primary, start, end, categories, null);
/// <remarks/>
public void importAppAsync(int person, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories, object userState) {
if ((this.importAppOperationCompleted == null)) {
this.importAppOperationCompleted = new System.Threading.SendOrPostCallback(this.OnimportAppOperationCompleted);
this.InvokeAsync("importApp", new object[] {
person,
name,
territory,
location,
primary,
start,
end,
categories}, this.importAppOperationCompleted, userState);
private void OnimportAppOperationCompleted(object arg) {
if ((this.importAppCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.importAppCompleted(this, new importAppCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute(
RequestNamespace="http://service.ips.salvationarmy.org/",
ResponseNamespace="http://service.ips.salvationarmy.org/",
Use=System.Web.Services.Description.SoapBindingUse.Encoded,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string editApp(
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] int id,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string name,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string territory,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string location,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] bool primary,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> start,
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] Nullable<System.DateTime> end,
[System.Xml.Serialization.XmlElementAttribute("categories", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)] string[] categories) {
object[] results = this.Invoke("editApp", new object[] {
id,
name,
territory,
location,
primary,
start,
end,
categories});
return ((string)(results[0]));
/// <remarks/>
public void editAppAsync(int id, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories) {
this.editAppAsync(id, name, territory, location, primary, start, end, categories, null);
/// <remarks/>
public void editAppAsync(int id, string name, string territory, string location, bool primary, Nullable<System.DateTime> start, Nullable<System.DateTime> end, string[] categories, object userState) {
if ((this.editAppOperationCompleted == null)) {
this.editAppOperationCompleted = new System.Threading.SendOrPostCallback(this.OneditAppOperationCompleted);
this.InvokeAsync("editApp", new object[] {
id,
name,
territory,
location,
primary,
start,
end,
categories}, this.editAppOperationCompleted, userState);
private void OneditAppOperationCompleted(object arg) {
if ((this.editAppCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.editAppCompleted(this, new editAppCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
private bool IsLocalFileSystemWebService(string url) {
if (((url == null)
|| (url == string.Empty))) {
return false;
System.Uri wsUri = new System.Uri(url);
if (((wsUri.Port >= 1024)
&& (string.Compare(wsUri.Host, "localHost", System.StringComparison.OrdinalIgnoreCase) == 0))) {
return true;
return false;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
public delegate void deleteAppCompletedEventHandler(object sender, deleteAppCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class deleteAppCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal deleteAppCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
public delegate void importAppCompletedEventHandler(object sender, importAppCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class importAppCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal importAppCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
public delegate void editAppCompletedEventHandler(object sender, editAppCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "2.0.50727.5483")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class editAppCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal editAppCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));Hi;
I used Fiddler to monitor the process, and it showed the request sent thru web service worked and returned a value, but in my .Net application the return captured as NULL. Could you please look into the code above and the result from Filddler and see if
you can help.
thank you.
REQUEST:
POST https://159.253.140.178/services/AppointmentService HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.4252)
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Host: 159.253.140.178
Content-Length: 1589
Expect: 100-continue
Connection: Keep-Alive
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://service.ips.salvationarmy.org/" xmlns:types="http://service.ips.salvationarmy.org/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
<soap:Header>
<wsse:Security mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>
[email protected]
</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">
tpi4IPSws!
</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:importApp>
<person xsi:type="xsd:int">
169275
</person>
<name xsi:type="xsd:string">
Corps Officer (Cahul-Russia) Test12
</name>
<territory xsi:type="xsd:string">
CAN
</territory>
<location xsi:type="xsd:string">
TEST LOCATION 12
</location>
<primary xsi:type="xsd:boolean">
true
</primary>
<start xsi:type="xsd:dateTime">
2013-05-30T00:00:00
</start>
<end xsi:type="xsd:dateTime">
2014-06-04T00:00:00
</end>
<categories href="#id1" />
</tns:importApp>
<soapenc:Array id="id1" soapenc:arrayType="xsd:string[1]">
<Item>
vpsCat1
</Item>
</soapenc:Array>
</soap:Body>
</soap:Envelope>
RESPONSE:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Content-Length: 232
Date: Fri, 05 Sep 2014 19:45:22 GMT
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:importAppResponse xmlns:ns2="http://service.ips.salvationarmy.org/">
<return>
OK_572463
</return>
</ns2:importAppResponse>
</soap:Body>
</soap:Envelope> -
XML Validation : isschemavalid always returns 0
Hello XML folks,
I have registered the schema and tried to validate. It always returns 0 (i.e invalid).
Could you please let me know what is wrong with XSD or XML
Thanks,
Parappa
SQL> DECLARE
2 doc varchar2(3800) :=
3 '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
4 <!--W3C Schema generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
5 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:context="http://ibtco.com/common/exception/context" targetNamespace="http://ibtco.com/common/exception/context" elementFormDefault="qualified" attributeFormDefault="unqualified">
6 <xs:simpleType name="ContextValueType">
7 <xs:annotation>
8 <xs:documentation>data types for properties</xs:documentation>
9 </xs:annotation>
10 <xs:restriction base="xs:string">
11 <xs:enumeration value="boolean"/>
12 <xs:enumeration value="char"/>
13 <xs:enumeration value="byte"/>
14 <xs:enumeration value="int"/>
15 <xs:enumeration value="long"/>
16 <xs:enumeration value="float"/>
17 <xs:enumeration value="double"/>
18 <xs:enumeration value="decimal"/>
19 <xs:enumeration value="date"/>
20 <xs:enumeration value="time"/>
21 <xs:enumeration value="dateTime"/>
22 <xs:enumeration value="string"/>
23 </xs:restriction>
24 </xs:simpleType>
25 <xs:complexType name="ContextPropertyType">
26 <xs:annotation>
27 <xs:documentation>
28 for holding name/value pair for application data
29 </xs:documentation>
30 </xs:annotation>
31 <xs:simpleContent>
32 <xs:extension base="xs:string">
33 <xs:attribute name="Name" type="xs:Name" use="required"/>
34 <xs:attribute name="Type" type="context:ContextValueType" use="optional"/>
35 </xs:extension>
36 </xs:simpleContent>
37 </xs:complexType>
38 <xs:complexType name="ExceptionContextType">
39 <xs:annotation>
40 <xs:documentation>
41 for holding the data from applications
42 </xs:documentation>
43 </xs:annotation>
44 <xs:sequence>
45 <xs:element name="Property" type="context:ContextPropertyType" minOccurs="0" maxOccurs="unbounded"/>
46 </xs:sequence>
47 </xs:complexType>
48 <xs:element name="ExceptionContext" type="context:ExceptionContextType">
49 <xs:annotation>
50 <xs:documentation>
51 top level element exception context
52 </xs:documentation>
53 </xs:annotation>
54 </xs:element>
55 </xs:schema>';
56 BEGIN
57 dbms_xmlschema.registerSchema('http://ibtco.com/common/exception/context', doc);
58 END;
59 /
PL/SQL procedure successfully completed.
SQL> DECLARE
2
3 l_errormsgid VARCHAR2(30);
4 l_errorinfo VARCHAR2(100);
5 l_error_context CLOB; -- Error Stack
6 l_error_context_data CLOB; -- XML Context
7 l_var_xml_context VARCHAR2(4000);
8 l_var_error_stack VARCHAR2(4000);
9 l_sqlCode UTL_ERROR_LOGS.ERROR_CODE%TYPE;
10 p_ErrorMsgId NUMBER := '0';
11 p_ErrorInfo VARCHAR2(2000):= 'SUCCESS';
12 l_xml_context SYS.XMLTYPE;
13 l_count number :=0;
14 l_ret NUMBER;
15 BEGIN
16
17
18 -- Store XML in a clob
19 /*
20 l_var_xml_context := '<ExceptionContext>
21 <Property Name="Name1" Type="boolean">true</Property>
22 <Property Name="Name2" Type="string">String</Property>
23 </ExceptionContext>';
24 */
25
26 l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
27 <!--Sample XML file generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
28 <ExceptionContext
29 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
30 xsi:schemaLocation="http://ibtco.com/common/exception/context"
31 >
32 <Property Name="Name1" Type="boolean">true</Property>
33 <Property Name="Name2" Type="string">String</Property>
34 </ExceptionContext>';
35
36 DBMS_LOB.CREATETEMPORARY
37 (
38 lob_loc => l_error_context_data,
39 cache => TRUE
40 );
41
42 DBMS_LOB.WRITE
43 (
44 lob_loc =>l_error_context_data,
45 amount => length(l_var_xml_context),
46 offset => 1,
47 buffer => l_var_xml_context
48 );
49
50 l_xml_context := XMLTYPE(l_error_context_data);
51
52
53 -- validate against XML schema
54 --l_xml_context.schemavalidate();
55 l_ret := l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
56 IF l_ret = 1 then
57 dbms_output.put_line('Data is valid:' || l_ret );
58 ELSE
59 dbms_output.put_line('Data is invalid:' || l_ret);
60 END IF;
61 END;
62 /
Data is invalid:0
PL/SQL procedure successfully completed.
SQL>
SQL>
Here is the script :
DECLARE
doc varchar2(3800) :=
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--W3C Schema generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:context="http://ibtco.com/common/exception/context" targetNamespace="http://ibtco.com/common/exception/context" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:simpleType name="ContextValueType">
<xs:annotation>
<xs:documentation>data types for properties</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="boolean"/>
<xs:enumeration value="char"/>
<xs:enumeration value="byte"/>
<xs:enumeration value="int"/>
<xs:enumeration value="long"/>
<xs:enumeration value="float"/>
<xs:enumeration value="double"/>
<xs:enumeration value="decimal"/>
<xs:enumeration value="date"/>
<xs:enumeration value="time"/>
<xs:enumeration value="dateTime"/>
<xs:enumeration value="string"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ContextPropertyType">
<xs:annotation>
<xs:documentation>
for holding name/value pair for application data
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="Name" type="xs:Name" use="required"/>
<xs:attribute name="Type" type="context:ContextValueType" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="ExceptionContextType">
<xs:annotation>
<xs:documentation>
for holding the data from applications
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="Property" type="context:ContextPropertyType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ExceptionContext" type="context:ExceptionContextType">
<xs:annotation>
<xs:documentation>
top level element exception context
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>';
BEGIN
dbms_xmlschema.registerSchema('http://ibtco.com/common/exception/context', doc);
END;
DECLARE
l_errormsgid VARCHAR2(30);
l_errorinfo VARCHAR2(100);
l_error_context CLOB; -- Error Stack
l_error_context_data CLOB; -- XML Context
l_var_xml_context VARCHAR2(4000);
l_var_error_stack VARCHAR2(4000);
l_sqlCode UTL_ERROR_LOGS.ERROR_CODE%TYPE;
p_ErrorMsgId NUMBER := '0';
p_ErrorInfo VARCHAR2(2000):= 'SUCCESS';
l_xml_context SYS.XMLTYPE;
l_count number :=0;
l_ret NUMBER;
BEGIN
-- Store XML in a clob
l_var_xml_context := '<ExceptionContext>
<Property Name="Name1" Type="boolean">true</Property>
<Property Name="Name2" Type="string">String</Property>
</ExceptionContext>';
l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2005 sp1 U (http://www.xmlspy.com)-->
<ExceptionContext
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ibtco.com/common/exception/context"
>
<Property Name="Name1" Type="boolean">true</Property>
<Property Name="Name2" Type="string">String</Property>
</ExceptionContext>';
DBMS_LOB.CREATETEMPORARY
lob_loc => l_error_context_data,
cache => TRUE
DBMS_LOB.WRITE
lob_loc =>l_error_context_data,
amount => length(l_var_xml_context),
offset => 1,
buffer => l_var_xml_context
l_xml_context := XMLTYPE(l_error_context_data);
-- validate against XML schema
--l_xml_context.schemavalidate();
l_ret := l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
IF l_ret = 1 then
dbms_output.put_line('Data is valid:' || l_ret );
ELSE
dbms_output.put_line('Data is invalid:' || l_ret);
END IF;
END;
/problem was with the parameter you have passed as schema url.
here is the modified code.
problem was in this line.
l_xml_context.isschemavalid('"http://ibtco.com/common/exception/context"');
you have to pass the url as just a string without the double quotest (").
now it returns 1.
SQL> DECLARE
2 l_var_xml_context VARCHAR2(4000);
3 l_xml_context SYS.XMLTYPE;
4 l_ret NUMBER;
5 BEGIN
6 l_var_xml_context := '<?xml version="1.0" encoding="UTF-8"?>
7 <ExceptionContext xmlns="http://ibtco.com/common/exception/context" xmlns:xsi="http://www.w3.o
rg/2001/XMLSchema-instance" xsi:schemaLocation="http://ibtco.com/common/exception/context
8 http://ibtco.com/common/exception/context">
9 <Property Name="Name1" Type="boolean">true</Property>
10 <Property Name="Name2" Type="string">String</Property>
11 </ExceptionContext>';
12 l_xml_context := XMLTYPE(l_var_xml_context);
13
14 l_ret := l_xml_context.isschemavalid('http://ibtco.com/common/exception/context');
15 IF l_ret = 1 then
16 dbms_output.put_line('Data is valid:' || l_ret );
17 ELSE
18 dbms_output.put_line('Data is invalid:' || l_ret);
19 END IF;
20 END;
21 /
Data is valid:1 -
ServletAuthentication.weak() makes isUserInRole() always return false
I have a problem with SSO and authentification. If I authenticate with the weak()
method(have tried alle of them) authentication works fine and it seem to be single
signed-on, but
if we call the isUserInRole() method it always return false.
If I try to "call" pages from the client the declerativ security-constraints also
works fine preventing the user from accessing the pages. It is only when we use
the forward() method that we also use isUserInRole() to check if the user is permitted
to be forwarded(). WLS 6.1 sp2 tells us that the user is never in Role, no matter
what, if we use the weak() method to authenticate.
If I switch to using a j_sec_check form to authenticate the isUserInRole() works
fine. I can't use j_sec_check as a permanent solution though, because I need to
do a lot of pre- and post- processing in the login/authenication process.
Have any of you figured out a solution to this problem? Shouldn't isUserInRole()
work the same way regardless of if you logged in using SA.weak() or a j_security_check
form?Hi ,
If I switch to using a j_sec_check form to authenticate the isUserInRole()works
fine. I can't use j_sec_check as a permanent solution though, because Ineed to
do a lot of pre- and post- processing in the login/authenication process.You can use the j_security_check and still do the pre and post processing as
you want.
You have to following code,
package examples.servlets;
import java.io.PrintStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import weblogic.servlet.security.AuthFilter;
public class AuthFilterImpl extends AuthFilter
public AuthFilterImpl()
System.out.println("New AuthFilterImpl has been created.");
public void doPreAuth(ServletRequest servletrequest, ServletResponse
servletresponse)
System.out.println("AuthFilterImpl.doPreAuth has been called.");
System.out.println("Password is " +
servletrequest.getParameter("j_password"));
public boolean doSuccessAuth(ServletRequest servletrequest,
ServletResponse servletresponse)
System.out.println("AuthFilterImpl.doSuccessAuth has been called.");
return true;
public void doFailAuth(ServletRequest servletrequest, ServletResponse
servletresponse)
System.out.println("AuthFilterImpl.doFailAuth has been called.");
In your weblogic.xml have this entry,
<weblogic-web-app>
<auth-filter>
examples.servlets.AuthFilterImpl
</auth-filter>
</weblogic-web-app>
I am not sure about problem with SA.weak().
-utpal
"Morten" <[email protected]> wrote in message
news:[email protected]...
>
I have a problem with SSO and authentification. If I authenticate with theweak()
method(have tried alle of them) authentication works fine and it seem tobe single
signed-on, but
if we call the isUserInRole() method it always return false.
If I try to "call" pages from the client the declerativsecurity-constraints also
works fine preventing the user from accessing the pages. It is only whenwe use
the forward() method that we also use isUserInRole() to check if the useris permitted
to be forwarded(). WLS 6.1 sp2 tells us that the user is never in Role, nomatter
what, if we use the weak() method to authenticate.
If I switch to using a j_sec_check form to authenticate the isUserInRole()works
fine. I can't use j_sec_check as a permanent solution though, because Ineed to
do a lot of pre- and post- processing in the login/authenication process.
Have any of you figured out a solution to this problem? Shouldn'tisUserInRole()
work the same way regardless of if you logged in using SA.weak() or aj_security_check
form? -
RE: (forte-users) Confusion with return event
Samer,
The return event is delivered to the calling task, which is the window in
your first test. It is not deliverd to the event loop of the service object
unless the call to the processor originated in the event loop, which is the
case in your second test. The output you get from the server is exactly as I
would expect.
You need the following code in you client:
event loop
postregister
SomeService1.StartImmediate();
when SomeService1.Proc.ProcessEvent_return do
task.Part.Logmgr.Putline('ProcessEvents_return');
when SomeService1.Proc.ProcessEvent_exception do
task.Part.Logmgr.Putline('ProcessEvents_exception');
end event;
Note that this logoutput will not be written to a logfile, but will appear
in the logwindow which is opened when you start a client application.
Pascal Rottier
Atos Origin Nederland (BAS/West End User Computing)
Tel. +31 (0)10-2661223
Fax. +31 (0)10-2661199
E-mail: Pascal.Rottiernl.origin-it.com
++++++++++++++++++++++++++++
Philip Morris (Afd. MIS)
Tel. +31 (0)164-295149
Fax. +31 (0)164-294444
E-mail: Rottier.Pascalpmintl.ch
-----Original Message-----
From: Samer Kanjo [mailto:skanjoyahoo.com]
Sent: Thursday, January 18, 2001 1:54 AM
To: ForteUsers
Subject: (forte-users) Confusion with return event
I have observed some odd behavior when attempting to
catch a return event for a method invoked using start
task. I provided the primary classes I used during my
test and some output produced by those classes at the
bottom of this message.
The SomeService1 class is used to create an
environment visible service object and the Processor
class is one of its members. The Processor class
starts processing when one of two things happens: the
SomeService1 timer ticks off 10 seconds or when
SomeService1.StartImmediate is called directly by
another entity. Either way StartImmediate is called to
start processing.
The provided output is the result of starting a test
application and invoking StartImmediate from another
object (I used a window) and then observing what
happens when the timer ticks. As you can see the
invocation from the window did not result in the
return event being received. However, the return event
was received when the timer ticked.
According to the Forte documentation a return event
will only be posted to the parent task's event queue.
Since I am making a cross partition call, the window
and service object are not really in the same task
(Unless my assumption is wrong). That would explain
why the window did not cause a return event to be
generated but was an event generated but not caught
and if so where did the event go?
In SomeService2 class I added an event StartProcessing
and moved the code from StartImmediate to the
StartProcessing event case in the event loop and
simply posted the StartProcessing event in
StartImmediate. I performed the same test I used when
testing SomeService1. The Traceback output is
identical for the window invocation but the return
event is received this time! Why?
It seems that to guarantee the receipt of a return
event an asynchronous task must be initiated from
within an event loop. Is this correct?
I do not understand this behavior does someone have
any thoughts on this? How can you guarantee the
receipt of a return event?
Samer Kanjo
OUTPUT FROM SOMESERVICE1
StartTaskTest_cl0: processing loop listening
StartTaskTest_cl0:
Traceback:
SomeService.StartImmediate at line 1
TestWin.Display at line 4
C++ Method(s)
UserApp.Run at offset 105
StartTaskTest_cl0:
StartTaskTest_cl0: Start processing...
StartTaskTest_cl0: Processing complete.
StartTaskTest_cl0:
Traceback:
SomeService.StartImmediate at line 1
SomeService.ProcessingLoop at line 9
StartTaskTest_cl0:
StartTaskTest_cl0: Start processing...
StartTaskTest_cl0: Processing complete.
StartTaskTest_cl0: ProcessEvents_return
OUTPUT FROM SOMESERVICE2
StartTaskTest_cl0: processing loop listening
StartTaskTest_cl0:
Traceback:
SomeService2.StartImmediate at line 1
TestWin.Display at line 4
C++ Method(s)
UserApp.Run at offset 105
StartTaskTest_cl0:
StartTaskTest_cl0: Start processing...
StartTaskTest_cl0: Processing complete.
StartTaskTest_cl0: ProcessEvents_return
StartTaskTest_cl0:
Traceback:
SomeService2.StartImmediate at line 1
SomeService2.ProcessingLoop at line 9
StartTaskTest_cl0:
StartTaskTest_cl0: Start processing...
StartTaskTest_cl0: Processing complete.
StartTaskTest_cl0: ProcessEvents_return
SOMESERVICE1 CLASS
begin CLASS;
class SomeService1 inherits from Framework.Object
has public attribute proc: StartTaskTest.Processor;
has public attribute processing: Framework.boolean;
has public method Init;
has public method ProcessingLoop;
has public method StartImmediate;
has property
shared=(allow=off, override=on);
transactional=(allow=off, override=on);
monitored=(allow=off, override=on);
distributed=(allow=on, override=on, default=off);
end class;
method SomeService1.Init
begin
super.Init();
processing = FALSE;
proc = new;
start task ProcessingLoop();
end method;
method SomeService1.ProcessingLoop
begin
timer : Timer = new;
timer.tickInterval = 10000;
event loop
task.part.logmgr.putline('processing loop
listening');
timer.isActive = TRUE;
when timer.tick do
StartImmediate();
when proc.ProcessEvents_return do
task.part.logmgr.putline('ProcessEvents_return');
processing = FALSE;
when proc.ProcessEvents_exception do
task.part.logmgr.putline('ProcessEvents_exception');
processing = FALSE;
when task.shutdown do
exit;
end event;
end method;
method SomeService1.StartImmediate
begin
task.part.logmgr.putline(task.traceBack());
processing = TRUE;
start task proc.ProcessEvents() where completion =
event;
end method;
end CLASS;
SOMESERVICE2 CLASS
begin CLASS;
class SomeService2 inherits from Framework.Object
has public attribute proc: StartTaskTest.Processor;
has public attribute processing: Framework.boolean;
has public event StartProcessing;
has public method Init;
has public method ProcessingLoop;
has public method StartImmediate;
has property
shared=(allow=off, override=on);
transactional=(allow=off, override=on);
monitored=(allow=off, override=on);
distributed=(allow=on, override=on, default=off);
end class;
method SomeService2.Init
begin
super.Init();
processing = FALSE;
proc = new;
start task ProcessingLoop();
end method;
method SomeService2.ProcessingLoop
begin
timer : Timer = new;
timer.tickInterval = 10000;
event loop
task.part.logmgr.putline('processing loop
listening');
timer.isActive = TRUE;
when timer.tick do
StartImmediate();
when self.StartProcessing do
processing = TRUE;
start task proc.ProcessEvents() where completion =
event;
when proc.ProcessEvents_return do
task.part.logmgr.putline('ProcessEvents_return');
processing = FALSE;
when proc.ProcessEvents_exception do
task.part.logmgr.putline('ProcessEvents_exception');
processing = FALSE;
when task.shutdown do
exit;
end event;
end method;
method SomeService2.StartImmediate
begin
task.part.logmgr.putline(task.traceBack());
post StartProcessing;
end method;
end CLASS;
PROCESSOR CLASS
begin CLASS;
class Processor inherits from Framework.Object
has public method Init;
has public method ProcessEvents where completion =
(return = ProcessEvents_return, exception =
ProcessEvents_exception);
has property
shared=(allow=off, override=on);
transactional=(allow=off, override=on);
monitored=(allow=off, override=on);
distributed=(allow=off, override=on);
end class;
method Processor.Init
begin
super.Init();
end method;
method Processor.ProcessEvents
begin
task.part.logmgr.putline('Start processing...');
task.Delay(msecs = 1500);
task.part.logmgr.putline('Processing complete.');
end method;
end CLASS;
For the archives, go to: http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To unsubscribe, send in a new
email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.comYes, you're right. The return event is queued until the moment that you
actually enter an eventloop. I stand corrected.
Pascal Rottier
Atos Origin Nederland (BAS/West End User Computing)
Tel. +31 (0)10-2661223
Fax. +31 (0)10-2661199
E-mail: Pascal.Rottiernl.origin-it.com
++++++++++++++++++++++++++++
Philip Morris (Afd. MIS)
Tel. +31 (0)164-295149
Fax. +31 (0)164-294444
E-mail: Rottier.Pascalpmintl.ch
-----Original Message-----
From: Adamek, Zenon [mailto:ZAdamekpurolator.com]
Sent: Thursday, January 18, 2001 6:13 PM
To: Rottier, Pascal
Cc: 'forte-userslists.xpedior.com'
Subject: RE: (forte-users) Confusion with return event
I think it is always safe to use start task with where complition = event
clause before event loop. The reason is described in Forte Help in the
Complition Clause index:
"Requesting the return and exception events automatically registers the
events for the calling task. When the asynchronous method completes or
terminates, Forté adds the appropriate event to the calling task's event
queue.
This registration is unlike the event registration for the event statement.
In the event statement, the event is registered just before the event
statement is ready to process the event. In the start task statement, the
return and exception events are registered when the task is started, even
though it can be much later on that your application is prepared to wait for
those events. Therefore, only the "parent" task that executes the start task
statement is registered for the completion event of the started task."
and some comments from "Forte Performance and Patterns" page 18:
"When you use the where completion = event clause in the start task
statement, Forte automatically buffer the return event until you register
for it. Therefore, you do not need to worry about the child task completing
before you register for its return event".
Regards,
Zenon
-----Original Message-----
From: Rottier, Pascal [SMTP:Rottier.Pascalpmintl.ch]
Sent: Thursday, January 18, 2001 11:16 AM
To: 'Samer Kanjo'; ForteUsers
Subject: RE: (forte-users) Confusion with return event
Yes, if you want the eventloop of the service object to be informed when
the
method on the processor class is invoked, regardless of who invoked it,
then
you should simply post an event as the last statement inside the method on
the processor class.
The return events are only used to inform a partent task that a child-task
has completed. So, only the calling task receives the event, only if the
calling task is inside an event-loop at the moment the child-task
terminates
and only if there really is a child task (method started using "start task
Note, that the calling task doesn't have to be inside an event loop when
the
asynchronous call is made. It has to be inside an eventloop when the
asynchronous task terminates. The following piece of code works just as
well:
SomeService1.StartImmediate();
self.DoSomeOtherStuff();
event loop
when SomeService1.Proc.ProcessEvent_return do
task.Part.Logmgr.Putline('ProcessEvents_return');
when SomeService1.Proc.ProcessEvent_exception do
task.Part.Logmgr.Putline('ProcessEvents_exception');
end event;
However, if the asynchronous task started from within "StartImmediate"
finishes before the client gets a chance to enter its event loop, then
you're too late to catch the event. That's why it's safer to use the
"postregister" function, which makes sure a certain action is not started
untill all events from the event loop have been registered.
Pascal Rottier
Atos Origin Nederland (BAS/West End User Computing)
Tel. +31 (0)10-2661223
Fax. +31 (0)10-2661199
E-mail: Pascal.Rottiernl.origin-it.com
++++++++++++++++++++++++++++
Philip Morris (Afd. MIS)
Tel. +31 (0)164-295149
Fax. +31 (0)164-294444
E-mail: Rottier.Pascalpmintl.ch
-----Original Message-----
From: Samer Kanjo [mailto:skanjoyahoo.com]
Sent: Thursday, January 18, 2001 5:04 PM
To: ForteUsers
Subject: RE: (forte-users) Confusion with return event
Pascal,
So you are confirming that a return event can only be
received in an event loop if a task is started from
within that event loop.
After making your proposed changes I was able to
receive the return event in the window.
I originally wanted the SomeService event loop to
always receive the return event regardless of whether
or not StartImmediate is called by some other entity
or called when the timer ticks. It seems that the only
way to do this is with events. Is that correct?
Thank you for insight,
Samer Kanjo
--- "Rottier, Pascal" <Rottier.Pascalpmintl.ch>
wrote:
Samer,
The return event is delivered to the calling task,
which is the window in
your first test. It is not deliverd to the event
loop of the service object
unless the call to the processor originated in the
event loop, which is the
case in your second test. The output you get from
the server is exactly as I
would expect.
You need the following code in you client:
event loop
postregister
SomeService1.StartImmediate();
when SomeService1.Proc.ProcessEvent_return do
task.Part.Logmgr.Putline('ProcessEvents_return');
when SomeService1.Proc.ProcessEvent_exception do
task.Part.Logmgr.Putline('ProcessEvents_exception');
end event;
Note that this logoutput will not be written to a
logfile, but will appear
in the logwindow which is opened when you start a
client application.
Pascal Rottier
Atos Origin Nederland (BAS/West End User Computing)
Tel. +31 (0)10-2661223
Fax. +31 (0)10-2661199
E-mail: Pascal.Rottiernl.origin-it.com
++++++++++++++++++++++++++++
Philip Morris (Afd. MIS)
Tel. +31 (0)164-295149
Fax. +31 (0)164-294444
E-mail: Rottier.Pascalpmintl.ch--
For the archives, go to: http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To unsubscribe, send in a new
email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com
For the archives, go to: http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To unsubscribe, send in a new
email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com -
Global Temp Table, always return zero records
I call the procedure which uses glbal temp Table, after executing the Proc which populates the Global temp table, i then run select query retrieve the result, but it alway return zero record. I am using transaction in order to avoid deletion of records in global temp table.
whereas if i do the same thing in SQL navigator, it works
Cn.ConnectionString = Constr
Cn.Open()
If FGC Is Nothing Then
Multiple = True
'Search by desc
'packaging.pkg_msds.processavfg(null, ActiveInActive, BrandCode, Desc, Itemtype)
SQL = "BEGIN packaging.pkg_msds.processavfg(null,'" & _
ActiveInActive & "','" & _
BrandCode & "','" & _
Desc & "','" & _
Itemtype & "'); end;"
'Here it will return multiple FGC
'need to combine them
Else
'search by FGC
SQL = "BEGIN packaging.pkg_msds.processavfg('" & FGC & "','" & _
ActiveInActive & "','" & _
BrandCode & "',null,null); end;"
'will alway return one FGC
End If
' SQL = " DECLARE BEGIN rguo.pkg_msds.processAvedaFG('" & FGC & "'); end;"
Stepp = 1
Cmd.Connection = Cn
Cmd.CommandType = Data.CommandType.Text
Cmd.CommandText = SQL
Dim Trans As System.Data.OracleClient.OracleTransaction
Trans = Cn.BeginTransaction()
Cmd.Transaction = Trans
Dim Cnt As Integer
Cnt = Cmd.ExecuteNonQuery
'SQL = "SELECT rguo.pkg_msds.getPDSFGMass FROM dual"
SQL = "select * from packaging.aveda_mass_XML"
Cmd.CommandType = Data.CommandType.Text
Cmd.CommandText = SQL
Adp.SelectCommand = Cmd
Stepp = 2
Adp.Fill(Ds)
If Ds.Tables(0).Rows.Count = 0 Then
blError = True
BlComposeXml = True
Throw New Exception("No Record found for FGC(Finished Good Code=)" & FGC)
End If
'First Row, First Column contains Data as XML
Stepp = 0
Trans.Commit()Hi,
This forum is for Oracle's Data Provider and you're using Microsoft's, but I was curious so I went ahead and tried it. It works fine for me. Here's the complete code I used, could you point out what are you doing differently?
Cheers,
Greg
create global temporary table abc_tab(col1 varchar2(10));
create or replace procedure ins_abc_tab(v1 varchar2) as
begin
insert into abc_tab values(v1);
end;
using System;
using System.Data;
using System.Data.OracleClient;
class Program
static void Main(string[] args)
OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger");
con.Open();
OracleTransaction txn = con.BeginTransaction();
OracleCommand cmd = new OracleCommand("begin ins_abc_tab('foo');end;", con);
cmd.Transaction = txn;
cmd.ExecuteNonQuery();
cmd.CommandText = "select * from abc_tab";
OracleDataAdapter da = new OracleDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
Console.WriteLine("rows found: {0}", ds.Tables[0].Rows.Count);
// commit, cleanup, etc ommitted for clarity
}
Maybe you are looking for
-
WBS element and purchase ordera
Hi all, i've builded a project by cj20n transaction. I know the complete list of WBS element into projet. For each WBS there's a list of purchase order. My question is: how is possible to know the complete list of purchase order created on all WBS el
-
Installing Business Packages for CRM 5.0
Hi Experts: We had recently installed CRM 5.0 with CRM-APP, JCRM with AS ABAP, AS JAVA, EP, BI JAVA. I had wanted to know if you guys knew of the SAP guide that would let me install BP-CRM on the same system. I know it requires AS-Java and EP to wor
-
Linksys WRT54G2 V1 won't connect to the internet
So I had my router all set up for awhile and then the other day my dad reset it and now for some reason it won't connect to the internet. I tried re-doing the setup but there was no luck. Linksys WRT54G2 Motorola DSL modem Model # 2210-02-1022 Bellso
-
IPhone 3GS Straight Talk can only text AT&T Phones? Can't MMS
Background: I have a AT&T iPhone 3GS. My contract ran out last September. I just let it end including the phone number. I then signed up for Google Voice and just used the Talkatone app on my phone with Wifi to make calls and text. In the last 2 Days
-
Hi, i´ve got some problems. I got a icolud acc and a new me.com address, but i can´t use it. If i try to recieve or send mails by iOS it says, Worng Pass oder Username. If i try to use icloud.com by trying to load the mail app, an small window says,