Re: Soap header authentications problems

2012-06-11 Thread Felipe Roman
Hy Guys,

The problem was in the wrong namespace, so authentication was failing. I
just changed the namespace to 'http://tempuri.org/' and everything started
to works fine.

Thanks

On Mon, Jun 11, 2012 at 3:24 PM, Felipe Roman wrote:

> Hi Guys,
>
> I'm using CakePHP and trying to connect to a WSDL SOAP Server created
> using .NET but until now I'm not able to authenticate by the header.
>
> There is any specif way that Cake helps to do that ?
>
> Using the SoapUI tool, I'm able to connect and get the results as expected
> based on this XML input:
>
> http://www.w3.org/2003/05/soap-envelope";
> xmlns:tem="http://tempuri.org/";>
>
>   
>  
>  MyUsername
>  
>  MyPass
>   
>
>
>   
>
> 
>
> Into my controller class, I'm trying
>
> public function testSOAP() {
>
>$username = "";
> $password = "";
>
> $wsdl="https://myURL?WSDL";;
>
> // Setting "trace" will allow us to view the request that we
> are making, after we have made it.
> $objClient = new SoapClient($wsdl, array('trace' => true));
>
> //Body of the Soap Header.
> $headerbody = array('User' => $username,
> 'Password' => $password);
>
> //Create Soap Header.
> $header = new SOAPHeader($wsdl, 'ValidationHeader',
> $headerbody);
>
> //set the Headers of Soap Client.
> $objClient->__setSoapHeaders($header);
>
> // Invoke the remote call "login()".
> $Response =  $objClient->listExample();
>
> debug($Response);
>
> But I'm getting the follow response:
>
> System.Web.Services.Protocols.SoapException: Server was unable to process
> request. ---> System.Exception: ServiceX webservice authentication failed.
>at ServerX2.WebServices.ServerX.listExample() in C:\file.asmx.cs:line 45
>--- End of inner exception stack trace ---
>
> Using the SoapUI if I change the username and password (to an invalid
> value) I get the same error message, it means the https protocol is working
> fine (the client is able to connect to the server) but the SOAP
> authentication header fails.
>
> Any suggestions ?
>
> Thanks in advance,
>
> --
> Best Regards,
> Felipe Roman
> Phone 55 51 8454 8110
> LinkedIn http://au.linkedin.com/in/feliperoman
>



-- 
Best Regards,
Felipe Roman
Phone 55 51 8454 8110
LinkedIn http://au.linkedin.com/in/feliperoman

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Soap header authentications problems

2012-06-11 Thread Felipe Roman
Hi Guys,

I'm using CakePHP and trying to connect to a WSDL SOAP Server created using
.NET but until now I'm not able to authenticate by the header.

There is any specif way that Cake helps to do that ?

Using the SoapUI tool, I'm able to connect and get the results as expected
based on this XML input:

http://www.w3.org/2003/05/soap-envelope";
xmlns:tem="http://tempuri.org/";>
   
  
 
 MyUsername
 
 MyPass
  
   
   
  
   


Into my controller class, I'm trying

public function testSOAP() {

   $username = "";
$password = "";

$wsdl="https://myURL?WSDL";;

// Setting "trace" will allow us to view the request that we
are making, after we have made it.
$objClient = new SoapClient($wsdl, array('trace' => true));

//Body of the Soap Header.
$headerbody = array('User' => $username,
'Password' => $password);

//Create Soap Header.
$header = new SOAPHeader($wsdl, 'ValidationHeader',
$headerbody);

//set the Headers of Soap Client.
$objClient->__setSoapHeaders($header);

// Invoke the remote call "login()".
$Response =  $objClient->listExample();

debug($Response);

But I'm getting the follow response:

System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> System.Exception: ServiceX webservice authentication failed.
   at ServerX2.WebServices.ServerX.listExample() in C:\file.asmx.cs:line 45
   --- End of inner exception stack trace ---

Using the SoapUI if I change the username and password (to an invalid
value) I get the same error message, it means the https protocol is working
fine (the client is able to connect to the server) but the SOAP
authentication header fails.

Any suggestions ?

Thanks in advance,

-- 
Best Regards,
Felipe Roman
Phone 55 51 8454 8110
LinkedIn http://au.linkedin.com/in/feliperoman

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems running Cakephp2.1.1 with SQL Server 2008

2012-04-12 Thread Felipe Roman
Hi Stork,

I replaced the dbo_sqlsrv.php by Sqlsrv.php into
app/models/datasources and I also replace the database.php settings :

from

public $default = array(
'datasource' => 'dbo_sqlserver',

to

public $default = array(
'datasource' => 'Database/Sqlserver',

and it is working fine now ;-)

Thank you very much

On Thu, Apr 12, 2012 at 2:27 PM, stork  wrote:
>
>> I also download and copied the files dbo_sqlsrv.php and DboSource.php
>>
>> into my app/Model/Datasource folder but I'm getting the follow error:
>
> 1. file dbo_sqlsrv.php is for CakePHP 1.x, for 2.x you need this one
> https://github.com/cakephp/datasources/blob/2.0/Model/Datasource/Database/Sqlsrv.php
>
> 2. You shouldn't need to use custom DboSource.php imho.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php



-- 
Best Regards,
Felipe Roman
Phone 55 51 8454 8110
LinkedIn http://au.linkedin.com/in/feliperoman

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems running Cakephp2.1.1 with SQL Server 2008

2012-04-12 Thread Felipe Roman
I forgot to say that I'm able to connect and run queries using one
test.php file I created without any frameworks (I mean using
sqlsrv_connect() direct) so I think the environment configuration is
Ok.

thanks again

On Thu, Apr 12, 2012 at 1:34 PM, Felipe Roman  wrote:
> Hi,
>
> Do you know if the CakePHP 2.1.1 is compatible with SQL Server 2008 ?
> If yes could you please send me some how to ?
>
> I configured my local development environment (PHP 5.3.10 and Apache
> 2.2.21 on Windows 7)
>
> I loaded the extensions pdo_sqlsrv  and sqlsrv (on PHP 32 bits, I
> could not load on PHP 64 bits)
>
> I also download and copied the files dbo_sqlsrv.php and DboSource.php
> into my app/Model/Datasource folder but I'm getting the follow error:
>
> Fatal error: Class 'DboSource' not found in
> C:\wamp\www\project\app\Model\Datasource\dbo_sqlsrv.php on line 29
>
> Is the dbo_sqlsrv.php compatible with Cake 2.1.1 ?
>
> Thanks
>
> --
> Best Regards,
> Felipe Roman
> Phone 55 51 8454 8110
> LinkedIn http://au.linkedin.com/in/feliperoman



-- 
Best Regards,
Felipe Roman
Phone 55 51 8454 8110
LinkedIn http://au.linkedin.com/in/feliperoman

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Problems running Cakephp2.1.1 with SQL Server 2008

2012-04-12 Thread Felipe Roman
Hi,

Do you know if the CakePHP 2.1.1 is compatible with SQL Server 2008 ?
If yes could you please send me some how to ?

I configured my local development environment (PHP 5.3.10 and Apache
2.2.21 on Windows 7)

I loaded the extensions pdo_sqlsrv  and sqlsrv (on PHP 32 bits, I
could not load on PHP 64 bits)

I also download and copied the files dbo_sqlsrv.php and DboSource.php
into my app/Model/Datasource folder but I'm getting the follow error:

Fatal error: Class 'DboSource' not found in
C:\wamp\www\project\app\Model\Datasource\dbo_sqlsrv.php on line 29

Is the dbo_sqlsrv.php compatible with Cake 2.1.1 ?

Thanks

--
Best Regards,
Felipe Roman
Phone 55 51 8454 8110
LinkedIn http://au.linkedin.com/in/feliperoman

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Controller can't access the Session

2012-03-28 Thread Felipe Roman
After long time trying figure out I found the problem and the
solution. I changed the app/config/core.php file setting:

Session.checkAgent to false so the Ajax requests do not change the
UserAgent allowing the controller to get the session.

"Session.checkAgent
Setting this to TRUE means Cake will store the user agent header of a
request when a new session is created. On subsequent request, the user
agent header sent is compared with the value stored in the session. If
it does not match, the current session will be destroyed and a new
session gets created.

This rarely causes problem unless you have embedded Flash or Java
objects making separate requests to the application. You must take
note to send the user agent string of the browser in that case. If you
are using something like Aurigma’s Image Uploader where the user agent
is not configurable, you have to set this to FALSE instead."

Source
http://derickng.com/posts/36-cakephp-losing-or-missing-session

Thanks

On Mar 19, 7:50 am, euromark  wrote:
> why don't your controllers have:
>
>  public $components = array('Session');
>
> ?
>
> without it you cannot use the session component
>
> Am Montag, 19. März 2012 01:37:02 UTC+1 schrieb Felipe Roman:
>
>
>
>
>
>
>
>
>
> > Hi,
>
> > Has someone ever seen only one controller does not access the cake session
> > ?
>
> > The session works fine for all controllers except for one specific
> > controller. I tried debug the problem but I didn't find the reason.
>
> > The controller code:
>
> > class ExecutivosController extends AppController {
>
> >         var $name = 'Executivos';
> >         var $uses = array('Executivo', 'FormacaoAcademica',
> > 'FormacaoComplementar', 'Executivo', 'Empresa', 'Unidade', 'Cargo',
> > 'ExecutivoCargo', 'AtuacaoProfissional', 'ExecutivoIdioma', 'Decisao',
> > 'Mobilidade', 'PotencialProntidao', 'Arquivo', 'Usuario');
> >         var $components = array('RequestHandler', 'Email');
>
> >         function index() {
>
> >                 // Get login information
> >                 $Login = $this->Session->read('Login');
>
> >                 debug($_SESSION);
> >                 debug($Login);
>
> > and the others controllers are similar:
>
> >  > class CargosController extends AppController {
>
> >         var $name = 'Cargos';
> >         var $uses = array('Cargo', 'Empresa', 'Unidade', 'Executivo',
> > 'RespostaColaboradore');
> >         var $components = array('RequestHandler', 'Email');
>
> >         function index() {
> >             // Le informações de login
> >             $Login = $this->Session->read('Login');
>
> >             debug($_SESSION);
> >             debug($Login);
>
> > When I access the Cargos controller all session information are
> > printed by debug funcion as expected, when I try access the first one
> > the Session and $_SESSION is empty. If I reload the second one again
> > the session values are still there (it means the session isn't
> > erased).
>
> > The app_controller.php file:
>
> > class AppController extends Controller {
> >     var $helpers = array('Html', 'Javascript', 'Session', 'Ajax',
> > 'Time', 'Form');
>
> >     function  beforeFilter() {
> >         //debug($this);
> >         if (($this->name != "Usuarios") or ($this->action != 'login')){
>
> >             if($this->Session->read('Login')) {
> >             } else {
> >                 $this->Session->setFlash(__('Efetue o login para
> > acessar o sistema', true));
> >                 $this->redirect(array('controller' => 'usuarios',
> > 'action' => 'login'));
> >             }
> >         }
> >     }
>
> > Has someone have any ideas why the Executivos controller can't access
> > the session ?
>
> > Thanks
>
> > --
> > Best Regards,
> > Felipe Roman
> > Phone 55 51 8454 8110
> > LinkedInhttp://au.linkedin.com/in/feliperoman

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Controller can't access the Session

2012-03-18 Thread Felipe Roman
Hi,

Has someone ever seen only one controller does not access the cake session ?

The session works fine for all controllers except for one specific
controller. I tried debug the problem but I didn't find the reason.

The controller code:

class ExecutivosController extends AppController {

var $name = 'Executivos';
var $uses = array('Executivo', 'FormacaoAcademica',
'FormacaoComplementar', 'Executivo', 'Empresa', 'Unidade', 'Cargo',
'ExecutivoCargo', 'AtuacaoProfissional', 'ExecutivoIdioma', 'Decisao',
'Mobilidade', 'PotencialProntidao', 'Arquivo', 'Usuario');
var $components = array('RequestHandler', 'Email');

function index() {

// Get login information
$Login = $this->Session->read('Login');

debug($_SESSION);
debug($Login);

and the others controllers are similar:

Session->read('Login');

debug($_SESSION);
debug($Login);


When I access the Cargos controller all session information are
printed by debug funcion as expected, when I try access the first one
the Session and $_SESSION is empty. If I reload the second one again
the session values are still there (it means the session isn't
erased).

The app_controller.php file:

class AppController extends Controller {
var $helpers = array('Html', 'Javascript', 'Session', 'Ajax',
'Time', 'Form');

function  beforeFilter() {
//debug($this);
if (($this->name != "Usuarios") or ($this->action != 'login')){

if($this->Session->read('Login')) {
} else {
        $this->Session->setFlash(__('Efetue o login para
acessar o sistema', true));
$this->redirect(array('controller' => 'usuarios',
'action' => 'login'));
}
}
}

Has someone have any ideas why the Executivos controller can't access
the session ?

Thanks

-- 
Best Regards,
Felipe Roman
Phone 55 51 8454 8110
LinkedIn http://au.linkedin.com/in/feliperoman

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Scaffolding vs Bake

2010-12-29 Thread Felipe Roman
Hi John,

The main difference between scaffold and bake is bake will generate the PHP
code (model, controller,view) and you can customize it how you want. When
I'm developing I start using bake to generate all CRUD and after I start to
change the generated code.

If the scaffolding is OK for you (work for all your requirements) I guess
you can continue using it. I've read in some place that scaffolding is not
recommended to use in production application (I don't remember the reason is
unstable or insecure...) but I don't know in the latest cake version.

-- 
Best Regards,
Felipe Roman
Phone 55 51 8454 8110
LinkedIn http://au.linkedin.com/in/feliperoman

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: IDE

2010-12-21 Thread Felipe Roman
On Tue, Dec 21, 2010 at 2:28 PM, Kristofer  wrote:

> Ah, I saw NetBeans several years ago but forgot about it!  I will give
> it another look.  Thanks!
>

I got used to use NetBeans for Java development several years ago but this
year I started for PHP and it is very good. I've been using Eclipse PHP for
a while too. For me both are very good IDEs but a little bit slow(in my
computer).

-- 
Best Regards,
Felipe Roman
Phone 55 51 8454 8110
LinkedIn http://au.linkedin.com/in/feliperoman

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: IDE

2010-12-21 Thread Felipe Roman
Hi Kristofer,

I've been using NetBeans PHP[1] IDE, there are all IDE common features like
code auto-complete, support SVN integration and also other Control Version
tools.

1. php.netbeans.org


On Tue, Dec 21, 2010 at 12:57 PM, Kristofer  wrote:

> What IDE do people typically use with CakePHP?  I've been doing stuff
> from the Linux command line using vim for so long.  I'd like something
> more graphical that (hopefully) supports SVN.  Looking for more point-
> and-click.  :)
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Best Regards,
Felipe Roman
Phone 55 51 8454 8110
LinkedIn http://au.linkedin.com/in/feliperoman

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Keep Pagination options using URL instead of store in a Session

2010-10-22 Thread Felipe Roman
Hello All,

This is my first message to this list and I'm beginner using CakePHP.

I have a question that I guess is a simple question but till now I didn't
find the answer on the internet forums.

I'm using pagination component to paginate the result of one search page I
created, the problem is when I navigated to next or previous page I lost the
search string data.

I found some solutions at internet, the first one is using the Session
component, I've implemented this solution and it's working fine... but I
found some threads on cake forums saying this is not the best way to solve
it. Then I found this page saying to add the paginate option as params in
the paginate links to include the options in the URL using GET.

Is this the best solution ?

Then I added on my view the follow line:

$paginator->options(array('url'=>$this->passedArgs));

Now the params are added in the links, and I changed the search form method
to get to add the search string in the URL, the problem is the GET method is
adding the value like that:

?param=value (the default get)

instead of

/controller/method/param:value

and the pagination component/helper doesn't add this kind of params in the
links.

How can I change my form tag to pass the args in the CakePHP format ?

I'm creating the search form:

echo $form->create("Aluno",array('action' => 'index', 'type' => 'get'));
echo $form->input("procurar", array('label' => 'Nome do aluno', 'value'
=> ''));
echo $form->end("Localizar");

Thanks advance,

-- 
Best Regards,
Felipe Roman
Phone 55 51 8454 8110
LinkedIn http://au.linkedin.com/in/feliperoman

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en