Expand Minimize

WsWriteBytes function

Writes bytes to the writer in a format optimized for the encoding. When writing in a text encoding, it will emit the bytes encoded in base64. When writing to a binary format, it will emit the bytes directly.

Syntax


HRESULT WINAPI  WsWriteBytes(
  _In_      WS_XML_WRITER* writer,
  const void* bytes,
  _In_      ULONG byteCount,
  _In_opt_  WS_ERROR* error
);

Parameters

writer [in]

The writer to which the bytes will be written.

bytes

The bytes to write to the document.

byteCount [in]

The number bytes to write to the document.

error [in, optional]

Specifies where additional error information should be stored if the function fails.

Return value

This function can return one of these values.

Return codeDescription
E_INVALIDARG

One or more arguments are invalid.

WS_E_INVALID_OPERATION

The operation is not allowed due to the current state of the object.

WS_E_QUOTA_EXCEEDED

A quota was exceeded.

 

Remarks

WsWriteBytes may be called more than once between WsWriteStartAttribute and WsWriteEndAttribute. It may not be combined with WsWriteChars, WsWriteCharsUtf8, WsWriteValue or WsWriteText when writing an attribute.

For the WS_XML_WRITER_MTOM_ENCODING, if the byteCount exceeds the maxInlineByteCount specified during WsSetOutput then the bytes will be buffered and placed in their own MIME part. Otherwise the bytes are encoded in base64 and placed directly in the document.

For the WS_XML_WRITER_MTOM_ENCODING, if the element containing the bytes has an attribute with the name 'contentType' and the namespace 'http://www.w3.org/2004/11/xmlmime', then the value of the attribute will be reflected in the content type header for the MIME part as described in XML-binary Optimized Packaging.

Requirements

Minimum supported client

Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | Windows Store apps]

Header

WebServices.h

Library

WebServices.lib

DLL

WebServices.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft