You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Sumudu Chinthaka <cs...@gmail.com> on 2013/07/29 07:51:47 UTC

persist webservice object

hi

im creating a webservice object from action script and when application
starts it calls loadWSDL function to load the webservice wsdl file

this process takes time and i have manage to minimize it by locally
providing wsdl file as a assets

what i was thinking is to persist the webservice object once it created for
the first time and then use the persisted copy

i have tried to use the following code to save the ws object

use namespace mx_internal;

registerClassAlias("mx.rpc.soap.WebService",WebService);
var WebService:ws = WebServiceProvider.getWebSeriveInstance();
pm = new PersistenceManager();
pm.setProperty('WSDL',ws);



but when im retrieving im not getting it insted it returns the Object

var persistedWS:WebService = pm.getProperty('WSDL') as WebService;

is there any way to cast this to webservice or is there any othere way to
cache loadWsdl result in application

best regards
Sumudu

Re: persist webservice object

Posted by Sumudu Chinthaka <cs...@gmail.com>.
hi Manish

My Problem is loadWSDL take some time to load, during that time event i
show busyindicator it's animation is not smooth. so what i really would
like to check the possibility of  persist the webservice object and reuse
it in future application start ups. then user will only experience this on
the first time,

i have check the possibility of making use of workers, it seems flex mobile
doesn't support workers

any advice would be greatly appreciated

Regards
Sumudu


On Mon, Jul 29, 2013 at 11:50 AM, Manish Sharma <ma...@hcl.com>wrote:

> Hi Sumudu,
>
> For loading the wsdl is simple.
>
> webService = new WebService();
> webService.loadWSDL(wsdlURL); // you can also provide the assets folder
> path
>
> The previous code is for calling an operation which is in the wsdl.
>
> Regards,
> Manish Sharma
>
> -----Original Message-----
> From: Sumudu Chinthaka [mailto:csumudu@gmail.com]
> Sent: Monday, July 29, 2013 11:48 AM
> To: users@flex.apache.org
> Subject: Re: persist webservice object
>
> thanks manish,
>
> i suppose in this way you dont have to load wsdl ?
>
> let me try it and update u
>
> Best Regards
> Sumudu
>
>
> On Mon, Jul 29, 2013 at 11:30 AM, Manish Sharma <manish_sharm@hcl.com
> >wrote:
>
> > Hi Sumudu,
> >
> > Below if the wsdl code working perfectly fines for me:-
> >
> >                         Var webService = new WebService(); //
> > webService Instance.
> >                         var oprt:AbstractOperation = new
> > AbstractOperation();
> >                         oprt =
> > webService.getOperation(appConfigProxy.getUrl(AppConfigConstant.GETLAY
> > OUT)); // operation name which you want to execute
> >                         oprt.addEventListener(ResultEvent.RESULT,
> > result); // result handler
> >                         oprt.addEventListener(FaultEvent.FAULT,
> > fault); // fault handler
> >                         var instructObj:Object = new Object(); //
> > object if you want to pass something.
> >                         instructObj.ImAppid = appConfigProxy.appID;
> >                         instructObj.ImSessid = appConfigProxy.sessID;
> >                         oprt.arguments = instructObj;
> >                         oprt.send(); // finally send.
> >
> > Regards,
> > Manish Sharma
> >
> > -----Original Message-----
> > From: Sumudu Chinthaka [mailto:csumudu@gmail.com]
> > Sent: Monday, July 29, 2013 11:22 AM
> > To: users@flex.apache.org
> > Subject: persist webservice object
> >
> > hi
> >
> > im creating a webservice object from action script and when
> > application starts it calls loadWSDL function to load the webservice
> > wsdl file
> >
> > this process takes time and i have manage to minimize it by locally
> > providing wsdl file as a assets
> >
> > what i was thinking is to persist the webservice object once it
> > created for the first time and then use the persisted copy
> >
> > i have tried to use the following code to save the ws object
> >
> > use namespace mx_internal;
> >
> > registerClassAlias("mx.rpc.soap.WebService",WebService);
> > var WebService:ws = WebServiceProvider.getWebSeriveInstance();
> > pm = new PersistenceManager();
> > pm.setProperty('WSDL',ws);
> >
> >
> >
> > but when im retrieving im not getting it insted it returns the Object
> >
> > var persistedWS:WebService = pm.getProperty('WSDL') as WebService;
> >
> > is there any way to cast this to webservice or is there any othere way
> > to cache loadWsdl result in application
> >
> > best regards
> > Sumudu
> >
> >
> > ::DISCLAIMER::
> >
> > ----------------------------------------------------------------------
> > ----------------------------------------------------------------------
> > --------
> >
> > The contents of this e-mail and any attachment(s) are confidential and
> > intended for the named recipient(s) only.
> > E-mail transmission is not guaranteed to be secure or error-free as
> > information could be intercepted, corrupted, lost, destroyed, arrive
> > late or incomplete, or may contain viruses in transmission. The e mail
> > and its contents (with or without referred errors) shall therefore not
> > attach any liability on the originator or HCL or its affiliates.
> > Views or opinions, if any, presented in this email are solely those of
> > the author and may not necessarily reflect the views or opinions of
> > HCL or its affiliates. Any form of reproduction, dissemination,
> > copying, disclosure, modification, distribution and / or publication
> > of this message without the prior written consent of authorized
> > representative of HCL is strictly prohibited. If you have received
> > this email in error please delete it and notify the sender
> > immediately.
> > Before opening any email and/or attachments, please check them for
> > viruses and other defects.
> >
> >
> > ----------------------------------------------------------------------
> > ----------------------------------------------------------------------
> > --------
> >
> >
>

RE: persist webservice object

Posted by Manish Sharma <ma...@hcl.com>.
Hi Sumudu,

For loading the wsdl is simple.

webService = new WebService();
webService.loadWSDL(wsdlURL); // you can also provide the assets folder path

The previous code is for calling an operation which is in the wsdl.

Regards,
Manish Sharma

-----Original Message-----
From: Sumudu Chinthaka [mailto:csumudu@gmail.com] 
Sent: Monday, July 29, 2013 11:48 AM
To: users@flex.apache.org
Subject: Re: persist webservice object

thanks manish,

i suppose in this way you dont have to load wsdl ?

let me try it and update u

Best Regards
Sumudu


On Mon, Jul 29, 2013 at 11:30 AM, Manish Sharma <ma...@hcl.com>wrote:

> Hi Sumudu,
>
> Below if the wsdl code working perfectly fines for me:-
>
>                         Var webService = new WebService(); // 
> webService Instance.
>                         var oprt:AbstractOperation = new 
> AbstractOperation();
>                         oprt =
> webService.getOperation(appConfigProxy.getUrl(AppConfigConstant.GETLAY
> OUT)); // operation name which you want to execute
>                         oprt.addEventListener(ResultEvent.RESULT, 
> result); // result handler
>                         oprt.addEventListener(FaultEvent.FAULT, 
> fault); // fault handler
>                         var instructObj:Object = new Object(); // 
> object if you want to pass something.
>                         instructObj.ImAppid = appConfigProxy.appID;
>                         instructObj.ImSessid = appConfigProxy.sessID;
>                         oprt.arguments = instructObj;
>                         oprt.send(); // finally send.
>
> Regards,
> Manish Sharma
>
> -----Original Message-----
> From: Sumudu Chinthaka [mailto:csumudu@gmail.com]
> Sent: Monday, July 29, 2013 11:22 AM
> To: users@flex.apache.org
> Subject: persist webservice object
>
> hi
>
> im creating a webservice object from action script and when 
> application starts it calls loadWSDL function to load the webservice 
> wsdl file
>
> this process takes time and i have manage to minimize it by locally 
> providing wsdl file as a assets
>
> what i was thinking is to persist the webservice object once it 
> created for the first time and then use the persisted copy
>
> i have tried to use the following code to save the ws object
>
> use namespace mx_internal;
>
> registerClassAlias("mx.rpc.soap.WebService",WebService);
> var WebService:ws = WebServiceProvider.getWebSeriveInstance();
> pm = new PersistenceManager();
> pm.setProperty('WSDL',ws);
>
>
>
> but when im retrieving im not getting it insted it returns the Object
>
> var persistedWS:WebService = pm.getProperty('WSDL') as WebService;
>
> is there any way to cast this to webservice or is there any othere way 
> to cache loadWsdl result in application
>
> best regards
> Sumudu
>
>
> ::DISCLAIMER::
>
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> --------
>
> The contents of this e-mail and any attachment(s) are confidential and 
> intended for the named recipient(s) only.
> E-mail transmission is not guaranteed to be secure or error-free as 
> information could be intercepted, corrupted, lost, destroyed, arrive 
> late or incomplete, or may contain viruses in transmission. The e mail 
> and its contents (with or without referred errors) shall therefore not 
> attach any liability on the originator or HCL or its affiliates.
> Views or opinions, if any, presented in this email are solely those of 
> the author and may not necessarily reflect the views or opinions of 
> HCL or its affiliates. Any form of reproduction, dissemination, 
> copying, disclosure, modification, distribution and / or publication 
> of this message without the prior written consent of authorized 
> representative of HCL is strictly prohibited. If you have received 
> this email in error please delete it and notify the sender 
> immediately.
> Before opening any email and/or attachments, please check them for 
> viruses and other defects.
>
>
> ----------------------------------------------------------------------
> ----------------------------------------------------------------------
> --------
>
>

Re: persist webservice object

Posted by Sumudu Chinthaka <cs...@gmail.com>.
thanks manish,

i suppose in this way you dont have to load wsdl ?

let me try it and update u

Best Regards
Sumudu


On Mon, Jul 29, 2013 at 11:30 AM, Manish Sharma <ma...@hcl.com>wrote:

> Hi Sumudu,
>
> Below if the wsdl code working perfectly fines for me:-
>
>                         Var webService = new WebService(); // webService
> Instance.
>                         var oprt:AbstractOperation = new
> AbstractOperation();
>                         oprt =
> webService.getOperation(appConfigProxy.getUrl(AppConfigConstant.GETLAYOUT));
> // operation name which you want to execute
>                         oprt.addEventListener(ResultEvent.RESULT, result);
> // result handler
>                         oprt.addEventListener(FaultEvent.FAULT, fault); //
> fault handler
>                         var instructObj:Object = new Object(); // object
> if you want to pass something.
>                         instructObj.ImAppid = appConfigProxy.appID;
>                         instructObj.ImSessid = appConfigProxy.sessID;
>                         oprt.arguments = instructObj;
>                         oprt.send(); // finally send.
>
> Regards,
> Manish Sharma
>
> -----Original Message-----
> From: Sumudu Chinthaka [mailto:csumudu@gmail.com]
> Sent: Monday, July 29, 2013 11:22 AM
> To: users@flex.apache.org
> Subject: persist webservice object
>
> hi
>
> im creating a webservice object from action script and when application
> starts it calls loadWSDL function to load the webservice wsdl file
>
> this process takes time and i have manage to minimize it by locally
> providing wsdl file as a assets
>
> what i was thinking is to persist the webservice object once it created
> for the first time and then use the persisted copy
>
> i have tried to use the following code to save the ws object
>
> use namespace mx_internal;
>
> registerClassAlias("mx.rpc.soap.WebService",WebService);
> var WebService:ws = WebServiceProvider.getWebSeriveInstance();
> pm = new PersistenceManager();
> pm.setProperty('WSDL',ws);
>
>
>
> but when im retrieving im not getting it insted it returns the Object
>
> var persistedWS:WebService = pm.getProperty('WSDL') as WebService;
>
> is there any way to cast this to webservice or is there any othere way to
> cache loadWsdl result in application
>
> best regards
> Sumudu
>
>
> ::DISCLAIMER::
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
> The contents of this e-mail and any attachment(s) are confidential and
> intended for the named recipient(s) only.
> E-mail transmission is not guaranteed to be secure or error-free as
> information could be intercepted, corrupted,
> lost, destroyed, arrive late or incomplete, or may contain viruses in
> transmission. The e mail and its contents
> (with or without referred errors) shall therefore not attach any liability
> on the originator or HCL or its affiliates.
> Views or opinions, if any, presented in this email are solely those of the
> author and may not necessarily reflect the
> views or opinions of HCL or its affiliates. Any form of reproduction,
> dissemination, copying, disclosure, modification,
> distribution and / or publication of this message without the prior
> written consent of authorized representative of
> HCL is strictly prohibited. If you have received this email in error
> please delete it and notify the sender immediately.
> Before opening any email and/or attachments, please check them for viruses
> and other defects.
>
>
> ----------------------------------------------------------------------------------------------------------------------------------------------------
>
>

RE: persist webservice object

Posted by Manish Sharma <ma...@hcl.com>.
Hi Sumudu, 

Below if the wsdl code working perfectly fines for me:- 

			Var webService = new WebService(); // webService Instance.
			var oprt:AbstractOperation = new AbstractOperation();
			oprt = webService.getOperation(appConfigProxy.getUrl(AppConfigConstant.GETLAYOUT)); // operation name which you want to execute
			oprt.addEventListener(ResultEvent.RESULT, result); // result handler
			oprt.addEventListener(FaultEvent.FAULT, fault); // fault handler
			var instructObj:Object = new Object(); // object if you want to pass something.
			instructObj.ImAppid = appConfigProxy.appID;
			instructObj.ImSessid = appConfigProxy.sessID;
			oprt.arguments = instructObj;
			oprt.send(); // finally send.

Regards,
Manish Sharma

-----Original Message-----
From: Sumudu Chinthaka [mailto:csumudu@gmail.com] 
Sent: Monday, July 29, 2013 11:22 AM
To: users@flex.apache.org
Subject: persist webservice object

hi

im creating a webservice object from action script and when application starts it calls loadWSDL function to load the webservice wsdl file

this process takes time and i have manage to minimize it by locally providing wsdl file as a assets

what i was thinking is to persist the webservice object once it created for the first time and then use the persisted copy

i have tried to use the following code to save the ws object

use namespace mx_internal;

registerClassAlias("mx.rpc.soap.WebService",WebService);
var WebService:ws = WebServiceProvider.getWebSeriveInstance();
pm = new PersistenceManager();
pm.setProperty('WSDL',ws);



but when im retrieving im not getting it insted it returns the Object

var persistedWS:WebService = pm.getProperty('WSDL') as WebService;

is there any way to cast this to webservice or is there any othere way to cache loadWsdl result in application

best regards
Sumudu


::DISCLAIMER::
----------------------------------------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents
(with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates.
Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the
views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of this message without the prior written consent of authorized representative of
HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately.
Before opening any email and/or attachments, please check them for viruses and other defects.

----------------------------------------------------------------------------------------------------------------------------------------------------