Пример #1
0
SoapResponse* WsmResponseEncoder::_encodeWsenEnumerateResponse(
    WsenEnumerateResponse* response)
{
    SoapResponse* soapResponse = new SoapResponse(response);
    Buffer headers;

    if (response->requestedItemCount())
    {
        WsmWriter::appendStartTag(
            headers, WsmNamespaces::WS_MAN, STRLIT("TotalItemsCountEstimate"));
        WsmWriter::append(headers, response->getItemCount());
        WsmWriter::appendEndTag(
            headers, WsmNamespaces::WS_MAN, STRLIT("TotalItemsCountEstimate"));
    }

    if (!_encodeEnumerationData(
            *soapResponse, 
            headers, 
            WS_ENUMERATION_ENUMERATE,
            response->getEnumerationContext(),
            response->isComplete(),
            response->getEnumerationData(),
            response->getResourceUri()))
    {
        delete soapResponse;
        return _encodeEncodingLimitFault(response);
    }

    return soapResponse;
}
Пример #2
0
SoapResponse* WsmResponseEncoder::encodeWsenEnumerateResponse(
    WsenEnumerateResponse* response,
    Uint32& numDataItemsEncoded)
{
    AutoPtr<SoapResponse> soapResponse(new SoapResponse(response));
    Buffer headers;

    if (response->requestedItemCount())
    {
        WsmWriter::appendStartTag(
            headers, WsmNamespaces::WS_MAN, STRLIT("TotalItemsCountEstimate"));
        WsmWriter::append(headers, response->getItemCount());
        WsmWriter::appendEndTag(
            headers, WsmNamespaces::WS_MAN, STRLIT("TotalItemsCountEstimate"));
    }

    if (!_encodeEnumerationData(
            *soapResponse.get(),
            headers,
            WS_ENUMERATION_ENUMERATE,
            response->getEnumerationContext(),
            response->isComplete(),
            response->getEnumerationData(),
            numDataItemsEncoded,
            response->getResourceUri()))
    {
        soapResponse.reset(_buildEncodingLimitFault(response));
    }

    return soapResponse.release();
}
Пример #3
0
SoapResponse* WsmResponseEncoder::_encodeWsenPullResponse(
    WsenPullResponse* response)
{
    SoapResponse* soapResponse = new SoapResponse(response);
    Buffer headers;

    if (!_encodeEnumerationData(
            *soapResponse, 
            headers, 
            WS_ENUMERATION_PULL,
            response->getEnumerationContext(),
            response->isComplete(),
            response->getEnumerationData(),
            response->getResourceUri()))
    {
        delete soapResponse;
        return _encodeEncodingLimitFault(response);
    }

    return soapResponse;
}
Пример #4
0
SoapResponse* WsmResponseEncoder::encodeWsenPullResponse(
    WsenPullResponse* response,
    Uint32& numDataItemsEncoded)
{
    AutoPtr<SoapResponse> soapResponse(new SoapResponse(response));
    Buffer headers;

    if (!_encodeEnumerationData(
            *soapResponse.get(),
            headers,
            WS_ENUMERATION_PULL,
            response->getEnumerationContext(),
            response->isComplete(),
            response->getEnumerationData(),
            numDataItemsEncoded,
            response->getResourceUri()))
    {
        soapResponse.reset(_buildEncodingLimitFault(response));
    }

    return soapResponse.release();
}