[ 
https://issues.apache.org/jira/browse/AXIS2C-626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Juergen Haeussler updated AXIS2C-626:
-------------------------------------


We recently found the problem in the network_handler.c:
The windows API expects timeouts for sockets in milliseconds as a DWORD value 
(as you can see in API documentation of setsockopt/SOL_SOCKET).
In the Axis code it was set to seconds by using a timeval struct:

AXIS2_EXTERN axis2_status_t AXIS2_CALL
axutil_network_handler_set_sock_option(const axutil_env_t *env, axis2_socket_t 
socket,
        int option, int value)
{
    if (option == SO_RCVTIMEO || option == SO_SNDTIMEO)
    {
        struct timeval tv;
        /* we deal with milliseconds */
        tv.tv_sec = value / 1000;
        tv.tv_usec = (value % 1000) * 1000;
        
        setsockopt(socket, SOL_SOCKET, option, (char*) &tv, sizeof(tv));
        return AXIS2_SUCCESS;
    }
    return AXIS2_FAILURE;
}

So we changed this method to the following code and now everything works well:

AXIS2_EXTERN axis2_status_t AXIS2_CALL
axutil_network_handler_set_sock_option(const axutil_env_t *env, axis2_socket_t 
socket,
        int option, int value)
{
    if (option == SO_RCVTIMEO || option == SO_SNDTIMEO)
    {
                #if defined(WIN32)
                        DWORD tv = value; //windows expects milliseconds in a 
DWORD
                #else
                        struct timeval tv;
                        /* we deal with milliseconds */
                        tv.tv_sec = value / 1000;
                        tv.tv_usec = (value % 1000) * 1000;
                #endif
        
        setsockopt(socket, SOL_SOCKET, option, (char*) &tv, sizeof(tv));
        return AXIS2_SUCCESS;
    }
    return AXIS2_FAILURE;
}

Please transfer this change to the source repository that it will be included 
in subsequent versions of Axis2/C.

Thanks

> client fires error on synchronous calls of longer duration
> ----------------------------------------------------------
>
>                 Key: AXIS2C-626
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-626
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/clientapi, core/transport, platforms/windows
>    Affects Versions: 1.0.0, 1.1.0
>         Environment: Win32, WS hostet by JBoss 4.2
>            Reporter: Juergen Haeussler
>            Priority: Blocker
>         Attachments: Auftragsverwaltung_liefereAuftraege.log
>
>
> we use the axis2/c library to implement a WS client that executes synchronous 
> calls (via axis2_svc_client_send_receive).
> When the webservice needs a little time to return the response (it is indeed 
> under one second), the axis2/c API fails with the following error:
> errorNr =  82
> errorText = Input stream is NULL in msg_ctx

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to