Beispiel #1
0
static HRESULT send_message( WS_CHANNEL *channel, WS_MESSAGE *msg, WS_MESSAGE_DESCRIPTION *desc,
                             WS_PARAMETER_DESCRIPTION *params, ULONG count, const void **args )
{
    WS_XML_WRITER *writer;
    HRESULT hr;

    if ((hr = message_set_action( msg, desc->action )) != S_OK) return hr;
    if ((hr = WsCreateWriter( NULL, 0, &writer, NULL )) != S_OK) return hr;
    if ((hr = set_output( writer )) != S_OK) goto done;
    if ((hr = write_message( msg, writer, desc->bodyElementDescription, params, count, args )) != S_OK) goto done;
    hr = channel_send_message( channel, msg );

done:
    WsFreeWriter( writer );
    return hr;
}
Beispiel #2
0
/**************************************************************************
 *          WsSendMessage		[webservices.@]
 */
HRESULT WINAPI WsSendMessage( WS_CHANNEL *handle, WS_MESSAGE *msg, const WS_MESSAGE_DESCRIPTION *desc,
                              WS_WRITE_OPTION option, const void *body, ULONG size, const WS_ASYNC_CONTEXT *ctx,
                              WS_ERROR *error )
{
    struct channel *channel = (struct channel *)handle;
    HRESULT hr;

    TRACE( "%p %p %p %08x %p %u %p %p\n", handle, msg, desc, option, body, size, ctx, error );
    if (error) FIXME( "ignoring error parameter\n" );
    if (ctx) FIXME( "ignoring ctx parameter\n" );

    if (!handle || !msg || !desc) return E_INVALIDARG;

    if ((hr = WsInitializeMessage( msg, WS_REQUEST_MESSAGE, NULL, NULL )) != S_OK) return hr;
    if ((hr = WsAddressMessage( msg, &channel->addr, NULL )) != S_OK) return hr;
    if ((hr = message_set_action( msg, desc->action )) != S_OK) return hr;

    if (!channel->writer && (hr = WsCreateWriter( NULL, 0, &channel->writer, NULL )) != S_OK) return hr;
    if ((hr = set_output( channel->writer )) != S_OK) return hr;
    if ((hr = write_message( msg, channel->writer, desc->bodyElementDescription, option, body, size )) != S_OK)
        return hr;

    return channel_send_message( handle, msg );
}