problem with libxml 2.7.5

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

problem with libxml 2.7.5

François Périchon
Hi,
libxml2 last version has recently been pushed on debian testing and our
webservices ceased to function.

Here is a sample of a webservice to show the problem:
<?php

$requestPayloadString = <<<XML
<greet>Hello Service!</greet>
XML;

try
{

$policy = new WSPolicy(array(
     "security" => array("useUsernameToken" => TRUE)
));

$s_token = new WSSecuritytoken(array(
     "user"          =>  "blabla",
     "password"      =>  "blabla!",
     "passwordType"  =>  "Digest"
));

$message = new WSMessage($requestPayloadString,
                 array("to" => "http://ldapmasta/wstest/wssec_server.php",
                         "action" => "http://ldapmasta/wstest/action1"));

$client = new WSClient(array(
     "useWSA"        =>  TRUE,
     "policy"        =>  $policy,
     "securityToken" =>  $s_token
));


$response = $client->request($message);

echo "Hello service replied saying: '";
echo $response->str;
echo "'\n";
}
catch (Exception $e)
{

         if ($e instanceof WSFault)
         {
             $fault = $e;
                 printf("Soap Fault received with '%s'\n",
                         $fault->__tostring());
         }
         else
         {
                 printf("Exception caught with message '%s'\n",
$e->getMessage());
         }
}
?>

If I launch it with libxml2-2.7.3:
lebarjack@ldapmasta ~/exemples-webservices $ php wssec_client.php
Hello service replied saying: '<greetResponse>Hello Client!</greetResponse>'

If I launch it with libxml2-2.7.5
lebarjack@ldapmasta ~/exemples-webservices $
LD_LIBRARY_PATH=/home/lebarjack/lib/usr/lib/ php wssec_client.php
[Wed Oct 14 10:11:49 2009] [error] libxml2_reader_wrapper.c(990) Extra
content at the end of the document
  -- SEVERITY_ERROR
[Wed Oct 14 10:11:49 2009] [error] libxml2_reader_wrapper.c(464)  error
occurred in reading xml stream
[Wed Oct 14 10:11:49 2009] [error] libxml2_reader_wrapper.c(990) Extra
content at the end of the document
  -- SEVERITY_ERROR
[Wed Oct 14 10:11:49 2009] [error] libxml2_reader_wrapper.c(464)  error
occurred in reading xml stream
[Wed Oct 14 10:11:49 2009] [critical] soap_builder.c(852) SOAP message
does not have a SOAP envelope element
[Wed Oct 14 10:11:49 2009] [error]
/root/wso2-wsf-php-src-2.0.0/src/wsf_client.c(1649) [WSF/PHP] Response
Payload NULL( Error number and code) => : 188 :: SOAP message does not
contain a SOAP envelope element
Exception caught with message 'request payload should not be null'
[Wed Oct 14 10:11:49 2009]  Script:  'wssec_client.php'
/usr/local/src/php-5.2.10/Zend/zend_exceptions.c(613) :  Freeing
0x0935E2A0 (16 bytes), script=wssec_client.php
=== Total 1 memory leaks detected ===

We experimented a bit with the xml chunk we used as the payload. If we
add a fake namespace:
$requestPayloadString = <<<XML
<ns1:greet xmlns:ns1="http://blabla.bla">Hello Service!</ns1:greet>
XML;

It starts to work again:
LD_LIBRARY_PATH=/home/lebarjack/lib/usr/lib/ php wssec_client.php
Hello service replied saying: '<greetResponse>Hello Client!</greetResponse>'

Does someone have an idea of what changed in libxml?
Shall we add namespace in all the payload we use?

Regards
--
François Périchon
Gestion des identités numériques
Université Lille 2 - Droit & Santé
Centre de Ressources Informatiques
http://cri.univ-lille2.fr
tel: +33 3 20 96 52 28

_______________________________________________
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
|  
Report Content as Inappropriate

Re: problem with libxml 2.7.5

Nandika Jayawardana
Looks like there is some functionaility change in the new libxml2 version which might require an changes to the code.
Could you please raise a  jira for this.

Regards
Nandika

2009/10/14 francois.perichon <[hidden email]>
Hi,
libxml2 last version has recently been pushed on debian testing and our
webservices ceased to function.

Here is a sample of a webservice to show the problem:
<?php

$requestPayloadString = <<<XML
<greet>Hello Service!</greet>
XML;

try
{

$policy = new WSPolicy(array(
    "security" => array("useUsernameToken" => TRUE)
));

$s_token = new WSSecuritytoken(array(
    "user"          =>  "blabla",
    "password"      =>  "blabla!",
    "passwordType"  =>  "Digest"
));

$message = new WSMessage($requestPayloadString,
                array("to" => "http://ldapmasta/wstest/wssec_server.php",
                        "action" => "http://ldapmasta/wstest/action1"));

$client = new WSClient(array(
    "useWSA"        =>  TRUE,
    "policy"        =>  $policy,
    "securityToken" =>  $s_token
));


$response = $client->request($message);

echo "Hello service replied saying: '";
echo $response->str;
echo "'\n";
}
catch (Exception $e)
{

        if ($e instanceof WSFault)
        {
            $fault = $e;
                printf("Soap Fault received with '%s'\n",
                        $fault->__tostring());
        }
        else
        {
                printf("Exception caught with message '%s'\n",
$e->getMessage());
        }
}
?>

If I launch it with libxml2-2.7.3:
lebarjack@ldapmasta ~/exemples-webservices $ php wssec_client.php
Hello service replied saying: '<greetResponse>Hello Client!</greetResponse>'

If I launch it with libxml2-2.7.5
lebarjack@ldapmasta ~/exemples-webservices $
LD_LIBRARY_PATH=/home/lebarjack/lib/usr/lib/ php wssec_client.php
[Wed Oct 14 10:11:49 2009] [error] libxml2_reader_wrapper.c(990) Extra
content at the end of the document
 -- SEVERITY_ERROR
[Wed Oct 14 10:11:49 2009] [error] libxml2_reader_wrapper.c(464)  error
occurred in reading xml stream
[Wed Oct 14 10:11:49 2009] [error] libxml2_reader_wrapper.c(990) Extra
content at the end of the document
 -- SEVERITY_ERROR
[Wed Oct 14 10:11:49 2009] [error] libxml2_reader_wrapper.c(464)  error
occurred in reading xml stream
[Wed Oct 14 10:11:49 2009] [critical] soap_builder.c(852) SOAP message
does not have a SOAP envelope element
[Wed Oct 14 10:11:49 2009] [error]
/root/wso2-wsf-php-src-2.0.0/src/wsf_client.c(1649) [WSF/PHP] Response
Payload NULL( Error number and code) => : 188 :: SOAP message does not
contain a SOAP envelope element
Exception caught with message 'request payload should not be null'
[Wed Oct 14 10:11:49 2009]  Script:  'wssec_client.php'
/usr/local/src/php-5.2.10/Zend/zend_exceptions.c(613) :  Freeing
0x0935E2A0 (16 bytes), script=wssec_client.php
=== Total 1 memory leaks detected ===

We experimented a bit with the xml chunk we used as the payload. If we
add a fake namespace:
$requestPayloadString = <<<XML
<ns1:greet xmlns:ns1="http://blabla.bla">Hello Service!</ns1:greet>
XML;

It starts to work again:
LD_LIBRARY_PATH=/home/lebarjack/lib/usr/lib/ php wssec_client.php
Hello service replied saying: '<greetResponse>Hello Client!</greetResponse>'

Does someone have an idea of what changed in libxml?
Shall we add namespace in all the payload we use?

Regards
--
François Périchon
Gestion des identités numériques
Université Lille 2 - Droit & Santé
Centre de Ressources Informatiques
http://cri.univ-lille2.fr
tel: +33 3 20 96 52 28

_______________________________________________
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
Loading...