WSFault and Rampart/C

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

WSFault and Rampart/C

Jeroen Koekkoek-3
Hi,

I have a question regarding the use of WSFault objects and WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal operations while using WSPolicy+WSSecurityToken succeed, but when using them and throwing a WSFault I receive the following errors.

----- wsf_php_client.log -----
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred in transport
[Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126) [rampart][rampart_in_handler] Security header cannot be found.
[Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler RampartInHandler invoke failed within phase PreDispatch
[Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase PreDispatch failed
----- /wsf_php_client.log -----

----- wsf_php_server.log -----
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred in transport
[Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126) [rampart][rampart_in_handler] Security header cannot be found.
[Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler RampartInHandler invoke failed within phase PreDispatch
[Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase PreDispatch failed
----- /wsf_php_server.log -----

These messages I receive when using the default xml's that come with WSF/PHP. When using modified xml files, the following lines appear every time.

----- wsf_php_server.log -----
[Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159) [rampart][rampart_engine] Cannot get saved rampart_context
[Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136) [rampart][rampart_out_handler] ramaprt_context creation failed.
----- /wsf_php_server.log -----

I can't get the configuration to work. Does anyone have some pointers or know what's causing these errors to occur? I use Apache2/C 1.6.0, Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I created my own Debian packages.

Thanks in advance.

Best regards,

Jeroen Koekkoek

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

Nandika Jayawardana
I guess there should be something wrong with your WSPolicy object or WSSecurityToken object. RampartClientConfiguration is the object which carries data to rampart( Security Module ) and it is populated using WSPolicy object and WSSecurityToken object at PHP Level. 
Regards
Nandika

On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek <[hidden email]> wrote:
Hi,

I have a question regarding the use of WSFault objects and WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal operations while using WSPolicy+WSSecurityToken succeed, but when using them and throwing a WSFault I receive the following errors.

----- wsf_php_client.log -----
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred in transport
[Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126) [rampart][rampart_in_handler] Security header cannot be found.
[Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler RampartInHandler invoke failed within phase PreDispatch
[Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase PreDispatch failed
----- /wsf_php_client.log -----

----- wsf_php_server.log -----
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred in transport
[Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126) [rampart][rampart_in_handler] Security header cannot be found.
[Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler RampartInHandler invoke failed within phase PreDispatch
[Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase PreDispatch failed
----- /wsf_php_server.log -----

These messages I receive when using the default xml's that come with WSF/PHP. When using modified xml files, the following lines appear every time.

----- wsf_php_server.log -----
[Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159) [rampart][rampart_engine] Cannot get saved rampart_context
[Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136) [rampart][rampart_out_handler] ramaprt_context creation failed.
----- /wsf_php_server.log -----

I can't get the configuration to work. Does anyone have some pointers or know what's causing these errors to occur? I use Apache2/C 1.6.0, Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I created my own Debian packages.

Thanks in advance.

Best regards,

Jeroen Koekkoek

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"


_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

Jeroen Koekkoek-3
Hi Nandika,

Thanks for your reply.

After fiddling with axis2.xml and rampart's module.xml a bit, I got the RampartClientConfiguration to disappear. Throwing WSFaults is still troublesome. I also recompiled Axis2/C etc to use libxml2 and disabled Guththila.

----- wsf_php_server.log -----
[Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159) [rampart][rampart_engine] Cannot get saved rampart_context
[Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136) [rampart][rampart_out_handler] ramaprt_context creation failed.
[Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler RampartOutHandler invoke failed within phase MessageOut
[Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase MessageOut failed
----- /wsf_php_server.log -----

----- wsf_php_client.log -----
[Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error occurred in transport
[Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126) [rampart][rampart_in_handler] Security header cannot be found.
[Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler RampartInHandler invoke failed within phase Security
[Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase Security failed
[Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation specific phases failed for operation __OPERATION_OUT_IN__
----- /wsf_php_client.log -----

I included the PHP code for creating the policy etc below.

The PHP code for test.php (client):

----- client -----
$policy = new WSPolicy (array (
  "security" => array (
    "useUsernameToken" => true,
    "includeTimeStamp" => true
  )
));

$token = new WSSecurityToken (array (
  "user" => "bob",
  "password" => "bob12",
  "passwordType" => "Digest",
  "ttl" => 300
));

$settings = array ();
$settings['useWSA'] = true;
$settings['cacheWSDL'] = false;
$settings['wsdl'] = 'dns.wsdl';
$settings['policy'] = $policy;
$settings['securityToken'] = $token;

$client = new WSClient ($settings);
----- /client -----

The PHP code for index.php (server):

----- server -----
$settings['wsdl']           = 'dns.wsdl';
$settings['bindingStyle']   = "doclit";
$settings['cacheWSDL']      = false;
$settings['useWSA']         = true;
$settings['operations']     = $operations;
$settings['actions']        = $actions;
$settings['policy']         = $policy;
$settings['securityToken']  = $token;
$settings['serviceName']    = "LinuxDNSCluster";

$service = new WSService ($settings);
$service->reply();
----- /server -----

Best regards,
Jeroen Koekkoek


From: [hidden email] [mailto:[hidden email]] On Behalf Of Nandika Jayawardana
Sent: Tuesday, September 15, 2009 10:35 AM
To: [hidden email]
Subject: Re: [wsf-php-user] WSFault and Rampart/C

I guess there should be something wrong with your WSPolicy object or WSSecurityToken object. RampartClientConfiguration is the object which carries data to rampart( Security Module ) and it is populated using WSPolicy object and WSSecurityToken object at PHP Level. 
Regards
Nandika
On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek <[hidden email]> wrote:
Hi,

I have a question regarding the use of WSFault objects and WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal operations while using WSPolicy+WSSecurityToken succeed, but when using them and throwing a WSFault I receive the following errors.

----- wsf_php_client.log -----
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred in transport
[Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126) [rampart][rampart_in_handler] Security header cannot be found.
[Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler RampartInHandler invoke failed within phase PreDispatch
[Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase PreDispatch failed
----- /wsf_php_client.log -----

----- wsf_php_server.log -----
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403) RampartClientConfiguration not set in message context
[Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred in transport
[Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126) [rampart][rampart_in_handler] Security header cannot be found.
[Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler RampartInHandler invoke failed within phase PreDispatch
[Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase PreDispatch failed
----- /wsf_php_server.log -----

These messages I receive when using the default xml's that come with WSF/PHP. When using modified xml files, the following lines appear every time.

----- wsf_php_server.log -----
[Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159) [rampart][rampart_engine] Cannot get saved rampart_context
[Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136) [rampart][rampart_out_handler] ramaprt_context creation failed.
----- /wsf_php_server.log -----

I can't get the configuration to work. Does anyone have some pointers or know what's causing these errors to occur? I use Apache2/C 1.6.0, Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I created my own Debian packages.

Thanks in advance.

Best regards,

Jeroen Koekkoek

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

Jeroen Koekkoek-3
Sorry I didn't paste the entire server side code.

----- server -----
/* WSF/PHP */

$operations = array (
  "DomainExistsByName"      => "DomainExistsByName",
  "GetDomainByName"         => "GetDomainByName",
  "CreateDomain"            => "CreateDomain",
  "DeleteDomain"            => "DeleteDomain",
  "RecordExistsByName"      => "RecordExistsByName",
  "RecordExists"            => "RecordExists",
  "GetRecordsByDomainName"  => "GetRecordsByDomainName",
  "GetRecordsByName"        => "GetRecordsByName",
  "GetRecord"               => "GetRecord",
  "CreateRecord"            => "CreateRecord",
  "ModifyRecord"            => "ModifyRecord",
  "DeleteRecord"            => "DeleteRecord"
);

$parameters = array (
  "DomainExistsByName"      => "MIXED",
  "GetDomainByName"         => "MIXED",
  "CreateDomain"            => "MIXED",
  "DeleteDomain"            => "MIXED",
  "RecordExistsByName"      => "MIXED",
  "RecordExists"            => "MIXED",
  "GetRecordsByDomainName"  => "MIXED",
  "GetRecordsByName"        => "MIXED",
  "GetRecord"               => "MIXED",
  "CreateRecord"            => "MIXED",
  "ModifyRecord"            => "MIXED",
  "DeleteRecord"            => "MIXED"
);

$policy = new WSPolicy (array (
  "security" => array (
    "useUsernameToken" => true,
    "includeTimeStamp" => true
  )
));

$token = new WSSecurityToken (array (
  "user"               => "bob",
  "password"           => "bob12",
  "passwordType"       => "Digest",
  "ttl"                => 100,
  "enableReplayDetect" => false
));

$actions = array();
foreach ($operations as $key => $value)
  $actions[$key] = $key;


$is_soap_request = (strlen (trim ($GLOBALS ["HTTP_RAW_POST_DATA"])) > 0 ? true : false);


$settings = array ();

// SOAP
if ($is_soap_request)
  $settings['wsdl'] = "dns.wsdl";
// HTTP
else
  $settings['opParams'] = $parameters;

$settings['bindingStyle']   = "doclit";
$settings['cacheWSDL']      = false;
$settings['useWSA']         = true;
$settings['operations']     = $operations;
$settings['actions']        = $actions;
// XXX: disabled for testing purposes only
$settings['policy']         = $policy;
$settings['securityToken']  = $token;
$settings['serviceName']    = "LinuxDNSCluster";

$service = new WSService ($settings);
$service->reply();
----- /server -----

Regards,

Jeroen Koekkoek

> -----Original Message-----
> From: [hidden email] [mailto:wsf-php-user-
> [hidden email]] On Behalf Of Jeroen Koekkoek
> Sent: Tuesday, September 15, 2009 10:56 AM
> To: '[hidden email]'
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Hi Nandika,
>
> Thanks for your reply.
>
> After fiddling with axis2.xml and rampart's module.xml a bit, I got the
> RampartClientConfiguration to disappear. Throwing WSFaults is still
> troublesome. I also recompiled Axis2/C etc to use libxml2 and disabled
> Guththila.
>
> ----- wsf_php_server.log -----
> [Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159)
> [rampart][rampart_engine] Cannot get saved rampart_context
> [Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136)
> [rampart][rampart_out_handler] ramaprt_context creation failed.
> [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> RampartOutHandler invoke failed within phase MessageOut
> [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> MessageOut failed
> ----- /wsf_php_server.log -----
>
> ----- wsf_php_client.log -----
> [Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error occurred
> in transport
> [Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126)
> [rampart][rampart_in_handler] Security header cannot be found.
> [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> RampartInHandler invoke failed within phase Security
> [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> Security failed
> [Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation
> specific phases failed for operation __OPERATION_OUT_IN__
> ----- /wsf_php_client.log -----
>
> I included the PHP code for creating the policy etc below.
>
> The PHP code for test.php (client):
>
> ----- client -----
> $policy = new WSPolicy (array (
>   "security" => array (
>     "useUsernameToken" => true,
>     "includeTimeStamp" => true
>   )
> ));
>
> $token = new WSSecurityToken (array (
>   "user" => "bob",
>   "password" => "bob12",
>   "passwordType" => "Digest",
>   "ttl" => 300
> ));
>
> $settings = array ();
> $settings['useWSA'] = true;
> $settings['cacheWSDL'] = false;
> $settings['wsdl'] = 'dns.wsdl';
> $settings['policy'] = $policy;
> $settings['securityToken'] = $token;
>
> $client = new WSClient ($settings);
> ----- /client -----
>
> The PHP code for index.php (server):
>
> ----- server -----
> $settings['wsdl']           = 'dns.wsdl';
> $settings['bindingStyle']   = "doclit";
> $settings['cacheWSDL']      = false;
> $settings['useWSA']         = true;
> $settings['operations']     = $operations;
> $settings['actions']        = $actions;
> $settings['policy']         = $policy;
> $settings['securityToken']  = $token;
> $settings['serviceName']    = "LinuxDNSCluster";
>
> $service = new WSService ($settings);
> $service->reply();
> ----- /server -----
>
> Best regards,
> Jeroen Koekkoek
>
>
> From: [hidden email] [mailto:wsf-php-user-
> [hidden email]] On Behalf Of Nandika Jayawardana
> Sent: Tuesday, September 15, 2009 10:35 AM
> To: [hidden email]
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> I guess there should be something wrong with your WSPolicy object or
> WSSecurityToken object. RampartClientConfiguration is the object which
> carries data to rampart( Security Module ) and it is populated using
> WSPolicy object and WSSecurityToken object at PHP Level.
> Regards
> Nandika
> On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek <[hidden email]>
> wrote:
> Hi,
>
> I have a question regarding the use of WSFault objects and
> WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal operations
> while using WSPolicy+WSSecurityToken succeed, but when using them and
> throwing a WSFault I receive the following errors.
>
> ----- wsf_php_client.log -----
> [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> RampartClientConfiguration not set in message context
> [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> RampartClientConfiguration not set in message context
> [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> RampartClientConfiguration not set in message context
> [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> in transport
> [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> [rampart][rampart_in_handler] Security header cannot be found.
> [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> RampartInHandler invoke failed within phase PreDispatch
> [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> PreDispatch failed
> ----- /wsf_php_client.log -----
>
> ----- wsf_php_server.log -----
> [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> RampartClientConfiguration not set in message context
> [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> RampartClientConfiguration not set in message context
> [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> RampartClientConfiguration not set in message context
> [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> in transport
> [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> [rampart][rampart_in_handler] Security header cannot be found.
> [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> RampartInHandler invoke failed within phase PreDispatch
> [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> PreDispatch failed
> ----- /wsf_php_server.log -----
>
> These messages I receive when using the default xml's that come with
> WSF/PHP. When using modified xml files, the following lines appear
> every time.
>
> ----- wsf_php_server.log -----
> [Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159)
> [rampart][rampart_engine] Cannot get saved rampart_context
> [Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136)
> [rampart][rampart_out_handler] ramaprt_context creation failed.
> ----- /wsf_php_server.log -----
>
> I can't get the configuration to work. Does anyone have some pointers
> or know what's causing these errors to occur? I use Apache2/C 1.6.0,
> Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I
> created my own Debian packages.
>
> Thanks in advance.
>
> Best regards,
>
> Jeroen Koekkoek
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
>
>
> --
> Nandika Jayawardana
> Technical Lead and Project Manager, WSO2 Inc
> www.wso2.com "Open Source SOA Company"
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

Jeroen Koekkoek-3
Hi,

Ok, I created a very simple server/client to test with.

----- wsf_php_server.log -----
[Tue Sep 15 12:14:32 2009] [error] rampart_engine.c(159) [rampart][rampart_engine] Cannot get saved rampart_context
[Tue Sep 15 12:14:32 2009] [error] rampart_out_handler.c(136) [rampart][rampart_out_handler] ramaprt_context creation failed.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartOutHandler invoke failed within phase MessageOut
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase MessageOut failed
----- /wsf_php_server.log -----

----- wsf_php_client.log -----
[Tue Sep 15 12:14:32 2009] [error] http_sender.c(1411) Error occurred in transport
[Tue Sep 15 12:14:32 2009] [error] rampart_in_handler.c(126) [rampart][rampart_in_handler] Security header cannot be found.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartInHandler invoke failed within phase Security
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase Security failed
[Tue Sep 15 12:14:32 2009] [error] engine.c(279) Invoking operation specific phases failed for operation __OPERATION_OUT_IN__
----- /wsf_php_client.log -----

I attached the php files, hopefully someone can tell me where I go wrong.

Thanks in advance.

Regards,
Jeroen

> -----Original Message-----
> From: [hidden email] [mailto:wsf-php-user-
> [hidden email]] On Behalf Of Jeroen Koekkoek
> Sent: Tuesday, September 15, 2009 11:20 AM
> To: '[hidden email]'
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Sorry I didn't paste the entire server side code.
>
> ----- server -----
> /* WSF/PHP */
>
> $operations = array (
>   "DomainExistsByName"      => "DomainExistsByName",
>   "GetDomainByName"         => "GetDomainByName",
>   "CreateDomain"            => "CreateDomain",
>   "DeleteDomain"            => "DeleteDomain",
>   "RecordExistsByName"      => "RecordExistsByName",
>   "RecordExists"            => "RecordExists",
>   "GetRecordsByDomainName"  => "GetRecordsByDomainName",
>   "GetRecordsByName"        => "GetRecordsByName",
>   "GetRecord"               => "GetRecord",
>   "CreateRecord"            => "CreateRecord",
>   "ModifyRecord"            => "ModifyRecord",
>   "DeleteRecord"            => "DeleteRecord"
> );
>
> $parameters = array (
>   "DomainExistsByName"      => "MIXED",
>   "GetDomainByName"         => "MIXED",
>   "CreateDomain"            => "MIXED",
>   "DeleteDomain"            => "MIXED",
>   "RecordExistsByName"      => "MIXED",
>   "RecordExists"            => "MIXED",
>   "GetRecordsByDomainName"  => "MIXED",
>   "GetRecordsByName"        => "MIXED",
>   "GetRecord"               => "MIXED",
>   "CreateRecord"            => "MIXED",
>   "ModifyRecord"            => "MIXED",
>   "DeleteRecord"            => "MIXED"
> );
>
> $policy = new WSPolicy (array (
>   "security" => array (
>     "useUsernameToken" => true,
>     "includeTimeStamp" => true
>   )
> ));
>
> $token = new WSSecurityToken (array (
>   "user"               => "bob",
>   "password"           => "bob12",
>   "passwordType"       => "Digest",
>   "ttl"                => 100,
>   "enableReplayDetect" => false
> ));
>
> $actions = array();
> foreach ($operations as $key => $value)
>   $actions[$key] = $key;
>
>
> $is_soap_request = (strlen (trim ($GLOBALS ["HTTP_RAW_POST_DATA"])) > 0
> ? true : false);
>
>
> $settings = array ();
>
> // SOAP
> if ($is_soap_request)
>   $settings['wsdl'] = "dns.wsdl";
> // HTTP
> else
>   $settings['opParams'] = $parameters;
>
> $settings['bindingStyle']   = "doclit";
> $settings['cacheWSDL']      = false;
> $settings['useWSA']         = true;
> $settings['operations']     = $operations;
> $settings['actions']        = $actions;
> // XXX: disabled for testing purposes only
> $settings['policy']         = $policy;
> $settings['securityToken']  = $token;
> $settings['serviceName']    = "LinuxDNSCluster";
>
> $service = new WSService ($settings);
> $service->reply();
> ----- /server -----
>
> Regards,
>
> Jeroen Koekkoek
>
> > -----Original Message-----
> > From: [hidden email] [mailto:wsf-php-user-
> > [hidden email]] On Behalf Of Jeroen Koekkoek
> > Sent: Tuesday, September 15, 2009 10:56 AM
> > To: '[hidden email]'
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > Hi Nandika,
> >
> > Thanks for your reply.
> >
> > After fiddling with axis2.xml and rampart's module.xml a bit, I got
> the
> > RampartClientConfiguration to disappear. Throwing WSFaults is still
> > troublesome. I also recompiled Axis2/C etc to use libxml2 and
> disabled
> > Guththila.
> >
> > ----- wsf_php_server.log -----
> > [Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartOutHandler invoke failed within phase MessageOut
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > MessageOut failed
> > ----- /wsf_php_server.log -----
> >
> > ----- wsf_php_client.log -----
> > [Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase Security
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > Security failed
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation
> > specific phases failed for operation __OPERATION_OUT_IN__
> > ----- /wsf_php_client.log -----
> >
> > I included the PHP code for creating the policy etc below.
> >
> > The PHP code for test.php (client):
> >
> > ----- client -----
> > $policy = new WSPolicy (array (
> >   "security" => array (
> >     "useUsernameToken" => true,
> >     "includeTimeStamp" => true
> >   )
> > ));
> >
> > $token = new WSSecurityToken (array (
> >   "user" => "bob",
> >   "password" => "bob12",
> >   "passwordType" => "Digest",
> >   "ttl" => 300
> > ));
> >
> > $settings = array ();
> > $settings['useWSA'] = true;
> > $settings['cacheWSDL'] = false;
> > $settings['wsdl'] = 'dns.wsdl';
> > $settings['policy'] = $policy;
> > $settings['securityToken'] = $token;
> >
> > $client = new WSClient ($settings);
> > ----- /client -----
> >
> > The PHP code for index.php (server):
> >
> > ----- server -----
> > $settings['wsdl']           = 'dns.wsdl';
> > $settings['bindingStyle']   = "doclit";
> > $settings['cacheWSDL']      = false;
> > $settings['useWSA']         = true;
> > $settings['operations']     = $operations;
> > $settings['actions']        = $actions;
> > $settings['policy']         = $policy;
> > $settings['securityToken']  = $token;
> > $settings['serviceName']    = "LinuxDNSCluster";
> >
> > $service = new WSService ($settings);
> > $service->reply();
> > ----- /server -----
> >
> > Best regards,
> > Jeroen Koekkoek
> >
> >
> > From: [hidden email] [mailto:wsf-php-user-
> > [hidden email]] On Behalf Of Nandika Jayawardana
> > Sent: Tuesday, September 15, 2009 10:35 AM
> > To: [hidden email]
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > I guess there should be something wrong with your WSPolicy object or
> > WSSecurityToken object. RampartClientConfiguration is the object
> which
> > carries data to rampart( Security Module ) and it is populated using
> > WSPolicy object and WSSecurityToken object at PHP Level.
> > Regards
> > Nandika
> > On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek
> <[hidden email]>
> > wrote:
> > Hi,
> >
> > I have a question regarding the use of WSFault objects and
> > WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal
> operations
> > while using WSPolicy+WSSecurityToken succeed, but when using them and
> > throwing a WSFault I receive the following errors.
> >
> > ----- wsf_php_client.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_client.log -----
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_server.log -----
> >
> > These messages I receive when using the default xml's that come with
> > WSF/PHP. When using modified xml files, the following lines appear
> > every time.
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > ----- /wsf_php_server.log -----
> >
> > I can't get the configuration to work. Does anyone have some pointers
> > or know what's causing these errors to occur? I use Apache2/C 1.6.0,
> > Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I
> > created my own Debian packages.
> >
> > Thanks in advance.
> >
> > Best regards,
> >
> > Jeroen Koekkoek
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> >
> >
> >
> > --
> > Nandika Jayawardana
> > Technical Lead and Project Manager, WSO2 Inc
> > www.wso2.com "Open Source SOA Company"
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

client.php (2K) Download Attachment
server.php (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

fmireaux
Hello,

Some time ago I pursue the same problem and it seems to be an Axis2/Rampart
problem. In the Axis2 receiver handler (core/receivers/msg_recv.c), a SOAP
Fault response is not send as is like normal response but delegated to http
transport (http_transport_utils.c) which create a new fresh output message
context without the needed rampart context (copied from the input message
context in normal process) : two different functions are used to create the
output message contexts.

I don't try to write an Rampart/C test, so I don't use Rampart/C JIRA.

Note : if you don't look at log file,  process seems to be OK : client
receives properly the WSFault (translated to an exception). But there are no
security headers.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: "Jeroen Koekkoek" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, September 15, 2009 12:26 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C


Hi,

Ok, I created a very simple server/client to test with.

----- wsf_php_server.log -----
[Tue Sep 15 12:14:32 2009] [error] rampart_engine.c(159)
[rampart][rampart_engine] Cannot get saved rampart_context
[Tue Sep 15 12:14:32 2009] [error] rampart_out_handler.c(136)
[rampart][rampart_out_handler] ramaprt_context creation failed.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartOutHandler
invoke failed within phase MessageOut
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase MessageOut
failed
----- /wsf_php_server.log -----

----- wsf_php_client.log -----
[Tue Sep 15 12:14:32 2009] [error] http_sender.c(1411) Error occurred in
transport
[Tue Sep 15 12:14:32 2009] [error] rampart_in_handler.c(126)
[rampart][rampart_in_handler] Security header cannot be found.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartInHandler
invoke failed within phase Security
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase Security
failed
[Tue Sep 15 12:14:32 2009] [error] engine.c(279) Invoking operation specific
phases failed for operation __OPERATION_OUT_IN__
----- /wsf_php_client.log -----

I attached the php files, hopefully someone can tell me where I go wrong.

Thanks in advance.

Regards,
Jeroen

> -----Original Message-----
> From: [hidden email] [mailto:wsf-php-user-
> [hidden email]] On Behalf Of Jeroen Koekkoek
> Sent: Tuesday, September 15, 2009 11:20 AM
> To: '[hidden email]'
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Sorry I didn't paste the entire server side code.
>
> ----- server -----
> /* WSF/PHP */
>
> $operations = array (
>   "DomainExistsByName"      => "DomainExistsByName",
>   "GetDomainByName"         => "GetDomainByName",
>   "CreateDomain"            => "CreateDomain",
>   "DeleteDomain"            => "DeleteDomain",
>   "RecordExistsByName"      => "RecordExistsByName",
>   "RecordExists"            => "RecordExists",
>   "GetRecordsByDomainName"  => "GetRecordsByDomainName",
>   "GetRecordsByName"        => "GetRecordsByName",
>   "GetRecord"               => "GetRecord",
>   "CreateRecord"            => "CreateRecord",
>   "ModifyRecord"            => "ModifyRecord",
>   "DeleteRecord"            => "DeleteRecord"
> );
>
> $parameters = array (
>   "DomainExistsByName"      => "MIXED",
>   "GetDomainByName"         => "MIXED",
>   "CreateDomain"            => "MIXED",
>   "DeleteDomain"            => "MIXED",
>   "RecordExistsByName"      => "MIXED",
>   "RecordExists"            => "MIXED",
>   "GetRecordsByDomainName"  => "MIXED",
>   "GetRecordsByName"        => "MIXED",
>   "GetRecord"               => "MIXED",
>   "CreateRecord"            => "MIXED",
>   "ModifyRecord"            => "MIXED",
>   "DeleteRecord"            => "MIXED"
> );
>
> $policy = new WSPolicy (array (
>   "security" => array (
>     "useUsernameToken" => true,
>     "includeTimeStamp" => true
>   )
> ));
>
> $token = new WSSecurityToken (array (
>   "user"               => "bob",
>   "password"           => "bob12",
>   "passwordType"       => "Digest",
>   "ttl"                => 100,
>   "enableReplayDetect" => false
> ));
>
> $actions = array();
> foreach ($operations as $key => $value)
>   $actions[$key] = $key;
>
>
> $is_soap_request = (strlen (trim ($GLOBALS ["HTTP_RAW_POST_DATA"])) > 0
> ? true : false);
>
>
> $settings = array ();
>
> // SOAP
> if ($is_soap_request)
>   $settings['wsdl'] = "dns.wsdl";
> // HTTP
> else
>   $settings['opParams'] = $parameters;
>
> $settings['bindingStyle']   = "doclit";
> $settings['cacheWSDL']      = false;
> $settings['useWSA']         = true;
> $settings['operations']     = $operations;
> $settings['actions']        = $actions;
> // XXX: disabled for testing purposes only
> $settings['policy']         = $policy;
> $settings['securityToken']  = $token;
> $settings['serviceName']    = "LinuxDNSCluster";
>
> $service = new WSService ($settings);
> $service->reply();
> ----- /server -----
>
> Regards,
>
> Jeroen Koekkoek
>
> > -----Original Message-----
> > From: [hidden email] [mailto:wsf-php-user-
> > [hidden email]] On Behalf Of Jeroen Koekkoek
> > Sent: Tuesday, September 15, 2009 10:56 AM
> > To: '[hidden email]'
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > Hi Nandika,
> >
> > Thanks for your reply.
> >
> > After fiddling with axis2.xml and rampart's module.xml a bit, I got
> the
> > RampartClientConfiguration to disappear. Throwing WSFaults is still
> > troublesome. I also recompiled Axis2/C etc to use libxml2 and
> disabled
> > Guththila.
> >
> > ----- wsf_php_server.log -----
> > [Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartOutHandler invoke failed within phase MessageOut
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > MessageOut failed
> > ----- /wsf_php_server.log -----
> >
> > ----- wsf_php_client.log -----
> > [Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase Security
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > Security failed
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation
> > specific phases failed for operation __OPERATION_OUT_IN__
> > ----- /wsf_php_client.log -----
> >
> > I included the PHP code for creating the policy etc below.
> >
> > The PHP code for test.php (client):
> >
> > ----- client -----
> > $policy = new WSPolicy (array (
> >   "security" => array (
> >     "useUsernameToken" => true,
> >     "includeTimeStamp" => true
> >   )
> > ));
> >
> > $token = new WSSecurityToken (array (
> >   "user" => "bob",
> >   "password" => "bob12",
> >   "passwordType" => "Digest",
> >   "ttl" => 300
> > ));
> >
> > $settings = array ();
> > $settings['useWSA'] = true;
> > $settings['cacheWSDL'] = false;
> > $settings['wsdl'] = 'dns.wsdl';
> > $settings['policy'] = $policy;
> > $settings['securityToken'] = $token;
> >
> > $client = new WSClient ($settings);
> > ----- /client -----
> >
> > The PHP code for index.php (server):
> >
> > ----- server -----
> > $settings['wsdl']           = 'dns.wsdl';
> > $settings['bindingStyle']   = "doclit";
> > $settings['cacheWSDL']      = false;
> > $settings['useWSA']         = true;
> > $settings['operations']     = $operations;
> > $settings['actions']        = $actions;
> > $settings['policy']         = $policy;
> > $settings['securityToken']  = $token;
> > $settings['serviceName']    = "LinuxDNSCluster";
> >
> > $service = new WSService ($settings);
> > $service->reply();
> > ----- /server -----
> >
> > Best regards,
> > Jeroen Koekkoek
> >
> >
> > From: [hidden email] [mailto:wsf-php-user-
> > [hidden email]] On Behalf Of Nandika Jayawardana
> > Sent: Tuesday, September 15, 2009 10:35 AM
> > To: [hidden email]
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > I guess there should be something wrong with your WSPolicy object or
> > WSSecurityToken object. RampartClientConfiguration is the object
> which
> > carries data to rampart( Security Module ) and it is populated using
> > WSPolicy object and WSSecurityToken object at PHP Level.
> > Regards
> > Nandika
> > On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek
> <[hidden email]>
> > wrote:
> > Hi,
> >
> > I have a question regarding the use of WSFault objects and
> > WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal
> operations
> > while using WSPolicy+WSSecurityToken succeed, but when using them and
> > throwing a WSFault I receive the following errors.
> >
> > ----- wsf_php_client.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_client.log -----
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_server.log -----
> >
> > These messages I receive when using the default xml's that come with
> > WSF/PHP. When using modified xml files, the following lines appear
> > every time.
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > ----- /wsf_php_server.log -----
> >
> > I can't get the configuration to work. Does anyone have some pointers
> > or know what's causing these errors to occur? I use Apache2/C 1.6.0,
> > Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I
> > created my own Debian packages.
> >
> > Thanks in advance.
> >
> > Best regards,
> >
> > Jeroen Koekkoek
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> >
> >
> >
> > --
> > Nandika Jayawardana
> > Technical Lead and Project Manager, WSO2 Inc
> > www.wso2.com "Open Source SOA Company"
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



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


> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>




_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

Nandika Jayawardana
Hi Jeroen,
Can you create a jira with the source files and log files attached. I will look into this issue.

Regards
Nandika

2009/9/15 François Mireaux <[hidden email]>
Hello,

Some time ago I pursue the same problem and it seems to be an Axis2/Rampart
problem. In the Axis2 receiver handler (core/receivers/msg_recv.c), a SOAP
Fault response is not send as is like normal response but delegated to http
transport (http_transport_utils.c) which create a new fresh output message
context without the needed rampart context (copied from the input message
context in normal process) : two different functions are used to create the
output message contexts.

I don't try to write an Rampart/C test, so I don't use Rampart/C JIRA.

Note : if you don't look at log file,  process seems to be OK : client
receives properly the WSFault (translated to an exception). But there are no
security headers.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: "Jeroen Koekkoek" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, September 15, 2009 12:26 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C


Hi,

Ok, I created a very simple server/client to test with.

----- wsf_php_server.log -----
[Tue Sep 15 12:14:32 2009] [error] rampart_engine.c(159)
[rampart][rampart_engine] Cannot get saved rampart_context
[Tue Sep 15 12:14:32 2009] [error] rampart_out_handler.c(136)
[rampart][rampart_out_handler] ramaprt_context creation failed.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartOutHandler
invoke failed within phase MessageOut
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase MessageOut
failed
----- /wsf_php_server.log -----

----- wsf_php_client.log -----
[Tue Sep 15 12:14:32 2009] [error] http_sender.c(1411) Error occurred in
transport
[Tue Sep 15 12:14:32 2009] [error] rampart_in_handler.c(126)
[rampart][rampart_in_handler] Security header cannot be found.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartInHandler
invoke failed within phase Security
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase Security
failed
[Tue Sep 15 12:14:32 2009] [error] engine.c(279) Invoking operation specific
phases failed for operation __OPERATION_OUT_IN__
----- /wsf_php_client.log -----

I attached the php files, hopefully someone can tell me where I go wrong.

Thanks in advance.

Regards,
Jeroen

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]
> [hidden email]] On Behalf Of Jeroen Koekkoek
> Sent: Tuesday, September 15, 2009 11:20 AM
> To: '[hidden email]'
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Sorry I didn't paste the entire server side code.
>
> ----- server -----
> /* WSF/PHP */
>
> $operations = array (
>   "DomainExistsByName"      => "DomainExistsByName",
>   "GetDomainByName"         => "GetDomainByName",
>   "CreateDomain"            => "CreateDomain",
>   "DeleteDomain"            => "DeleteDomain",
>   "RecordExistsByName"      => "RecordExistsByName",
>   "RecordExists"            => "RecordExists",
>   "GetRecordsByDomainName"  => "GetRecordsByDomainName",
>   "GetRecordsByName"        => "GetRecordsByName",
>   "GetRecord"               => "GetRecord",
>   "CreateRecord"            => "CreateRecord",
>   "ModifyRecord"            => "ModifyRecord",
>   "DeleteRecord"            => "DeleteRecord"
> );
>
> $parameters = array (
>   "DomainExistsByName"      => "MIXED",
>   "GetDomainByName"         => "MIXED",
>   "CreateDomain"            => "MIXED",
>   "DeleteDomain"            => "MIXED",
>   "RecordExistsByName"      => "MIXED",
>   "RecordExists"            => "MIXED",
>   "GetRecordsByDomainName"  => "MIXED",
>   "GetRecordsByName"        => "MIXED",
>   "GetRecord"               => "MIXED",
>   "CreateRecord"            => "MIXED",
>   "ModifyRecord"            => "MIXED",
>   "DeleteRecord"            => "MIXED"
> );
>
> $policy = new WSPolicy (array (
>   "security" => array (
>     "useUsernameToken" => true,
>     "includeTimeStamp" => true
>   )
> ));
>
> $token = new WSSecurityToken (array (
>   "user"               => "bob",
>   "password"           => "bob12",
>   "passwordType"       => "Digest",
>   "ttl"                => 100,
>   "enableReplayDetect" => false
> ));
>
> $actions = array();
> foreach ($operations as $key => $value)
>   $actions[$key] = $key;
>
>
> $is_soap_request = (strlen (trim ($GLOBALS ["HTTP_RAW_POST_DATA"])) > 0
> ? true : false);
>
>
> $settings = array ();
>
> // SOAP
> if ($is_soap_request)
>   $settings['wsdl'] = "dns.wsdl";
> // HTTP
> else
>   $settings['opParams'] = $parameters;
>
> $settings['bindingStyle']   = "doclit";
> $settings['cacheWSDL']      = false;
> $settings['useWSA']         = true;
> $settings['operations']     = $operations;
> $settings['actions']        = $actions;
> // XXX: disabled for testing purposes only
> $settings['policy']         = $policy;
> $settings['securityToken']  = $token;
> $settings['serviceName']    = "LinuxDNSCluster";
>
> $service = new WSService ($settings);
> $service->reply();
> ----- /server -----
>
> Regards,
>
> Jeroen Koekkoek
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]
> > [hidden email]] On Behalf Of Jeroen Koekkoek
> > Sent: Tuesday, September 15, 2009 10:56 AM
> > To: '[hidden email]'
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > Hi Nandika,
> >
> > Thanks for your reply.
> >
> > After fiddling with axis2.xml and rampart's module.xml a bit, I got
> the
> > RampartClientConfiguration to disappear. Throwing WSFaults is still
> > troublesome. I also recompiled Axis2/C etc to use libxml2 and
> disabled
> > Guththila.
> >
> > ----- wsf_php_server.log -----
> > [Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartOutHandler invoke failed within phase MessageOut
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > MessageOut failed
> > ----- /wsf_php_server.log -----
> >
> > ----- wsf_php_client.log -----
> > [Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase Security
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > Security failed
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation
> > specific phases failed for operation __OPERATION_OUT_IN__
> > ----- /wsf_php_client.log -----
> >
> > I included the PHP code for creating the policy etc below.
> >
> > The PHP code for test.php (client):
> >
> > ----- client -----
> > $policy = new WSPolicy (array (
> >   "security" => array (
> >     "useUsernameToken" => true,
> >     "includeTimeStamp" => true
> >   )
> > ));
> >
> > $token = new WSSecurityToken (array (
> >   "user" => "bob",
> >   "password" => "bob12",
> >   "passwordType" => "Digest",
> >   "ttl" => 300
> > ));
> >
> > $settings = array ();
> > $settings['useWSA'] = true;
> > $settings['cacheWSDL'] = false;
> > $settings['wsdl'] = 'dns.wsdl';
> > $settings['policy'] = $policy;
> > $settings['securityToken'] = $token;
> >
> > $client = new WSClient ($settings);
> > ----- /client -----
> >
> > The PHP code for index.php (server):
> >
> > ----- server -----
> > $settings['wsdl']           = 'dns.wsdl';
> > $settings['bindingStyle']   = "doclit";
> > $settings['cacheWSDL']      = false;
> > $settings['useWSA']         = true;
> > $settings['operations']     = $operations;
> > $settings['actions']        = $actions;
> > $settings['policy']         = $policy;
> > $settings['securityToken']  = $token;
> > $settings['serviceName']    = "LinuxDNSCluster";
> >
> > $service = new WSService ($settings);
> > $service->reply();
> > ----- /server -----
> >
> > Best regards,
> > Jeroen Koekkoek
> >
> >
> > From: [hidden email] [mailto:[hidden email]
> > [hidden email]] On Behalf Of Nandika Jayawardana
> > Sent: Tuesday, September 15, 2009 10:35 AM
> > To: [hidden email]
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > I guess there should be something wrong with your WSPolicy object or
> > WSSecurityToken object. RampartClientConfiguration is the object
> which
> > carries data to rampart( Security Module ) and it is populated using
> > WSPolicy object and WSSecurityToken object at PHP Level.
> > Regards
> > Nandika
> > On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek
> <[hidden email]>
> > wrote:
> > Hi,
> >
> > I have a question regarding the use of WSFault objects and
> > WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal
> operations
> > while using WSPolicy+WSSecurityToken succeed, but when using them and
> > throwing a WSFault I receive the following errors.
> >
> > ----- wsf_php_client.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_client.log -----
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_server.log -----
> >
> > These messages I receive when using the default xml's that come with
> > WSF/PHP. When using modified xml files, the following lines appear
> > every time.
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > ----- /wsf_php_server.log -----
> >
> > I can't get the configuration to work. Does anyone have some pointers
> > or know what's causing these errors to occur? I use Apache2/C 1.6.0,
> > Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I
> > created my own Debian packages.
> >
> > Thanks in advance.
> >
> > Best regards,
> >
> > Jeroen Koekkoek
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> >
> >
> >
> > --
> > Nandika Jayawardana
> > Technical Lead and Project Manager, WSO2 Inc
> > www.wso2.com "Open Source SOA Company"
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



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


> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>




_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"


_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

fmireaux
Hello,
 
Adding this code (extracted from axis2_core_utils_create_out_msg_ctx in Axis2 core/utils/core_utils.c) at the end of axis2_engine_create_fault_msg_ctx in Axis2 core/engine/engine.c corrects the problem :
 
    if ( 1 == 1 ) { // for ctx declaration
      axis2_ctx_t *ctx = axis2_msg_ctx_get_base(processing_context, env);
      if (ctx)
      {
        axis2_ctx_t *new_ctx = axis2_msg_ctx_get_base(fault_ctx, env);
        if (new_ctx)
        {
            axis2_ctx_set_property_map(new_ctx, env,
                                       axis2_ctx_get_property_map(ctx, env));
        } 
    }
But I don't enough master Axis2/C to be sure that this solution is allways OK.
 
François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
Sent: Tuesday, September 15, 2009 5:54 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Hi Jeroen,
Can you create a jira with the source files and log files attached. I will look into this issue.

Regards
Nandika

2009/9/15 François Mireaux <[hidden email]>
Hello,

Some time ago I pursue the same problem and it seems to be an Axis2/Rampart
problem. In the Axis2 receiver handler (core/receivers/msg_recv.c), a SOAP
Fault response is not send as is like normal response but delegated to http
transport (http_transport_utils.c) which create a new fresh output message
context without the needed rampart context (copied from the input message
context in normal process) : two different functions are used to create the
output message contexts.

I don't try to write an Rampart/C test, so I don't use Rampart/C JIRA.

Note : if you don't look at log file,  process seems to be OK : client
receives properly the WSFault (translated to an exception). But there are no
security headers.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: "Jeroen Koekkoek" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, September 15, 2009 12:26 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C


Hi,

Ok, I created a very simple server/client to test with.

----- wsf_php_server.log -----
[Tue Sep 15 12:14:32 2009] [error] rampart_engine.c(159)
[rampart][rampart_engine] Cannot get saved rampart_context
[Tue Sep 15 12:14:32 2009] [error] rampart_out_handler.c(136)
[rampart][rampart_out_handler] ramaprt_context creation failed.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartOutHandler
invoke failed within phase MessageOut
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase MessageOut
failed
----- /wsf_php_server.log -----

----- wsf_php_client.log -----
[Tue Sep 15 12:14:32 2009] [error] http_sender.c(1411) Error occurred in
transport
[Tue Sep 15 12:14:32 2009] [error] rampart_in_handler.c(126)
[rampart][rampart_in_handler] Security header cannot be found.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartInHandler
invoke failed within phase Security
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase Security
failed
[Tue Sep 15 12:14:32 2009] [error] engine.c(279) Invoking operation specific
phases failed for operation __OPERATION_OUT_IN__
----- /wsf_php_client.log -----

I attached the php files, hopefully someone can tell me where I go wrong.

Thanks in advance.

Regards,
Jeroen

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]
> [hidden email]] On Behalf Of Jeroen Koekkoek
> Sent: Tuesday, September 15, 2009 11:20 AM
> To: '[hidden email]'
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Sorry I didn't paste the entire server side code.
>
> ----- server -----
> /* WSF/PHP */
>
> $operations = array (
>   "DomainExistsByName"      => "DomainExistsByName",
>   "GetDomainByName"         => "GetDomainByName",
>   "CreateDomain"            => "CreateDomain",
>   "DeleteDomain"            => "DeleteDomain",
>   "RecordExistsByName"      => "RecordExistsByName",
>   "RecordExists"            => "RecordExists",
>   "GetRecordsByDomainName"  => "GetRecordsByDomainName",
>   "GetRecordsByName"        => "GetRecordsByName",
>   "GetRecord"               => "GetRecord",
>   "CreateRecord"            => "CreateRecord",
>   "ModifyRecord"            => "ModifyRecord",
>   "DeleteRecord"            => "DeleteRecord"
> );
>
> $parameters = array (
>   "DomainExistsByName"      => "MIXED",
>   "GetDomainByName"         => "MIXED",
>   "CreateDomain"            => "MIXED",
>   "DeleteDomain"            => "MIXED",
>   "RecordExistsByName"      => "MIXED",
>   "RecordExists"            => "MIXED",
>   "GetRecordsByDomainName"  => "MIXED",
>   "GetRecordsByName"        => "MIXED",
>   "GetRecord"               => "MIXED",
>   "CreateRecord"            => "MIXED",
>   "ModifyRecord"            => "MIXED",
>   "DeleteRecord"            => "MIXED"
> );
>
> $policy = new WSPolicy (array (
>   "security" => array (
>     "useUsernameToken" => true,
>     "includeTimeStamp" => true
>   )
> ));
>
> $token = new WSSecurityToken (array (
>   "user"               => "bob",
>   "password"           => "bob12",
>   "passwordType"       => "Digest",
>   "ttl"                => 100,
>   "enableReplayDetect" => false
> ));
>
> $actions = array();
> foreach ($operations as $key => $value)
>   $actions[$key] = $key;
>
>
> $is_soap_request = (strlen (trim ($GLOBALS ["HTTP_RAW_POST_DATA"])) > 0
> ? true : false);
>
>
> $settings = array ();
>
> // SOAP
> if ($is_soap_request)
>   $settings['wsdl'] = "dns.wsdl";
> // HTTP
> else
>   $settings['opParams'] = $parameters;
>
> $settings['bindingStyle']   = "doclit";
> $settings['cacheWSDL']      = false;
> $settings['useWSA']         = true;
> $settings['operations']     = $operations;
> $settings['actions']        = $actions;
> // XXX: disabled for testing purposes only
> $settings['policy']         = $policy;
> $settings['securityToken']  = $token;
> $settings['serviceName']    = "LinuxDNSCluster";
>
> $service = new WSService ($settings);
> $service->reply();
> ----- /server -----
>
> Regards,
>
> Jeroen Koekkoek
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]
> > [hidden email]] On Behalf Of Jeroen Koekkoek
> > Sent: Tuesday, September 15, 2009 10:56 AM
> > To: '[hidden email]'
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > Hi Nandika,
> >
> > Thanks for your reply.
> >
> > After fiddling with axis2.xml and rampart's module.xml a bit, I got
> the
> > RampartClientConfiguration to disappear. Throwing WSFaults is still
> > troublesome. I also recompiled Axis2/C etc to use libxml2 and
> disabled
> > Guththila.
> >
> > ----- wsf_php_server.log -----
> > [Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartOutHandler invoke failed within phase MessageOut
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > MessageOut failed
> > ----- /wsf_php_server.log -----
> >
> > ----- wsf_php_client.log -----
> > [Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase Security
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > Security failed
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation
> > specific phases failed for operation __OPERATION_OUT_IN__
> > ----- /wsf_php_client.log -----
> >
> > I included the PHP code for creating the policy etc below.
> >
> > The PHP code for test.php (client):
> >
> > ----- client -----
> > $policy = new WSPolicy (array (
> >   "security" => array (
> >     "useUsernameToken" => true,
> >     "includeTimeStamp" => true
> >   )
> > ));
> >
> > $token = new WSSecurityToken (array (
> >   "user" => "bob",
> >   "password" => "bob12",
> >   "passwordType" => "Digest",
> >   "ttl" => 300
> > ));
> >
> > $settings = array ();
> > $settings['useWSA'] = true;
> > $settings['cacheWSDL'] = false;
> > $settings['wsdl'] = 'dns.wsdl';
> > $settings['policy'] = $policy;
> > $settings['securityToken'] = $token;
> >
> > $client = new WSClient ($settings);
> > ----- /client -----
> >
> > The PHP code for index.php (server):
> >
> > ----- server -----
> > $settings['wsdl']           = 'dns.wsdl';
> > $settings['bindingStyle']   = "doclit";
> > $settings['cacheWSDL']      = false;
> > $settings['useWSA']         = true;
> > $settings['operations']     = $operations;
> > $settings['actions']        = $actions;
> > $settings['policy']         = $policy;
> > $settings['securityToken']  = $token;
> > $settings['serviceName']    = "LinuxDNSCluster";
> >
> > $service = new WSService ($settings);
> > $service->reply();
> > ----- /server -----
> >
> > Best regards,
> > Jeroen Koekkoek
> >
> >
> > From: [hidden email] [mailto:[hidden email]
> > [hidden email]] On Behalf Of Nandika Jayawardana
> > Sent: Tuesday, September 15, 2009 10:35 AM
> > To: [hidden email]
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > I guess there should be something wrong with your WSPolicy object or
> > WSSecurityToken object. RampartClientConfiguration is the object
> which
> > carries data to rampart( Security Module ) and it is populated using
> > WSPolicy object and WSSecurityToken object at PHP Level.
> > Regards
> > Nandika
> > On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek
> <[hidden email]>
> > wrote:
> > Hi,
> >
> > I have a question regarding the use of WSFault objects and
> > WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal
> operations
> > while using WSPolicy+WSSecurityToken succeed, but when using them and
> > throwing a WSFault I receive the following errors.
> >
> > ----- wsf_php_client.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_client.log -----
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_server.log -----
> >
> > These messages I receive when using the default xml's that come with
> > WSF/PHP. When using modified xml files, the following lines appear
> > every time.
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > ----- /wsf_php_server.log -----
> >
> > I can't get the configuration to work. Does anyone have some pointers
> > or know what's causing these errors to occur? I use Apache2/C 1.6.0,
> > Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I
> > created my own Debian packages.
> >
> > Thanks in advance.
> >
> > Best regards,
> >
> > Jeroen Koekkoek
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> >
> >
> >
> > --
> > Nandika Jayawardana
> > Technical Lead and Project Manager, WSO2 Inc
> > www.wso2.com "Open Source SOA Company"
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



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


> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>




_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"


_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

Jeroen Koekkoek-3
Hi François,

This fixed the problem for me. Thanks! I'll report problems if I encounter them.

Nandika, do you still want me to create a jira?

Best regards,
Jeroen

From: [hidden email] [mailto:[hidden email]] On Behalf Of François Mireaux
Sent: Wednesday, September 16, 2009 8:34 AM
To: [hidden email]
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Hello,

Adding this code (extracted from axis2_core_utils_create_out_msg_ctx in Axis2 core/utils/core_utils.c) at the end of axis2_engine_create_fault_msg_ctx in Axis2 core/engine/engine.c corrects the problem :

    if ( 1 == 1 ) { // for ctx declaration
      axis2_ctx_t *ctx = axis2_msg_ctx_get_base(processing_context, env);
      if (ctx)
      {
        axis2_ctx_t *new_ctx = axis2_msg_ctx_get_base(fault_ctx, env);
        if (new_ctx)
        {
            axis2_ctx_set_property_map(new_ctx, env,
                                       axis2_ctx_get_property_map(ctx, env));
        }
    }
But I don't enough master Axis2/C to be sure that this solution is allways OK.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: Nandika Jayawardana
To: [hidden email]
Sent: Tuesday, September 15, 2009 5:54 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Hi Jeroen,
Can you create a jira with the source files and log files attached. I will look into this issue.

Regards
Nandika
2009/9/15 François Mireaux <[hidden email]>
Hello,

Some time ago I pursue the same problem and it seems to be an Axis2/Rampart
problem. In the Axis2 receiver handler (core/receivers/msg_recv.c), a SOAP
Fault response is not send as is like normal response but delegated to http
transport (http_transport_utils.c) which create a new fresh output message
context without the needed rampart context (copied from the input message
context in normal process) : two different functions are used to create the
output message contexts.

I don't try to write an Rampart/C test, so I don't use Rampart/C JIRA.

Note : if you don't look at log file,  process seems to be OK : client
receives properly the WSFault (translated to an exception). But there are no
security headers.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: "Jeroen Koekkoek" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, September 15, 2009 12:26 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C


Hi,

Ok, I created a very simple server/client to test with.

----- wsf_php_server.log -----
[Tue Sep 15 12:14:32 2009] [error] rampart_engine.c(159)
[rampart][rampart_engine] Cannot get saved rampart_context
[Tue Sep 15 12:14:32 2009] [error] rampart_out_handler.c(136)
[rampart][rampart_out_handler] ramaprt_context creation failed.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartOutHandler
invoke failed within phase MessageOut
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase MessageOut
failed
----- /wsf_php_server.log -----

----- wsf_php_client.log -----
[Tue Sep 15 12:14:32 2009] [error] http_sender.c(1411) Error occurred in
transport
[Tue Sep 15 12:14:32 2009] [error] rampart_in_handler.c(126)
[rampart][rampart_in_handler] Security header cannot be found.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartInHandler
invoke failed within phase Security
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase Security
failed
[Tue Sep 15 12:14:32 2009] [error] engine.c(279) Invoking operation specific
phases failed for operation __OPERATION_OUT_IN__
----- /wsf_php_client.log -----

I attached the php files, hopefully someone can tell me where I go wrong.

Thanks in advance.

Regards,
Jeroen

> -----Original Message-----
> From: [hidden email] [mailto:wsf-php-user-
> [hidden email]] On Behalf Of Jeroen Koekkoek
> Sent: Tuesday, September 15, 2009 11:20 AM
> To: '[hidden email]'
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Sorry I didn't paste the entire server side code.
>
> ----- server -----
> /* WSF/PHP */
>
> $operations = array (
>   "DomainExistsByName"      => "DomainExistsByName",
>   "GetDomainByName"         => "GetDomainByName",
>   "CreateDomain"            => "CreateDomain",
>   "DeleteDomain"            => "DeleteDomain",
>   "RecordExistsByName"      => "RecordExistsByName",
>   "RecordExists"            => "RecordExists",
>   "GetRecordsByDomainName"  => "GetRecordsByDomainName",
>   "GetRecordsByName"        => "GetRecordsByName",
>   "GetRecord"               => "GetRecord",
>   "CreateRecord"            => "CreateRecord",
>   "ModifyRecord"            => "ModifyRecord",
>   "DeleteRecord"            => "DeleteRecord"
> );
>
> $parameters = array (
>   "DomainExistsByName"      => "MIXED",
>   "GetDomainByName"         => "MIXED",
>   "CreateDomain"            => "MIXED",
>   "DeleteDomain"            => "MIXED",
>   "RecordExistsByName"      => "MIXED",
>   "RecordExists"            => "MIXED",
>   "GetRecordsByDomainName"  => "MIXED",
>   "GetRecordsByName"        => "MIXED",
>   "GetRecord"               => "MIXED",
>   "CreateRecord"            => "MIXED",
>   "ModifyRecord"            => "MIXED",
>   "DeleteRecord"            => "MIXED"
> );
>
> $policy = new WSPolicy (array (
>   "security" => array (
>     "useUsernameToken" => true,
>     "includeTimeStamp" => true
>   )
> ));
>
> $token = new WSSecurityToken (array (
>   "user"               => "bob",
>   "password"           => "bob12",
>   "passwordType"       => "Digest",
>   "ttl"                => 100,
>   "enableReplayDetect" => false
> ));
>
> $actions = array();
> foreach ($operations as $key => $value)
>   $actions[$key] = $key;
>
>
> $is_soap_request = (strlen (trim ($GLOBALS ["HTTP_RAW_POST_DATA"])) > 0
> ? true : false);
>
>
> $settings = array ();
>
> // SOAP
> if ($is_soap_request)
>   $settings['wsdl'] = "dns.wsdl";
> // HTTP
> else
>   $settings['opParams'] = $parameters;
>
> $settings['bindingStyle']   = "doclit";
> $settings['cacheWSDL']      = false;
> $settings['useWSA']         = true;
> $settings['operations']     = $operations;
> $settings['actions']        = $actions;
> // XXX: disabled for testing purposes only
> $settings['policy']         = $policy;
> $settings['securityToken']  = $token;
> $settings['serviceName']    = "LinuxDNSCluster";
>
> $service = new WSService ($settings);
> $service->reply();
> ----- /server -----
>
> Regards,
>
> Jeroen Koekkoek
>
> > -----Original Message-----
> > From: [hidden email] [mailto:wsf-php-user-
> > [hidden email]] On Behalf Of Jeroen Koekkoek
> > Sent: Tuesday, September 15, 2009 10:56 AM
> > To: '[hidden email]'
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > Hi Nandika,
> >
> > Thanks for your reply.
> >
> > After fiddling with axis2.xml and rampart's module.xml a bit, I got
> the
> > RampartClientConfiguration to disappear. Throwing WSFaults is still
> > troublesome. I also recompiled Axis2/C etc to use libxml2 and
> disabled
> > Guththila.
> >
> > ----- wsf_php_server.log -----
> > [Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartOutHandler invoke failed within phase MessageOut
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > MessageOut failed
> > ----- /wsf_php_server.log -----
> >
> > ----- wsf_php_client.log -----
> > [Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase Security
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > Security failed
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation
> > specific phases failed for operation __OPERATION_OUT_IN__
> > ----- /wsf_php_client.log -----
> >
> > I included the PHP code for creating the policy etc below.
> >
> > The PHP code for test.php (client):
> >
> > ----- client -----
> > $policy = new WSPolicy (array (
> >   "security" => array (
> >     "useUsernameToken" => true,
> >     "includeTimeStamp" => true
> >   )
> > ));
> >
> > $token = new WSSecurityToken (array (
> >   "user" => "bob",
> >   "password" => "bob12",
> >   "passwordType" => "Digest",
> >   "ttl" => 300
> > ));
> >
> > $settings = array ();
> > $settings['useWSA'] = true;
> > $settings['cacheWSDL'] = false;
> > $settings['wsdl'] = 'dns.wsdl';
> > $settings['policy'] = $policy;
> > $settings['securityToken'] = $token;
> >
> > $client = new WSClient ($settings);
> > ----- /client -----
> >
> > The PHP code for index.php (server):
> >
> > ----- server -----
> > $settings['wsdl']           = 'dns.wsdl';
> > $settings['bindingStyle']   = "doclit";
> > $settings['cacheWSDL']      = false;
> > $settings['useWSA']         = true;
> > $settings['operations']     = $operations;
> > $settings['actions']        = $actions;
> > $settings['policy']         = $policy;
> > $settings['securityToken']  = $token;
> > $settings['serviceName']    = "LinuxDNSCluster";
> >
> > $service = new WSService ($settings);
> > $service->reply();
> > ----- /server -----
> >
> > Best regards,
> > Jeroen Koekkoek
> >
> >
> > From: [hidden email] [mailto:wsf-php-user-
> > [hidden email]] On Behalf Of Nandika Jayawardana
> > Sent: Tuesday, September 15, 2009 10:35 AM
> > To: [hidden email]
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > I guess there should be something wrong with your WSPolicy object or
> > WSSecurityToken object. RampartClientConfiguration is the object
> which
> > carries data to rampart( Security Module ) and it is populated using
> > WSPolicy object and WSSecurityToken object at PHP Level.
> > Regards
> > Nandika
> > On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek
> <[hidden email]>
> > wrote:
> > Hi,
> >
> > I have a question regarding the use of WSFault objects and
> > WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal
> operations
> > while using WSPolicy+WSSecurityToken succeed, but when using them and
> > throwing a WSFault I receive the following errors.
> >
> > ----- wsf_php_client.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_client.log -----
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_server.log -----
> >
> > These messages I receive when using the default xml's that come with
> > WSF/PHP. When using modified xml files, the following lines appear
> > every time.
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > ----- /wsf_php_server.log -----
> >
> > I can't get the configuration to work. Does anyone have some pointers
> > or know what's causing these errors to occur? I use Apache2/C 1.6.0,
> > Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I
> > created my own Debian packages.
> >
> > Thanks in advance.
> >
> > Best regards,
> >
> > Jeroen Koekkoek
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> >
> >
> >
> > --
> > Nandika Jayawardana
> > Technical Lead and Project Manager, WSO2 Inc
> > www.wso2.com "Open Source SOA Company"
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user


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


> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>




_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"
________________________________________
_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

Nandika Jayawardana
Sure, Please create a jira with the description and fix. I will test and apply the patch.

Regards
Nandika

On Wed, Sep 16, 2009 at 2:51 PM, Jeroen Koekkoek <[hidden email]> wrote:
Hi François,

This fixed the problem for me. Thanks! I'll report problems if I encounter them.

Nandika, do you still want me to create a jira?

Best regards,
Jeroen

From: [hidden email] [mailto:[hidden email]] On Behalf Of François Mireaux
Sent: Wednesday, September 16, 2009 8:34 AM
To: [hidden email]
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Hello,

Adding this code (extracted from axis2_core_utils_create_out_msg_ctx in Axis2 core/utils/core_utils.c) at the end of axis2_engine_create_fault_msg_ctx in Axis2 core/engine/engine.c corrects the problem :

   if ( 1 == 1 ) { // for ctx declaration
     axis2_ctx_t *ctx = axis2_msg_ctx_get_base(processing_context, env);
     if (ctx)
     {
       axis2_ctx_t *new_ctx = axis2_msg_ctx_get_base(fault_ctx, env);
       if (new_ctx)
       {
           axis2_ctx_set_property_map(new_ctx, env,
                                      axis2_ctx_get_property_map(ctx, env));
       }
   }
But I don't enough master Axis2/C to be sure that this solution is allways OK.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: Nandika Jayawardana
To: [hidden email]
Sent: Tuesday, September 15, 2009 5:54 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Hi Jeroen,
Can you create a jira with the source files and log files attached. I will look into this issue.

Regards
Nandika
2009/9/15 François Mireaux <[hidden email]>
Hello,

Some time ago I pursue the same problem and it seems to be an Axis2/Rampart
problem. In the Axis2 receiver handler (core/receivers/msg_recv.c), a SOAP
Fault response is not send as is like normal response but delegated to http
transport (http_transport_utils.c) which create a new fresh output message
context without the needed rampart context (copied from the input message
context in normal process) : two different functions are used to create the
output message contexts.

I don't try to write an Rampart/C test, so I don't use Rampart/C JIRA.

Note : if you don't look at log file,  process seems to be OK : client
receives properly the WSFault (translated to an exception). But there are no
security headers.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: "Jeroen Koekkoek" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, September 15, 2009 12:26 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C


Hi,

Ok, I created a very simple server/client to test with.

----- wsf_php_server.log -----
[Tue Sep 15 12:14:32 2009] [error] rampart_engine.c(159)
[rampart][rampart_engine] Cannot get saved rampart_context
[Tue Sep 15 12:14:32 2009] [error] rampart_out_handler.c(136)
[rampart][rampart_out_handler] ramaprt_context creation failed.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartOutHandler
invoke failed within phase MessageOut
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase MessageOut
failed
----- /wsf_php_server.log -----

----- wsf_php_client.log -----
[Tue Sep 15 12:14:32 2009] [error] http_sender.c(1411) Error occurred in
transport
[Tue Sep 15 12:14:32 2009] [error] rampart_in_handler.c(126)
[rampart][rampart_in_handler] Security header cannot be found.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartInHandler
invoke failed within phase Security
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase Security
failed
[Tue Sep 15 12:14:32 2009] [error] engine.c(279) Invoking operation specific
phases failed for operation __OPERATION_OUT_IN__
----- /wsf_php_client.log -----

I attached the php files, hopefully someone can tell me where I go wrong.

Thanks in advance.

Regards,
Jeroen

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]
> [hidden email]] On Behalf Of Jeroen Koekkoek
> Sent: Tuesday, September 15, 2009 11:20 AM
> To: '[hidden email]'
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Sorry I didn't paste the entire server side code.
>
> ----- server -----
> /* WSF/PHP */
>
> $operations = array (
>   "DomainExistsByName"      => "DomainExistsByName",
>   "GetDomainByName"         => "GetDomainByName",
>   "CreateDomain"            => "CreateDomain",
>   "DeleteDomain"            => "DeleteDomain",
>   "RecordExistsByName"      => "RecordExistsByName",
>   "RecordExists"            => "RecordExists",
>   "GetRecordsByDomainName"  => "GetRecordsByDomainName",
>   "GetRecordsByName"        => "GetRecordsByName",
>   "GetRecord"               => "GetRecord",
>   "CreateRecord"            => "CreateRecord",
>   "ModifyRecord"            => "ModifyRecord",
>   "DeleteRecord"            => "DeleteRecord"
> );
>
> $parameters = array (
>   "DomainExistsByName"      => "MIXED",
>   "GetDomainByName"         => "MIXED",
>   "CreateDomain"            => "MIXED",
>   "DeleteDomain"            => "MIXED",
>   "RecordExistsByName"      => "MIXED",
>   "RecordExists"            => "MIXED",
>   "GetRecordsByDomainName"  => "MIXED",
>   "GetRecordsByName"        => "MIXED",
>   "GetRecord"               => "MIXED",
>   "CreateRecord"            => "MIXED",
>   "ModifyRecord"            => "MIXED",
>   "DeleteRecord"            => "MIXED"
> );
>
> $policy = new WSPolicy (array (
>   "security" => array (
>     "useUsernameToken" => true,
>     "includeTimeStamp" => true
>   )
> ));
>
> $token = new WSSecurityToken (array (
>   "user"               => "bob",
>   "password"           => "bob12",
>   "passwordType"       => "Digest",
>   "ttl"                => 100,
>   "enableReplayDetect" => false
> ));
>
> $actions = array();
> foreach ($operations as $key => $value)
>   $actions[$key] = $key;
>
>
> $is_soap_request = (strlen (trim ($GLOBALS ["HTTP_RAW_POST_DATA"])) > 0
> ? true : false);
>
>
> $settings = array ();
>
> // SOAP
> if ($is_soap_request)
>   $settings['wsdl'] = "dns.wsdl";
> // HTTP
> else
>   $settings['opParams'] = $parameters;
>
> $settings['bindingStyle']   = "doclit";
> $settings['cacheWSDL']      = false;
> $settings['useWSA']         = true;
> $settings['operations']     = $operations;
> $settings['actions']        = $actions;
> // XXX: disabled for testing purposes only
> $settings['policy']         = $policy;
> $settings['securityToken']  = $token;
> $settings['serviceName']    = "LinuxDNSCluster";
>
> $service = new WSService ($settings);
> $service->reply();
> ----- /server -----
>
> Regards,
>
> Jeroen Koekkoek
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]
> > [hidden email]] On Behalf Of Jeroen Koekkoek
> > Sent: Tuesday, September 15, 2009 10:56 AM
> > To: '[hidden email]'
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > Hi Nandika,
> >
> > Thanks for your reply.
> >
> > After fiddling with axis2.xml and rampart's module.xml a bit, I got
> the
> > RampartClientConfiguration to disappear. Throwing WSFaults is still
> > troublesome. I also recompiled Axis2/C etc to use libxml2 and
> disabled
> > Guththila.
> >
> > ----- wsf_php_server.log -----
> > [Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartOutHandler invoke failed within phase MessageOut
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > MessageOut failed
> > ----- /wsf_php_server.log -----
> >
> > ----- wsf_php_client.log -----
> > [Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase Security
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > Security failed
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation
> > specific phases failed for operation __OPERATION_OUT_IN__
> > ----- /wsf_php_client.log -----
> >
> > I included the PHP code for creating the policy etc below.
> >
> > The PHP code for test.php (client):
> >
> > ----- client -----
> > $policy = new WSPolicy (array (
> >   "security" => array (
> >     "useUsernameToken" => true,
> >     "includeTimeStamp" => true
> >   )
> > ));
> >
> > $token = new WSSecurityToken (array (
> >   "user" => "bob",
> >   "password" => "bob12",
> >   "passwordType" => "Digest",
> >   "ttl" => 300
> > ));
> >
> > $settings = array ();
> > $settings['useWSA'] = true;
> > $settings['cacheWSDL'] = false;
> > $settings['wsdl'] = 'dns.wsdl';
> > $settings['policy'] = $policy;
> > $settings['securityToken'] = $token;
> >
> > $client = new WSClient ($settings);
> > ----- /client -----
> >
> > The PHP code for index.php (server):
> >
> > ----- server -----
> > $settings['wsdl']           = 'dns.wsdl';
> > $settings['bindingStyle']   = "doclit";
> > $settings['cacheWSDL']      = false;
> > $settings['useWSA']         = true;
> > $settings['operations']     = $operations;
> > $settings['actions']        = $actions;
> > $settings['policy']         = $policy;
> > $settings['securityToken']  = $token;
> > $settings['serviceName']    = "LinuxDNSCluster";
> >
> > $service = new WSService ($settings);
> > $service->reply();
> > ----- /server -----
> >
> > Best regards,
> > Jeroen Koekkoek
> >
> >
> > From: [hidden email] [mailto:[hidden email]
> > [hidden email]] On Behalf Of Nandika Jayawardana
> > Sent: Tuesday, September 15, 2009 10:35 AM
> > To: [hidden email]
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > I guess there should be something wrong with your WSPolicy object or
> > WSSecurityToken object. RampartClientConfiguration is the object
> which
> > carries data to rampart( Security Module ) and it is populated using
> > WSPolicy object and WSSecurityToken object at PHP Level.
> > Regards
> > Nandika
> > On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek
> <[hidden email]>
> > wrote:
> > Hi,
> >
> > I have a question regarding the use of WSFault objects and
> > WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal
> operations
> > while using WSPolicy+WSSecurityToken succeed, but when using them and
> > throwing a WSFault I receive the following errors.
> >
> > ----- wsf_php_client.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_client.log -----
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_server.log -----
> >
> > These messages I receive when using the default xml's that come with
> > WSF/PHP. When using modified xml files, the following lines appear
> > every time.
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > ----- /wsf_php_server.log -----
> >
> > I can't get the configuration to work. Does anyone have some pointers
> > or know what's causing these errors to occur? I use Apache2/C 1.6.0,
> > Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I
> > created my own Debian packages.
> >
> > Thanks in advance.
> >
> > Best regards,
> >
> > Jeroen Koekkoek
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> >
> >
> >
> > --
> > Nandika Jayawardana
> > Technical Lead and Project Manager, WSO2 Inc
> > www.wso2.com "Open Source SOA Company"
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user


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


> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>




_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"
________________________________________
_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"


_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

fmireaux
I have created a JIRA for Axis2-C (https://issues.apache.org/jira/browse/AXIS2C-1394)
 
François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
Sent: Wednesday, September 16, 2009 11:25 AM
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Sure, Please create a jira with the description and fix. I will test and apply the patch.

Regards
Nandika

On Wed, Sep 16, 2009 at 2:51 PM, Jeroen Koekkoek <[hidden email]> wrote:
Hi François,

This fixed the problem for me. Thanks! I'll report problems if I encounter them.

Nandika, do you still want me to create a jira?

Best regards,
Jeroen

From: [hidden email] [mailto:[hidden email]] On Behalf Of François Mireaux
Sent: Wednesday, September 16, 2009 8:34 AM
To: [hidden email]
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Hello,

Adding this code (extracted from axis2_core_utils_create_out_msg_ctx in Axis2 core/utils/core_utils.c) at the end of axis2_engine_create_fault_msg_ctx in Axis2 core/engine/engine.c corrects the problem :

   if ( 1 == 1 ) { // for ctx declaration
     axis2_ctx_t *ctx = axis2_msg_ctx_get_base(processing_context, env);
     if (ctx)
     {
       axis2_ctx_t *new_ctx = axis2_msg_ctx_get_base(fault_ctx, env);
       if (new_ctx)
       {
           axis2_ctx_set_property_map(new_ctx, env,
                                      axis2_ctx_get_property_map(ctx, env));
       }
   }
But I don't enough master Axis2/C to be sure that this solution is allways OK.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: Nandika Jayawardana
To: [hidden email]
Sent: Tuesday, September 15, 2009 5:54 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Hi Jeroen,
Can you create a jira with the source files and log files attached. I will look into this issue.

Regards
Nandika
2009/9/15 François Mireaux <[hidden email]>
Hello,

Some time ago I pursue the same problem and it seems to be an Axis2/Rampart
problem. In the Axis2 receiver handler (core/receivers/msg_recv.c), a SOAP
Fault response is not send as is like normal response but delegated to http
transport (http_transport_utils.c) which create a new fresh output message
context without the needed rampart context (copied from the input message
context in normal process) : two different functions are used to create the
output message contexts.

I don't try to write an Rampart/C test, so I don't use Rampart/C JIRA.

Note : if you don't look at log file,  process seems to be OK : client
receives properly the WSFault (translated to an exception). But there are no
security headers.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: "Jeroen Koekkoek" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, September 15, 2009 12:26 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C


Hi,

Ok, I created a very simple server/client to test with.

----- wsf_php_server.log -----
[Tue Sep 15 12:14:32 2009] [error] rampart_engine.c(159)
[rampart][rampart_engine] Cannot get saved rampart_context
[Tue Sep 15 12:14:32 2009] [error] rampart_out_handler.c(136)
[rampart][rampart_out_handler] ramaprt_context creation failed.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartOutHandler
invoke failed within phase MessageOut
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase MessageOut
failed
----- /wsf_php_server.log -----

----- wsf_php_client.log -----
[Tue Sep 15 12:14:32 2009] [error] http_sender.c(1411) Error occurred in
transport
[Tue Sep 15 12:14:32 2009] [error] rampart_in_handler.c(126)
[rampart][rampart_in_handler] Security header cannot be found.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartInHandler
invoke failed within phase Security
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase Security
failed
[Tue Sep 15 12:14:32 2009] [error] engine.c(279) Invoking operation specific
phases failed for operation __OPERATION_OUT_IN__
----- /wsf_php_client.log -----

I attached the php files, hopefully someone can tell me where I go wrong.

Thanks in advance.

Regards,
Jeroen

> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]
> [hidden email]] On Behalf Of Jeroen Koekkoek
> Sent: Tuesday, September 15, 2009 11:20 AM
> To: '[hidden email]'
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Sorry I didn't paste the entire server side code.
>
> ----- server -----
> /* WSF/PHP */
>
> $operations = array (
>   "DomainExistsByName"      => "DomainExistsByName",
>   "GetDomainByName"         => "GetDomainByName",
>   "CreateDomain"            => "CreateDomain",
>   "DeleteDomain"            => "DeleteDomain",
>   "RecordExistsByName"      => "RecordExistsByName",
>   "RecordExists"            => "RecordExists",
>   "GetRecordsByDomainName"  => "GetRecordsByDomainName",
>   "GetRecordsByName"        => "GetRecordsByName",
>   "GetRecord"               => "GetRecord",
>   "CreateRecord"            => "CreateRecord",
>   "ModifyRecord"            => "ModifyRecord",
>   "DeleteRecord"            => "DeleteRecord"
> );
>
> $parameters = array (
>   "DomainExistsByName"      => "MIXED",
>   "GetDomainByName"         => "MIXED",
>   "CreateDomain"            => "MIXED",
>   "DeleteDomain"            => "MIXED",
>   "RecordExistsByName"      => "MIXED",
>   "RecordExists"            => "MIXED",
>   "GetRecordsByDomainName"  => "MIXED",
>   "GetRecordsByName"        => "MIXED",
>   "GetRecord"               => "MIXED",
>   "CreateRecord"            => "MIXED",
>   "ModifyRecord"            => "MIXED",
>   "DeleteRecord"            => "MIXED"
> );
>
> $policy = new WSPolicy (array (
>   "security" => array (
>     "useUsernameToken" => true,
>     "includeTimeStamp" => true
>   )
> ));
>
> $token = new WSSecurityToken (array (
>   "user"               => "bob",
>   "password"           => "bob12",
>   "passwordType"       => "Digest",
>   "ttl"                => 100,
>   "enableReplayDetect" => false
> ));
>
> $actions = array();
> foreach ($operations as $key => $value)
>   $actions[$key] = $key;
>
>
> $is_soap_request = (strlen (trim ($GLOBALS ["HTTP_RAW_POST_DATA"])) > 0
> ? true : false);
>
>
> $settings = array ();
>
> // SOAP
> if ($is_soap_request)
>   $settings['wsdl'] = "dns.wsdl";
> // HTTP
> else
>   $settings['opParams'] = $parameters;
>
> $settings['bindingStyle']   = "doclit";
> $settings['cacheWSDL']      = false;
> $settings['useWSA']         = true;
> $settings['operations']     = $operations;
> $settings['actions']        = $actions;
> // XXX: disabled for testing purposes only
> $settings['policy']         = $policy;
> $settings['securityToken']  = $token;
> $settings['serviceName']    = "LinuxDNSCluster";
>
> $service = new WSService ($settings);
> $service->reply();
> ----- /server -----
>
> Regards,
>
> Jeroen Koekkoek
>
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]
> > [hidden email]] On Behalf Of Jeroen Koekkoek
> > Sent: Tuesday, September 15, 2009 10:56 AM
> > To: '[hidden email]'
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > Hi Nandika,
> >
> > Thanks for your reply.
> >
> > After fiddling with axis2.xml and rampart's module.xml a bit, I got
> the
> > RampartClientConfiguration to disappear. Throwing WSFaults is still
> > troublesome. I also recompiled Axis2/C etc to use libxml2 and
> disabled
> > Guththila.
> >
> > ----- wsf_php_server.log -----
> > [Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartOutHandler invoke failed within phase MessageOut
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > MessageOut failed
> > ----- /wsf_php_server.log -----
> >
> > ----- wsf_php_client.log -----
> > [Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase Security
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > Security failed
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation
> > specific phases failed for operation __OPERATION_OUT_IN__
> > ----- /wsf_php_client.log -----
> >
> > I included the PHP code for creating the policy etc below.
> >
> > The PHP code for test.php (client):
> >
> > ----- client -----
> > $policy = new WSPolicy (array (
> >   "security" => array (
> >     "useUsernameToken" => true,
> >     "includeTimeStamp" => true
> >   )
> > ));
> >
> > $token = new WSSecurityToken (array (
> >   "user" => "bob",
> >   "password" => "bob12",
> >   "passwordType" => "Digest",
> >   "ttl" => 300
> > ));
> >
> > $settings = array ();
> > $settings['useWSA'] = true;
> > $settings['cacheWSDL'] = false;
> > $settings['wsdl'] = 'dns.wsdl';
> > $settings['policy'] = $policy;
> > $settings['securityToken'] = $token;
> >
> > $client = new WSClient ($settings);
> > ----- /client -----
> >
> > The PHP code for index.php (server):
> >
> > ----- server -----
> > $settings['wsdl']           = 'dns.wsdl';
> > $settings['bindingStyle']   = "doclit";
> > $settings['cacheWSDL']      = false;
> > $settings['useWSA']         = true;
> > $settings['operations']     = $operations;
> > $settings['actions']        = $actions;
> > $settings['policy']         = $policy;
> > $settings['securityToken']  = $token;
> > $settings['serviceName']    = "LinuxDNSCluster";
> >
> > $service = new WSService ($settings);
> > $service->reply();
> > ----- /server -----
> >
> > Best regards,
> > Jeroen Koekkoek
> >
> >
> > From: [hidden email] [mailto:[hidden email]
> > [hidden email]] On Behalf Of Nandika Jayawardana
> > Sent: Tuesday, September 15, 2009 10:35 AM
> > To: [hidden email]
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > I guess there should be something wrong with your WSPolicy object or
> > WSSecurityToken object. RampartClientConfiguration is the object
> which
> > carries data to rampart( Security Module ) and it is populated using
> > WSPolicy object and WSSecurityToken object at PHP Level.
> > Regards
> > Nandika
> > On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek
> <[hidden email]>
> > wrote:
> > Hi,
> >
> > I have a question regarding the use of WSFault objects and
> > WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal
> operations
> > while using WSPolicy+WSSecurityToken succeed, but when using them and
> > throwing a WSFault I receive the following errors.
> >
> > ----- wsf_php_client.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_client.log -----
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_server.log -----
> >
> > These messages I receive when using the default xml's that come with
> > WSF/PHP. When using modified xml files, the following lines appear
> > every time.
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > ----- /wsf_php_server.log -----
> >
> > I can't get the configuration to work. Does anyone have some pointers
> > or know what's causing these errors to occur? I use Apache2/C 1.6.0,
> > Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I
> > created my own Debian packages.
> >
> > Thanks in advance.
> >
> > Best regards,
> >
> > Jeroen Koekkoek
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> >
> >
> >
> > --
> > Nandika Jayawardana
> > Technical Lead and Project Manager, WSO2 Inc
> > www.wso2.com "Open Source SOA Company"
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user


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


> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>




_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"
________________________________________
_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"


_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

Jeroen Koekkoek-3
Hi François,

Great! Saves me some work :-). Thanks again for your efforts.

Best regards,
Jeroen

From: [hidden email] [mailto:[hidden email]] On Behalf Of François Mireaux
Sent: Wednesday, September 16, 2009 11:35 AM
To: [hidden email]
Subject: Re: [wsf-php-user] WSFault and Rampart/C

I have created a JIRA for Axis2-C (https://issues.apache.org/jira/browse/AXIS2C-1394)

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: Nandika Jayawardana
To: [hidden email]
Sent: Wednesday, September 16, 2009 11:25 AM
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Sure, Please create a jira with the description and fix. I will test and apply the patch.

Regards
Nandika
On Wed, Sep 16, 2009 at 2:51 PM, Jeroen Koekkoek <[hidden email]> wrote:
Hi François,

This fixed the problem for me. Thanks! I'll report problems if I encounter them.

Nandika, do you still want me to create a jira?

Best regards,
Jeroen

From: [hidden email] [mailto:[hidden email]] On Behalf Of François Mireaux
Sent: Wednesday, September 16, 2009 8:34 AM
To: [hidden email]
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Hello,

Adding this code (extracted from axis2_core_utils_create_out_msg_ctx in Axis2 core/utils/core_utils.c) at the end of axis2_engine_create_fault_msg_ctx in Axis2 core/engine/engine.c corrects the problem :

   if ( 1 == 1 ) { // for ctx declaration
     axis2_ctx_t *ctx = axis2_msg_ctx_get_base(processing_context, env);
     if (ctx)
     {
       axis2_ctx_t *new_ctx = axis2_msg_ctx_get_base(fault_ctx, env);
       if (new_ctx)
       {
           axis2_ctx_set_property_map(new_ctx, env,
                                      axis2_ctx_get_property_map(ctx, env));
       }
   }
But I don't enough master Axis2/C to be sure that this solution is allways OK.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: Nandika Jayawardana
To: [hidden email]
Sent: Tuesday, September 15, 2009 5:54 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C

Hi Jeroen,
Can you create a jira with the source files and log files attached. I will look into this issue.

Regards
Nandika
2009/9/15 François Mireaux <[hidden email]>
Hello,

Some time ago I pursue the same problem and it seems to be an Axis2/Rampart
problem. In the Axis2 receiver handler (core/receivers/msg_recv.c), a SOAP
Fault response is not send as is like normal response but delegated to http
transport (http_transport_utils.c) which create a new fresh output message
context without the needed rampart context (copied from the input message
context in normal process) : two different functions are used to create the
output message contexts.

I don't try to write an Rampart/C test, so I don't use Rampart/C JIRA.

Note : if you don't look at log file,  process seems to be OK : client
receives properly the WSFault (translated to an exception). But there are no
security headers.

François Mireaux
tél : 04 78 34 29 01
----- Original Message -----
From: "Jeroen Koekkoek" <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, September 15, 2009 12:26 PM
Subject: Re: [wsf-php-user] WSFault and Rampart/C


Hi,

Ok, I created a very simple server/client to test with.

----- wsf_php_server.log -----
[Tue Sep 15 12:14:32 2009] [error] rampart_engine.c(159)
[rampart][rampart_engine] Cannot get saved rampart_context
[Tue Sep 15 12:14:32 2009] [error] rampart_out_handler.c(136)
[rampart][rampart_out_handler] ramaprt_context creation failed.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartOutHandler
invoke failed within phase MessageOut
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase MessageOut
failed
----- /wsf_php_server.log -----

----- wsf_php_client.log -----
[Tue Sep 15 12:14:32 2009] [error] http_sender.c(1411) Error occurred in
transport
[Tue Sep 15 12:14:32 2009] [error] rampart_in_handler.c(126)
[rampart][rampart_in_handler] Security header cannot be found.
[Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler RampartInHandler
invoke failed within phase Security
[Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase Security
failed
[Tue Sep 15 12:14:32 2009] [error] engine.c(279) Invoking operation specific
phases failed for operation __OPERATION_OUT_IN__
----- /wsf_php_client.log -----

I attached the php files, hopefully someone can tell me where I go wrong.

Thanks in advance.

Regards,
Jeroen

> -----Original Message-----
> From: [hidden email] [mailto:wsf-php-user-
> [hidden email]] On Behalf Of Jeroen Koekkoek
> Sent: Tuesday, September 15, 2009 11:20 AM
> To: '[hidden email]'
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Sorry I didn't paste the entire server side code.
>
> ----- server -----
> /* WSF/PHP */
>
> $operations = array (
>   "DomainExistsByName"      => "DomainExistsByName",
>   "GetDomainByName"         => "GetDomainByName",
>   "CreateDomain"            => "CreateDomain",
>   "DeleteDomain"            => "DeleteDomain",
>   "RecordExistsByName"      => "RecordExistsByName",
>   "RecordExists"            => "RecordExists",
>   "GetRecordsByDomainName"  => "GetRecordsByDomainName",
>   "GetRecordsByName"        => "GetRecordsByName",
>   "GetRecord"               => "GetRecord",
>   "CreateRecord"            => "CreateRecord",
>   "ModifyRecord"            => "ModifyRecord",
>   "DeleteRecord"            => "DeleteRecord"
> );
>
> $parameters = array (
>   "DomainExistsByName"      => "MIXED",
>   "GetDomainByName"         => "MIXED",
>   "CreateDomain"            => "MIXED",
>   "DeleteDomain"            => "MIXED",
>   "RecordExistsByName"      => "MIXED",
>   "RecordExists"            => "MIXED",
>   "GetRecordsByDomainName"  => "MIXED",
>   "GetRecordsByName"        => "MIXED",
>   "GetRecord"               => "MIXED",
>   "CreateRecord"            => "MIXED",
>   "ModifyRecord"            => "MIXED",
>   "DeleteRecord"            => "MIXED"
> );
>
> $policy = new WSPolicy (array (
>   "security" => array (
>     "useUsernameToken" => true,
>     "includeTimeStamp" => true
>   )
> ));
>
> $token = new WSSecurityToken (array (
>   "user"               => "bob",
>   "password"           => "bob12",
>   "passwordType"       => "Digest",
>   "ttl"                => 100,
>   "enableReplayDetect" => false
> ));
>
> $actions = array();
> foreach ($operations as $key => $value)
>   $actions[$key] = $key;
>
>
> $is_soap_request = (strlen (trim ($GLOBALS ["HTTP_RAW_POST_DATA"])) > 0
> ? true : false);
>
>
> $settings = array ();
>
> // SOAP
> if ($is_soap_request)
>   $settings['wsdl'] = "dns.wsdl";
> // HTTP
> else
>   $settings['opParams'] = $parameters;
>
> $settings['bindingStyle']   = "doclit";
> $settings['cacheWSDL']      = false;
> $settings['useWSA']         = true;
> $settings['operations']     = $operations;
> $settings['actions']        = $actions;
> // XXX: disabled for testing purposes only
> $settings['policy']         = $policy;
> $settings['securityToken']  = $token;
> $settings['serviceName']    = "LinuxDNSCluster";
>
> $service = new WSService ($settings);
> $service->reply();
> ----- /server -----
>
> Regards,
>
> Jeroen Koekkoek
>
> > -----Original Message-----
> > From: [hidden email] [mailto:wsf-php-user-
> > [hidden email]] On Behalf Of Jeroen Koekkoek
> > Sent: Tuesday, September 15, 2009 10:56 AM
> > To: '[hidden email]'
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > Hi Nandika,
> >
> > Thanks for your reply.
> >
> > After fiddling with axis2.xml and rampart's module.xml a bit, I got
> the
> > RampartClientConfiguration to disappear. Throwing WSFaults is still
> > troublesome. I also recompiled Axis2/C etc to use libxml2 and
> disabled
> > Guththila.
> >
> > ----- wsf_php_server.log -----
> > [Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartOutHandler invoke failed within phase MessageOut
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > MessageOut failed
> > ----- /wsf_php_server.log -----
> >
> > ----- wsf_php_client.log -----
> > [Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase Security
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > Security failed
> > [Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation
> > specific phases failed for operation __OPERATION_OUT_IN__
> > ----- /wsf_php_client.log -----
> >
> > I included the PHP code for creating the policy etc below.
> >
> > The PHP code for test.php (client):
> >
> > ----- client -----
> > $policy = new WSPolicy (array (
> >   "security" => array (
> >     "useUsernameToken" => true,
> >     "includeTimeStamp" => true
> >   )
> > ));
> >
> > $token = new WSSecurityToken (array (
> >   "user" => "bob",
> >   "password" => "bob12",
> >   "passwordType" => "Digest",
> >   "ttl" => 300
> > ));
> >
> > $settings = array ();
> > $settings['useWSA'] = true;
> > $settings['cacheWSDL'] = false;
> > $settings['wsdl'] = 'dns.wsdl';
> > $settings['policy'] = $policy;
> > $settings['securityToken'] = $token;
> >
> > $client = new WSClient ($settings);
> > ----- /client -----
> >
> > The PHP code for index.php (server):
> >
> > ----- server -----
> > $settings['wsdl']           = 'dns.wsdl';
> > $settings['bindingStyle']   = "doclit";
> > $settings['cacheWSDL']      = false;
> > $settings['useWSA']         = true;
> > $settings['operations']     = $operations;
> > $settings['actions']        = $actions;
> > $settings['policy']         = $policy;
> > $settings['securityToken']  = $token;
> > $settings['serviceName']    = "LinuxDNSCluster";
> >
> > $service = new WSService ($settings);
> > $service->reply();
> > ----- /server -----
> >
> > Best regards,
> > Jeroen Koekkoek
> >
> >
> > From: [hidden email] [mailto:wsf-php-user-
> > [hidden email]] On Behalf Of Nandika Jayawardana
> > Sent: Tuesday, September 15, 2009 10:35 AM
> > To: [hidden email]
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > I guess there should be something wrong with your WSPolicy object or
> > WSSecurityToken object. RampartClientConfiguration is the object
> which
> > carries data to rampart( Security Module ) and it is populated using
> > WSPolicy object and WSSecurityToken object at PHP Level.
> > Regards
> > Nandika
> > On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek
> <[hidden email]>
> > wrote:
> > Hi,
> >
> > I have a question regarding the use of WSFault objects and
> > WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal
> operations
> > while using WSPolicy+WSSecurityToken succeed, but when using them and
> > throwing a WSFault I receive the following errors.
> >
> > ----- wsf_php_client.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_client.log -----
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > RampartClientConfiguration not set in message context
> > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error occurred
> > in transport
> > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > [rampart][rampart_in_handler] Security header cannot be found.
> > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > RampartInHandler invoke failed within phase PreDispatch
> > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > PreDispatch failed
> > ----- /wsf_php_server.log -----
> >
> > These messages I receive when using the default xml's that come with
> > WSF/PHP. When using modified xml files, the following lines appear
> > every time.
> >
> > ----- wsf_php_server.log -----
> > [Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159)
> > [rampart][rampart_engine] Cannot get saved rampart_context
> > [Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136)
> > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > ----- /wsf_php_server.log -----
> >
> > I can't get the configuration to work. Does anyone have some pointers
> > or know what's causing these errors to occur? I use Apache2/C 1.6.0,
> > Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I
> > created my own Debian packages.
> >
> > Thanks in advance.
> >
> > Best regards,
> >
> > Jeroen Koekkoek
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> >
> >
> >
> > --
> > Nandika Jayawardana
> > Technical Lead and Project Manager, WSO2 Inc
> > www.wso2.com "Open Source SOA Company"
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user


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


> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>




_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"
________________________________________
_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user



--
Nandika Jayawardana
Technical Lead and Project Manager, WSO2 Inc
www.wso2.com "Open Source SOA Company"
________________________________________
_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
Reply | Threaded
Open this post in threaded view
|

Re: WSFault and Rampart/C

Jeroen Koekkoek-3
Hi,

I'm facing another problem regarding WS-Security in WSF/PHP. Today I implemented using certificates on my webservice, when not using WSDL it all goes well when throwing a WSFault. When using WSDL it doesn't. It seems like WSF/PHP doesn't include the standard HTTP headers. This problem only occurs when using certificates and when using WSDL.

I've included the tshark output.

Does anyone have a clue where to look?

Best regards,

Jeroen Koekkoek

> -----Original Message-----
> From: [hidden email] [mailto:wsf-php-user-
> [hidden email]] On Behalf Of Jeroen Koekkoek
> Sent: Wednesday, September 16, 2009 11:38 AM
> To: '[hidden email]'
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Hi François,
>
> Great! Saves me some work :-). Thanks again for your efforts.
>
> Best regards,
> Jeroen
>
> From: [hidden email] [mailto:wsf-php-user-
> [hidden email]] On Behalf Of François Mireaux
> Sent: Wednesday, September 16, 2009 11:35 AM
> To: [hidden email]
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> I have created a JIRA for Axis2-C
> (https://issues.apache.org/jira/browse/AXIS2C-1394)
>
> François Mireaux
> tél : 04 78 34 29 01
> ----- Original Message -----
> From: Nandika Jayawardana
> To: [hidden email]
> Sent: Wednesday, September 16, 2009 11:25 AM
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Sure, Please create a jira with the description and fix. I will test
> and apply the patch.
>
> Regards
> Nandika
> On Wed, Sep 16, 2009 at 2:51 PM, Jeroen Koekkoek <[hidden email]>
> wrote:
> Hi François,
>
> This fixed the problem for me. Thanks! I'll report problems if I
> encounter them.
>
> Nandika, do you still want me to create a jira?
>
> Best regards,
> Jeroen
>
> From: [hidden email] [mailto:wsf-php-user-
> [hidden email]] On Behalf Of François Mireaux
> Sent: Wednesday, September 16, 2009 8:34 AM
> To: [hidden email]
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Hello,
>
> Adding this code (extracted from axis2_core_utils_create_out_msg_ctx in
> Axis2 core/utils/core_utils.c) at the end of
> axis2_engine_create_fault_msg_ctx in Axis2 core/engine/engine.c
> corrects the problem :
>
>    if ( 1 == 1 ) { // for ctx declaration
>      axis2_ctx_t *ctx = axis2_msg_ctx_get_base(processing_context,
> env);
>      if (ctx)
>      {
>        axis2_ctx_t *new_ctx = axis2_msg_ctx_get_base(fault_ctx, env);
>        if (new_ctx)
>        {
>            axis2_ctx_set_property_map(new_ctx, env,
>                                       axis2_ctx_get_property_map(ctx,
> env));
>        }
>    }
> But I don't enough master Axis2/C to be sure that this solution is
> allways OK.
>
> François Mireaux
> tél : 04 78 34 29 01
> ----- Original Message -----
> From: Nandika Jayawardana
> To: [hidden email]
> Sent: Tuesday, September 15, 2009 5:54 PM
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
> Hi Jeroen,
> Can you create a jira with the source files and log files attached. I
> will look into this issue.
>
> Regards
> Nandika
> 2009/9/15 François Mireaux <[hidden email]>
> Hello,
>
> Some time ago I pursue the same problem and it seems to be an
> Axis2/Rampart
> problem. In the Axis2 receiver handler (core/receivers/msg_recv.c), a
> SOAP
> Fault response is not send as is like normal response but delegated to
> http
> transport (http_transport_utils.c) which create a new fresh output
> message
> context without the needed rampart context (copied from the input
> message
> context in normal process) : two different functions are used to create
> the
> output message contexts.
>
> I don't try to write an Rampart/C test, so I don't use Rampart/C JIRA.
>
> Note : if you don't look at log file,  process seems to be OK : client
> receives properly the WSFault (translated to an exception). But there
> are no
> security headers.
>
> François Mireaux
> tél : 04 78 34 29 01
> ----- Original Message -----
> From: "Jeroen Koekkoek" <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, September 15, 2009 12:26 PM
> Subject: Re: [wsf-php-user] WSFault and Rampart/C
>
>
> Hi,
>
> Ok, I created a very simple server/client to test with.
>
> ----- wsf_php_server.log -----
> [Tue Sep 15 12:14:32 2009] [error] rampart_engine.c(159)
> [rampart][rampart_engine] Cannot get saved rampart_context
> [Tue Sep 15 12:14:32 2009] [error] rampart_out_handler.c(136)
> [rampart][rampart_out_handler] ramaprt_context creation failed.
> [Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler
> RampartOutHandler
> invoke failed within phase MessageOut
> [Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase
> MessageOut
> failed
> ----- /wsf_php_server.log -----
>
> ----- wsf_php_client.log -----
> [Tue Sep 15 12:14:32 2009] [error] http_sender.c(1411) Error occurred
> in
> transport
> [Tue Sep 15 12:14:32 2009] [error] rampart_in_handler.c(126)
> [rampart][rampart_in_handler] Security header cannot be found.
> [Tue Sep 15 12:14:32 2009] [error] phase.c(233) Handler
> RampartInHandler
> invoke failed within phase Security
> [Tue Sep 15 12:14:32 2009] [error] engine.c(696) Invoking phase
> Security
> failed
> [Tue Sep 15 12:14:32 2009] [error] engine.c(279) Invoking operation
> specific
> phases failed for operation __OPERATION_OUT_IN__
> ----- /wsf_php_client.log -----
>
> I attached the php files, hopefully someone can tell me where I go
> wrong.
>
> Thanks in advance.
>
> Regards,
> Jeroen
>
> > -----Original Message-----
> > From: [hidden email] [mailto:wsf-php-user-
> > [hidden email]] On Behalf Of Jeroen Koekkoek
> > Sent: Tuesday, September 15, 2009 11:20 AM
> > To: '[hidden email]'
> > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> >
> > Sorry I didn't paste the entire server side code.
> >
> > ----- server -----
> > /* WSF/PHP */
> >
> > $operations = array (
> >   "DomainExistsByName"      => "DomainExistsByName",
> >   "GetDomainByName"         => "GetDomainByName",
> >   "CreateDomain"            => "CreateDomain",
> >   "DeleteDomain"            => "DeleteDomain",
> >   "RecordExistsByName"      => "RecordExistsByName",
> >   "RecordExists"            => "RecordExists",
> >   "GetRecordsByDomainName"  => "GetRecordsByDomainName",
> >   "GetRecordsByName"        => "GetRecordsByName",
> >   "GetRecord"               => "GetRecord",
> >   "CreateRecord"            => "CreateRecord",
> >   "ModifyRecord"            => "ModifyRecord",
> >   "DeleteRecord"            => "DeleteRecord"
> > );
> >
> > $parameters = array (
> >   "DomainExistsByName"      => "MIXED",
> >   "GetDomainByName"         => "MIXED",
> >   "CreateDomain"            => "MIXED",
> >   "DeleteDomain"            => "MIXED",
> >   "RecordExistsByName"      => "MIXED",
> >   "RecordExists"            => "MIXED",
> >   "GetRecordsByDomainName"  => "MIXED",
> >   "GetRecordsByName"        => "MIXED",
> >   "GetRecord"               => "MIXED",
> >   "CreateRecord"            => "MIXED",
> >   "ModifyRecord"            => "MIXED",
> >   "DeleteRecord"            => "MIXED"
> > );
> >
> > $policy = new WSPolicy (array (
> >   "security" => array (
> >     "useUsernameToken" => true,
> >     "includeTimeStamp" => true
> >   )
> > ));
> >
> > $token = new WSSecurityToken (array (
> >   "user"               => "bob",
> >   "password"           => "bob12",
> >   "passwordType"       => "Digest",
> >   "ttl"                => 100,
> >   "enableReplayDetect" => false
> > ));
> >
> > $actions = array();
> > foreach ($operations as $key => $value)
> >   $actions[$key] = $key;
> >
> >
> > $is_soap_request = (strlen (trim ($GLOBALS ["HTTP_RAW_POST_DATA"])) >
> 0
> > ? true : false);
> >
> >
> > $settings = array ();
> >
> > // SOAP
> > if ($is_soap_request)
> >   $settings['wsdl'] = "dns.wsdl";
> > // HTTP
> > else
> >   $settings['opParams'] = $parameters;
> >
> > $settings['bindingStyle']   = "doclit";
> > $settings['cacheWSDL']      = false;
> > $settings['useWSA']         = true;
> > $settings['operations']     = $operations;
> > $settings['actions']        = $actions;
> > // XXX: disabled for testing purposes only
> > $settings['policy']         = $policy;
> > $settings['securityToken']  = $token;
> > $settings['serviceName']    = "LinuxDNSCluster";
> >
> > $service = new WSService ($settings);
> > $service->reply();
> > ----- /server -----
> >
> > Regards,
> >
> > Jeroen Koekkoek
> >
> > > -----Original Message-----
> > > From: [hidden email] [mailto:wsf-php-user-
> > > [hidden email]] On Behalf Of Jeroen Koekkoek
> > > Sent: Tuesday, September 15, 2009 10:56 AM
> > > To: '[hidden email]'
> > > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> > >
> > > Hi Nandika,
> > >
> > > Thanks for your reply.
> > >
> > > After fiddling with axis2.xml and rampart's module.xml a bit, I got
> > the
> > > RampartClientConfiguration to disappear. Throwing WSFaults is still
> > > troublesome. I also recompiled Axis2/C etc to use libxml2 and
> > disabled
> > > Guththila.
> > >
> > > ----- wsf_php_server.log -----
> > > [Tue Sep 15 10:38:15 2009] [error] rampart_engine.c(159)
> > > [rampart][rampart_engine] Cannot get saved rampart_context
> > > [Tue Sep 15 10:38:15 2009] [error] rampart_out_handler.c(136)
> > > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > > RampartOutHandler invoke failed within phase MessageOut
> > > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > > MessageOut failed
> > > ----- /wsf_php_server.log -----
> > >
> > > ----- wsf_php_client.log -----
> > > [Tue Sep 15 10:38:15 2009] [error] http_sender.c(1411) Error
> occurred
> > > in transport
> > > [Tue Sep 15 10:38:15 2009] [error] rampart_in_handler.c(126)
> > > [rampart][rampart_in_handler] Security header cannot be found.
> > > [Tue Sep 15 10:38:15 2009] [error] phase.c(233) Handler
> > > RampartInHandler invoke failed within phase Security
> > > [Tue Sep 15 10:38:15 2009] [error] engine.c(696) Invoking phase
> > > Security failed
> > > [Tue Sep 15 10:38:15 2009] [error] engine.c(279) Invoking operation
> > > specific phases failed for operation __OPERATION_OUT_IN__
> > > ----- /wsf_php_client.log -----
> > >
> > > I included the PHP code for creating the policy etc below.
> > >
> > > The PHP code for test.php (client):
> > >
> > > ----- client -----
> > > $policy = new WSPolicy (array (
> > >   "security" => array (
> > >     "useUsernameToken" => true,
> > >     "includeTimeStamp" => true
> > >   )
> > > ));
> > >
> > > $token = new WSSecurityToken (array (
> > >   "user" => "bob",
> > >   "password" => "bob12",
> > >   "passwordType" => "Digest",
> > >   "ttl" => 300
> > > ));
> > >
> > > $settings = array ();
> > > $settings['useWSA'] = true;
> > > $settings['cacheWSDL'] = false;
> > > $settings['wsdl'] = 'dns.wsdl';
> > > $settings['policy'] = $policy;
> > > $settings['securityToken'] = $token;
> > >
> > > $client = new WSClient ($settings);
> > > ----- /client -----
> > >
> > > The PHP code for index.php (server):
> > >
> > > ----- server -----
> > > $settings['wsdl']           = 'dns.wsdl';
> > > $settings['bindingStyle']   = "doclit";
> > > $settings['cacheWSDL']      = false;
> > > $settings['useWSA']         = true;
> > > $settings['operations']     = $operations;
> > > $settings['actions']        = $actions;
> > > $settings['policy']         = $policy;
> > > $settings['securityToken']  = $token;
> > > $settings['serviceName']    = "LinuxDNSCluster";
> > >
> > > $service = new WSService ($settings);
> > > $service->reply();
> > > ----- /server -----
> > >
> > > Best regards,
> > > Jeroen Koekkoek
> > >
> > >
> > > From: [hidden email] [mailto:wsf-php-user-
> > > [hidden email]] On Behalf Of Nandika Jayawardana
> > > Sent: Tuesday, September 15, 2009 10:35 AM
> > > To: [hidden email]
> > > Subject: Re: [wsf-php-user] WSFault and Rampart/C
> > >
> > > I guess there should be something wrong with your WSPolicy object
> or
> > > WSSecurityToken object. RampartClientConfiguration is the object
> > which
> > > carries data to rampart( Security Module ) and it is populated
> using
> > > WSPolicy object and WSSecurityToken object at PHP Level.
> > > Regards
> > > Nandika
> > > On Tue, Sep 15, 2009 at 1:06 AM, Jeroen Koekkoek
> > <[hidden email]>
> > > wrote:
> > > Hi,
> > >
> > > I have a question regarding the use of WSFault objects and
> > > WSPolicy+WSSecurityToken objects together in WSF/PHP. Normal
> > operations
> > > while using WSPolicy+WSSecurityToken succeed, but when using them
> and
> > > throwing a WSFault I receive the following errors.
> > >
> > > ----- wsf_php_client.log -----
> > > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > > RampartClientConfiguration not set in message context
> > > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > > RampartClientConfiguration not set in message context
> > > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > > RampartClientConfiguration not set in message context
> > > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error
> occurred
> > > in transport
> > > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > > [rampart][rampart_in_handler] Security header cannot be found.
> > > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > > RampartInHandler invoke failed within phase PreDispatch
> > > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > > PreDispatch failed
> > > ----- /wsf_php_client.log -----
> > >
> > > ----- wsf_php_server.log -----
> > > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > > RampartClientConfiguration not set in message context
> > > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > > RampartClientConfiguration not set in message context
> > > [Mon Sep 14 21:02:45 2009] [warning] msg_ctx.c(1403)
> > > RampartClientConfiguration not set in message context
> > > [Mon Sep 14 21:02:45 2009] [error] http_sender.c(1411) Error
> occurred
> > > in transport
> > > [Mon Sep 14 21:02:45 2009] [error] rampart_in_handler.c(126)
> > > [rampart][rampart_in_handler] Security header cannot be found.
> > > [Mon Sep 14 21:02:45 2009] [error] phase.c(233) Handler
> > > RampartInHandler invoke failed within phase PreDispatch
> > > [Mon Sep 14 21:02:45 2009] [error] engine.c(696) Invoking phase
> > > PreDispatch failed
> > > ----- /wsf_php_server.log -----
> > >
> > > These messages I receive when using the default xml's that come
> with
> > > WSF/PHP. When using modified xml files, the following lines appear
> > > every time.
> > >
> > > ----- wsf_php_server.log -----
> > > [Mon Sep 14 18:45:13 2009] [error] rampart_engine.c(159)
> > > [rampart][rampart_engine] Cannot get saved rampart_context
> > > [Mon Sep 14 18:45:13 2009] [error] rampart_out_handler.c(136)
> > > [rampart][rampart_out_handler] ramaprt_context creation failed.
> > > ----- /wsf_php_server.log -----
> > >
> > > I can't get the configuration to work. Does anyone have some
> pointers
> > > or know what's causing these errors to occur? I use Apache2/C
> 1.6.0,
> > > Rampart/C 1.3.0, Sandesha2/C 0.92 svn 693024 and WSF/PHP 2.0.0, I
> > > created my own Debian packages.
> > >
> > > Thanks in advance.
> > >
> > > Best regards,
> > >
> > > Jeroen Koekkoek
> > >
> > > _______________________________________________
> > > Wsf-php-user mailing list
> > > [hidden email]
> > > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> > >
> > >
> > >
> > > --
> > > Nandika Jayawardana
> > > Technical Lead and Project Manager, WSO2 Inc
> > > www.wso2.com "Open Source SOA Company"
> > >
> > > _______________________________________________
> > > Wsf-php-user mailing list
> > > [hidden email]
> > > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> >
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
>
> -----------------------------------------------------------------------
> ---------
>
>
> > _______________________________________________
> > Wsf-php-user mailing list
> > [hidden email]
> > https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
> >
>
>
>
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
>
>
> --
> Nandika Jayawardana
> Technical Lead and Project Manager, WSO2 Inc
> www.wso2.com "Open Source SOA Company"
> ________________________________________
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
>
>
> --
> Nandika Jayawardana
> Technical Lead and Project Manager, WSO2 Inc
> www.wso2.com "Open Source SOA Company"
> ________________________________________
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
>
> _______________________________________________
> Wsf-php-user mailing list
> [hidden email]
> https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

_______________________________________________
Wsf-php-user mailing list
[hidden email]
https://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user

withwsdl.txt (39K) Download Attachment
withoutwsdl.txt (10K) Download Attachment