Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WsGetNamespaceFromPrefix function

This function returns a namespace from the prefix to which it is bound.

If the value of the required parameter is set to TRUE and the Prefix is not bound to any namespace a WS_E_INVALID_FORMAT exception will be returned. (See Windows Web Services Return Values.) If the required parameter is FALSE, and the Prefix is not bound to any namespace the ns parameter will be NULL and the function will return S_FALSE.


HRESULT WINAPI  WsGetNamespaceFromPrefix(
  _In_     WS_XML_READER*        reader,
  _In_     const WS_XML_STRING*  prefix,
  _In_     BOOL                  required,
           const WS_XML_STRING** ns,
  _In_opt_ WS_ERROR*             error


reader [in]

A pointer to the reader for which the prefix should be searched.

prefix [in]

A pointer to the Prefix to search for.

required [in]

The value of this Boolean parameter determines whether or not an error should be returned if a matching namespace is not found.


A reference to a namespace to which the prefix is bound if successful. The value returned is valid only until the writer advances.

error [in, optional]

A pointer to a WS_ERROR object where additional information about the error should be stored if the function fails.

Return value

This function can return one of these values.

Return codeDescription

The input data was not in the expected format or did not have the expected value.



For the prefix "xml" it will return the namespace "".

For the prefix "xmlns" it will return the namespace "".


Minimum supported client

Windows 7 [desktop apps | UWP apps]

Minimum supported server

Windows Server 2008 R2 [desktop apps | UWP apps]









© 2018 Microsoft