[Wsf-jira] [jira] Commented: (WSFPHP-455) Error while calling multiple operations on the same WSClient instance

Vilnis Termanis (JIRA) jira at wso2.org
Sun May 22 14:10:14 PDT 2011


    [ https://wso2.org/jira/browse/WSFPHP-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=42636#action_42636 ] 

Vilnis Termanis commented on WSFPHP-455:
----------------------------------------

This is caused by axis2c, see https://issues.apache.org/jira/browse/AXIS2C-1501
Quick fix: Replace wsf_c/axis2c/src/core/transport/http/sender/http_client.c with version from http://svn.apache.org/repos/asf/axis/axis2/c/core/trunk/src/core/transport/http/sender/http_client.c (Note: this is not fixed in axis2c 1.7.0, hence trunk of svn.)

> Error while calling multiple operations on the same WSClient instance
> ---------------------------------------------------------------------
>
>                 Key: WSFPHP-455
>                 URL: https://wso2.org/jira/browse/WSFPHP-455
>             Project: WSO2 WSF/PHP
>          Issue Type: Bug
>          Components: WSClient
>    Affects Versions: 2.1.0
>         Environment:  I am running the client on Ubuntu 9.10 with WSO2 2.1.0 and 1.0.0a of openssl. The server that I am connecting to is running CentOS release 5.5 with WSO2 version 1.2 and version 0.9.8e of openssl.
>            Reporter: John Thorhauer
>
> I am using version 2.1.0 while developing a PHP based web service client. I am trying to make multiple calls to the service using the same WSClient instance. The WSClient is making a connection using https and is using the CACert option as follows:
> --------------------------------------------------------------------------------
> $oWSClient = new WSClient(array("CACert" => "/home/jthorhauer/dev/test/jthor-cert.pem",
> "wsdl" => "file:///home/jthorhauer/dev/test/BaseObj.wsdl",
> "to" => "https://jthor.yakabod.net/ws/BaseObjectService-1_0",
> ));
> --------------------------------------------------------------------------------
> I then get the proxy from the WSClient. I can make one call to one operation. However, if I make a second call to a second operation I get an error. I have found that if I create another instance of the WSClient using the same parameters for the second operation call it works just fine. Here are my calls and the corresponding entries in the wsf log file when I make these calls.
> First operation that is successful:
> ----------------------------------------------------------------------------
> $proxy = $oWSClient->getProxy();
> $opts = array('loginId' => 'jthor', 'password' => 'XXXXXXXXX');
> $sessid = $proxy->authenticate($opts);
> ----------------------------------------------------------------------------
> Here is the pertinent log information from the successful attempt:
> ----------------------------------------------------------------------------
> [Sat Oct 16 13:05:33 2010] [debug] /home/jthorhauer/Downloads/wso2-wsf-php-src-2.1.0/src/wsf_wsdl.c(944) [WSF/PHP] soap action present :- http://jthor.yakabod.net/ws/BaseObjectServi
> ce-1_0/authenticate
> [Sat Oct 16 13:05:33 2010] [debug] /home/jthorhauer/Downloads/wso2-wsf-php-src-2.1.0/src/wsf_wsdl.c(1000) [WSF/PHP] soap version in wsdl mode is 1
> [Sat Oct 16 13:05:33 2010] [debug] op_client.c(888) Start:axis2_op_client_infer_transport
> [Sat Oct 16 13:05:33 2010] [debug] op_client.c(949) End:axis2_op_client_infer_transport
> [Sat Oct 16 13:05:33 2010] [debug] phase.c(202) Invoke the handler AddressingOutHandler within the phase MessageOut
> [Sat Oct 16 13:05:33 2010] [info] Starting addressing out handler
> [Sat Oct 16 13:05:33 2010] [debug] http_transport_sender.c(241) ctx_epr:https://jthor.yakabod.net/ws/BaseObjectService-1_0
> [Sat Oct 16 13:05:33 2010] [debug] http_transport_sender.c(776) using axis2 native http sender.
> [Sat Oct 16 13:05:33 2010] [debug] http_sender.c(494) msg_ctx_id:urn:uuid:96533c8c-d947-1df1-2f78-0800275850a9
> [Sat Oct 16 13:05:33 2010] [debug] http_transport_utils.c(3794) No session map stored
> [Sat Oct 16 13:05:33 2010] [info] [ssl client] Client certificate chain filenot specified
> [Sat Oct 16 13:05:33 2010] [debug] ssl/ssl_utils.c(189) [ssl client] SSL certificate verified against peer
> [Sat Oct 16 13:05:34 2010] [debug] http_transport_sender.c(792) OP name axutil_qname_get_localpart = http://www.w3.org/2004/08/wsdl/out-in
> [Sat Oct 16 13:05:34 2010] [debug] soap_builder.c(883) Identified soap version is soap11
> [Sat Oct 16 13:05:34 2010] [debug] phase.c(202) Invoke the handler request_uri_based_dispatcher within the phase Transport
> [Sat Oct 16 13:05:34 2010] [debug] phase.c(202) Invoke the handler AddressingInHandler within the phase Transport
> [Sat Oct 16 13:05:34 2010] [info] Starting addressing in handler
> ----------------------------------------------------------------------------
> Now on the second call to the second operation the code looks like this (using the same proxy form the same WSClient):
> ----------------------------------------------------------------------------
> $parms = array('authenticationToken' => $sessid['authenticationToken']);
> $serverStamp = $proxy->getServerTimestamp($parms);
> ----------------------------------------------------------------------------
> However, on the above call to getServerTimestamp I see the following in the wsf client log:
> ----------------------------------------------------------------------------
> [Sat Oct 16 13:05:34 2010] [debug] /home/jthorhauer/Downloads/wso2-wsf-php-src-2.1.0/src/wsf_wsdl.c(944) [WSF/PHP] soap action present :- http://jthor.yakabod.net/ws/BaseObjectService-1_0/getServerTimestamp
> [Sat Oct 16 13:05:34 2010] [debug] /home/jthorhauer/Downloads/wso2-wsf-php-src-2.1.0/src/wsf_wsdl.c(1000) [WSF/PHP] soap version in wsdl mode is 1
> [Sat Oct 16 13:05:34 2010] [debug] op_client.c(888) Start:axis2_op_client_infer_transport
> [Sat Oct 16 13:05:34 2010] [debug] op_client.c(949) End:axis2_op_client_infer_transport
> [Sat Oct 16 13:05:34 2010] [debug] phase.c(202) Invoke the handler AddressingOutHandler within the phase MessageOut
> [Sat Oct 16 13:05:34 2010] [info] Starting addressing out handler
> [Sat Oct 16 13:05:34 2010] [debug] http_transport_sender.c(241) ctx_epr:https://jthor.yakabod.net/ws/BaseObjectService-1_0
> [Sat Oct 16 13:05:34 2010] [debug] http_transport_sender.c(776) using axis2 native http sender.
> [Sat Oct 16 13:05:34 2010] [debug] http_sender.c(494) msg_ctx_id:urn:uuid:9714e4d6-d947-1df1-2f79-0800275850a9
> [Sat Oct 16 13:05:34 2010] [debug] http_transport_utils.c(3815) cookie:PHPSESSID=77ab40efdfb932c3e5092b3b82c5bb33; path=/
> [Sat Oct 16 13:05:34 2010] [info] [ssl client] Client certificate chain filenot specified
> [Sat Oct 16 13:05:34 2010] [error] ssl/ssl_utils.c(152) Error occurred in SSL engine
> [Sat Oct 16 13:05:34 2010] [error] ssl/ssl_stream.c(106) Error occurred in SSL engine
> [Sat Oct 16 13:05:34 2010] [error] http_client.c(294) Data stream creation failed for Host jthor.yakabod.net and 443 port
> [Sat Oct 16 13:05:34 2010] [error] http_client.c(560) Client data stream null or socket error for host jthor.yakabod.net and 443 port
> [Sat Oct 16 13:05:34 2010] [error] http_client.c(562) A read attempt(HTTP) for the reply without sending the request
> [Sat Oct 16 13:05:34 2010] [error] http_sender.c(1303) status_code < 0
> [Sat Oct 16 13:05:34 2010] [error] engine.c(171) Transport sender invoke failed
> [Sat Oct 16 13:05:34 2010] [error] /home/jthorhauer/Downloads/wso2-wsf-php-src-2.1.0/src/wsf_wsdl.c(1226) [wsf_wsdl] Response envelope not found
> [Sat Oct 16 13:05:34 2010] [info] [rampart] rampart_mod shutdown
> [Sat Oct 16 13:05:34 2010] [info] [rahas] Rahas module shutdown
> ----------------------------------------------------------------------------
> The only difference I can see in the two log files is the line in the second log sample that shows:
> [Sat Oct 16 13:05:34 2010] [debug] http_transport_utils.c(3815) cookie:PHPSESSID=77ab40efdfb932c3e5092b3b82c5bb33; path=/
> Again, I found that if I create a new instance of WSClient with the same options it seems to work fine. However, I did not want the overhead of having to create a new instance each time I use it. I should be able to share one instance of WSClient among several operational calls. Also, I found that making two calls on the same instance works just fine when I do not use a 'https' connection.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the Wsf-jira mailing list