BTW, This is reguarding your try to WSF/PHP and sample 03 in Rampart. Not reguarding the discussion on connecting to Axis2 Math service.
-Manjula. On Fri, 2007-09-21 at 09:36 +0530, Manjula Peiris wrote: > Hi Shams, > > The policy file you are using at the client side with WSF/PHP is wrong. > This is the reason for getting policy creation failed error. Because the > <ramp:RampartConfig> part is a Rampart/Java based configuration, Please > remove <ramp:RampartConfig> element and its children elements from the > policy file. Since you are giving these options through WSSecurityToken > you don't need to specify them in the policy file. > > I think you can get an idea about this from the policy files and scripts > we send you before. > > Thanks, > -Manjula. > > > On Thu, 2007-09-20 at 12:22 +0000, shams jawaid wrote: > > Hi, i am trying to implement sample 03 of rampart 1.3 policy samples > > using wsf php extension and axis2/java 1.3 + rampart 1.3, however i > > get the error: > > > > policy creation failedSoap Fault: Missing wsse:Security header in > > request > > > > i have just referenced the sample policy file from my php client, and > > used the sample services.xml file as well, and i havent changed > > anything apart from the reference to the PWCBHanlder class. > > > > here is my php client : > > > > <?php > > $reqPayloadString = <<<XML > > <ns1:add > > xmlns:ns1='http://math'><ns1:Param0>1</ns1:Param0><ns1:Param1>1</ns1:Param1> > > </ns1:add> > > XML; > > try { > > $my_cert = ws_get_cert_from_file('alice_cert.cert'); // client side > > certificate( public key) > > $my_key = ws_get_key_from_file('alice_key.pem'); // client side key > > $rec_cert = ws_get_cert_from_file('bob_cert.cert'); // server side > > certificate (public key ) > > > > $reqMessage = new WSMessage($reqPayloadString, > > array('to'=>'http://localhost:8181/axis2/services/Math','action' => > > 'urn:add')); > > > > > > $sec_token = new WSSecurityToken(array('privateKey' => $my_key, > > 'certificate' => $my_cert, > > 'receiverCertificate' => $rec_cert, > > 'ttl'=> 60)); > > $policy_xml = file_get_contents('policy.xml'); > > $policy = new WSPolicy($policy_xml); > > > > > > $client = new WSClient(array('useWSA' => TRUE, > > 'policy' => $policy, > > 'securityToken' => $sec_token)); > > > > $resMessage = $client->request($reqMessage); > > > > printf('Response = %s \n', $resMessage->str); > > } catch (Exception $e) { > > if ($e instanceof WSFault) { > > printf('Soap Fault: %s\n', $e->Reason); > > } else { > > printf('Message = %s\n',$e->getMessage()); > > } > > } > > ?> > > > > i have been trying non-stop just to get encryption and signature > > working :(, but i keep getting errors, if anyone has a working sample > > please can i see it? or if anyone knows the reason for this error > > please let me know. thanks > > > > > > ______________________________________________________________________ > > Do you know a place like the back of your hand? Share local knowledge > > with BackOfMyHand.com > > _______________________________________________ > > Wsf-php-user mailing list > > [EMAIL PROTECTED] > > http://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user > > > _______________________________________________ > Wsf-php-user mailing list > [EMAIL PROTECTED] > http://wso2.org/cgi-bin/mailman/listinfo/wsf-php-user
