diff --git a/include/webservices.h b/include/webservices.h index 532275b3576..9f1d9891cbe 100644 --- a/include/webservices.h +++ b/include/webservices.h @@ -78,6 +78,11 @@ typedef struct _WS_HTTP_MESSAGE_MAPPING WS_HTTP_MESSAGE_MAPPING; typedef struct _WS_HTTP_HEADER_MAPPING WS_HTTP_HEADER_MAPPING; typedef struct _WS_HTTP_REDIRECT_CALLBACK_CONTEXT WS_HTTP_REDIRECT_CALLBACK_CONTEXT; typedef struct _WS_PROXY_MESSAGE_CALLBACK_CONTEXT WS_PROXY_MESSAGE_CALLBACK_CONTEXT; +typedef struct _WS_LISTENER WS_LISTENER; +typedef struct _WS_LISTENER_PROPERTY WS_LISTENER_PROPERTY; +typedef struct _WS_DISALLOWED_USER_AGENT_SUBSTRINGS WS_DISALLOWED_USER_AGENT_SUBSTRINGS; +typedef struct _WS_LISTENER_PROPERTIES WS_LISTENER_PROPERTIES; +typedef struct _WS_CUSTOM_LISTENER_CALLBACKS WS_CUSTOM_LISTENER_CALLBACKS; struct _WS_STRUCT_DESCRIPTION; struct _WS_XML_STRING; @@ -1163,6 +1168,16 @@ struct _WS_HTTPS_URL { WS_STRING fragment; }; +struct _WS_NETTCP_URL { + WS_URL url; + WS_STRING host; + USHORT port; + WS_STRING portAsString; + WS_STRING path; + WS_STRING query; + WS_STRING fragment; +}; + struct _WS_SOAPUDP_URL { WS_URL url; WS_STRING host; @@ -1385,7 +1400,120 @@ struct _WS_PROXY_MESSAGE_CALLBACK_CONTEXT void *state; }; +typedef enum +{ + WS_LISTENER_STATE_CREATED, + WS_LISTENER_STATE_OPENING, + WS_LISTENER_STATE_OPEN, + WS_LISTENER_STATE_FAULTED, + WS_LISTENER_STATE_CLOSING, + WS_LISTENER_STATE_CLOSED +} WS_LISTENER_STATE; + +typedef enum +{ + WS_LISTENER_PROPERTY_LISTEN_BACKLOG, + WS_LISTENER_PROPERTY_IP_VERSION, + WS_LISTENER_PROPERTY_STATE, + WS_LISTENER_PROPERTY_ASYNC_CALLBACK_MODEL, + WS_LISTENER_PROPERTY_CHANNEL_TYPE, + WS_LISTENER_PROPERTY_CHANNEL_BINDING, + WS_LISTENER_PROPERTY_CONNECT_TIMEOUT, + WS_LISTENER_PROPERTY_IS_MULTICAST, + WS_LISTENER_PROPERTY_MULTICAST_INTERFACES, + WS_LISTENER_PROPERTY_MULTICAST_LOOPBACK, + WS_LISTENER_PROPERTY_CLOSE_TIMEOUT, + WS_LISTENER_PROPERTY_TO_HEADER_MATCHING_OPTIONS, + WS_LISTENER_PROPERTY_TRANSPORT_URL_MATCHING_OPTIONS, + WS_LISTENER_PROPERTY_CUSTOM_LISTENER_CALLBACKS, + WS_LISTENER_PROPERTY_CUSTOM_LISTENER_PARAMETERS, + WS_LISTENER_PROPERTY_CUSTOM_LISTENER_INSTANCE, + WS_LISTENER_PROPERTY_DISALLOWED_USER_AGENT +} WS_LISTENER_PROPERTY_ID; + +struct _WS_LISTENER_PROPERTY +{ + WS_LISTENER_PROPERTY_ID id; + void *value; + ULONG valueSize; +}; + +struct _WS_DISALLOWED_USER_AGENT_SUBSTRINGS +{ + ULONG subStringCount; + WS_STRING **subStrings; +}; + +struct _WS_LISTENER_PROPERTIES +{ + WS_LISTENER_PROPERTY *properties; + ULONG propertyCount; +}; + +typedef HRESULT (CALLBACK *WS_CREATE_LISTENER_CALLBACK) + (WS_CHANNEL_TYPE, const void*, ULONG, void**, WS_ERROR*); + +typedef void (CALLBACK *WS_FREE_LISTENER_CALLBACK) + (void*); + +typedef HRESULT (CALLBACK *WS_RESET_LISTENER_CALLBACK) + (void*, WS_ERROR*); + +typedef HRESULT (CALLBACK *WS_OPEN_LISTENER_CALLBACK) + (void*, const WS_STRING*, const WS_ASYNC_CONTEXT*, WS_ERROR*); + +typedef HRESULT (CALLBACK *WS_CLOSE_LISTENER_CALLBACK) + (void*, const WS_ASYNC_CONTEXT*, WS_ERROR*); + +typedef HRESULT (CALLBACK *WS_ABORT_LISTENER_CALLBACK) + (void*, WS_ERROR*); + +typedef HRESULT (CALLBACK *WS_GET_LISTENER_PROPERTY_CALLBACK) + (void*, WS_LISTENER_PROPERTY_ID, void*, ULONG, WS_ERROR*); + +typedef HRESULT (CALLBACK *WS_SET_LISTENER_PROPERTY_CALLBACK) + (void*, WS_LISTENER_PROPERTY_ID, const void*, ULONG, WS_ERROR*); + +typedef HRESULT (CALLBACK *WS_CREATE_CHANNEL_FOR_LISTENER_CALLBACK) + (void*, const void*, ULONG, void**, WS_ERROR*); + +typedef HRESULT (CALLBACK *WS_ACCEPT_CHANNEL_CALLBACK) + (void*, void*, const WS_ASYNC_CONTEXT*, WS_ERROR*); + +struct _WS_CUSTOM_LISTENER_CALLBACKS +{ + WS_CREATE_LISTENER_CALLBACK createListenerCallback; + WS_FREE_LISTENER_CALLBACK freeListenerCallback; + WS_RESET_LISTENER_CALLBACK resetListenerCallback; + WS_OPEN_LISTENER_CALLBACK openListenerCallback; + WS_CLOSE_LISTENER_CALLBACK closeListenerCallback; + WS_ABORT_LISTENER_CALLBACK abortListenerCallback; + WS_GET_LISTENER_PROPERTY_CALLBACK getListenerPropertyCallback; + WS_SET_LISTENER_PROPERTY_CALLBACK setListenerPropertyCallback; + WS_CREATE_CHANNEL_FOR_LISTENER_CALLBACK createChannelForListenerCallback; + WS_ACCEPT_CHANNEL_CALLBACK acceptChannelCallback; +}; + +enum +{ + WS_MATCH_URL_DNS_HOST = 0x1, + WS_MATCH_URL_DNS_FULLY_QUALIFIED_HOST = 0x2, + WS_MATCH_URL_NETBIOS_HOST = 0x4, + WS_MATCH_URL_LOCAL_HOST = 0x8, + WS_MATCH_URL_HOST_ADDRESSES = 0x10, + WS_MATCH_URL_THIS_HOST = (WS_MATCH_URL_DNS_HOST | + WS_MATCH_URL_DNS_FULLY_QUALIFIED_HOST | + WS_MATCH_URL_NETBIOS_HOST | + WS_MATCH_URL_LOCAL_HOST | + WS_MATCH_URL_HOST_ADDRESSES), + WS_MATCH_URL_PORT = 0x20, + WS_MATCH_URL_EXACT_PATH = 0x40, + WS_MATCH_URL_PREFIX_PATH = 0x80, + WS_MATCH_URL_NO_QUERY = 0x100 +}; + HRESULT WINAPI WsAbortServiceProxy(WS_SERVICE_PROXY*, WS_ERROR*); +HRESULT WINAPI WsAcceptChannel(WS_LISTENER*, WS_CHANNEL*, const WS_ASYNC_CONTEXT*, WS_ERROR*); HRESULT WINAPI WsAddCustomHeader(WS_MESSAGE*, const WS_ELEMENT_DESCRIPTION*, WS_WRITE_OPTION, const void*, ULONG, ULONG, WS_ERROR*); HRESULT WINAPI WsAddMappedHeader(WS_MESSAGE*, const WS_XML_STRING*, WS_TYPE, WS_WRITE_OPTION, @@ -1396,13 +1524,18 @@ HRESULT WINAPI WsCall(WS_SERVICE_PROXY*, const WS_OPERATION_DESCRIPTION*, const WS_HEAP*, const WS_CALL_PROPERTY*, const ULONG, const WS_ASYNC_CONTEXT*, WS_ERROR*); HRESULT WINAPI WsCloseChannel(WS_CHANNEL*, const WS_ASYNC_CONTEXT*, WS_ERROR*); +HRESULT WINAPI WsCloseListener(WS_LISTENER*, const WS_ASYNC_CONTEXT*, WS_ERROR*); HRESULT WINAPI WsCloseServiceProxy(WS_SERVICE_PROXY*, const WS_ASYNC_CONTEXT*, WS_ERROR*); HRESULT WINAPI WsCombineUrl(const WS_STRING*, const WS_STRING*, ULONG, WS_HEAP*, WS_STRING*, WS_ERROR*); HRESULT WINAPI WsCopyNode(WS_XML_WRITER*, WS_XML_READER*, WS_ERROR*); HRESULT WINAPI WsCreateChannel(WS_CHANNEL_TYPE, WS_CHANNEL_BINDING, const WS_CHANNEL_PROPERTY*, ULONG, const WS_SECURITY_DESCRIPTION*, WS_CHANNEL**, WS_ERROR*); +HRESULT WINAPI WsCreateChannelForListener(WS_LISTENER*, const WS_CHANNEL_PROPERTY*, ULONG, WS_CHANNEL**, + WS_ERROR*); HRESULT WINAPI WsCreateError(const WS_ERROR_PROPERTY*, ULONG, WS_ERROR**); HRESULT WINAPI WsCreateHeap(SIZE_T, SIZE_T, const WS_HEAP_PROPERTY*, ULONG, WS_HEAP**, WS_ERROR*); +HRESULT WINAPI WsCreateListener(WS_CHANNEL_TYPE, WS_CHANNEL_BINDING, const WS_LISTENER_PROPERTY*, + ULONG, const WS_SECURITY_DESCRIPTION*, WS_LISTENER**, WS_ERROR*); HRESULT WINAPI WsCreateMessage(WS_ENVELOPE_VERSION, WS_ADDRESSING_VERSION, const WS_MESSAGE_PROPERTY*, ULONG, WS_MESSAGE**, WS_ERROR*); HRESULT WINAPI WsCreateMessageForChannel(WS_CHANNEL*, const WS_MESSAGE_PROPERTY*, ULONG, WS_MESSAGE**, @@ -1429,6 +1562,7 @@ HRESULT WINAPI WsFindAttribute(WS_XML_READER*, const WS_XML_STRING*, const WS_XM void WINAPI WsFreeChannel(WS_CHANNEL*); void WINAPI WsFreeError(WS_ERROR*); void WINAPI WsFreeHeap(WS_HEAP*); +void WINAPI WsFreeListener(WS_LISTENER*); void WINAPI WsFreeMessage(WS_MESSAGE*); void WINAPI WsFreeReader(WS_XML_READER*); void WINAPI WsFreeServiceProxy(WS_SERVICE_PROXY*); @@ -1437,6 +1571,7 @@ HRESULT WINAPI WsGetChannelProperty(WS_CHANNEL*, WS_CHANNEL_PROPERTY_ID, void*, HRESULT WINAPI WsGetErrorProperty(WS_ERROR*, WS_ERROR_PROPERTY_ID, void*, ULONG); HRESULT WINAPI WsGetErrorString(WS_ERROR*, ULONG, WS_STRING*); HRESULT WINAPI WsGetHeapProperty(WS_HEAP*, WS_HEAP_PROPERTY_ID, void*, ULONG, WS_ERROR*); +HRESULT WINAPI WsGetListenerProperty(WS_LISTENER*, WS_LISTENER_PROPERTY_ID, void*, ULONG, WS_ERROR*); HRESULT WINAPI WsGetMessageProperty(WS_MESSAGE*, WS_MESSAGE_PROPERTY_ID, void*, ULONG, WS_ERROR*); HRESULT WINAPI WsGetNamespaceFromPrefix(WS_XML_READER*, const WS_XML_STRING*, BOOL, const WS_XML_STRING**, WS_ERROR*); @@ -1455,6 +1590,7 @@ HRESULT WINAPI WsInitializeMessage(WS_MESSAGE*, WS_MESSAGE_INITIALIZATION, WS_ME HRESULT WINAPI WsMoveReader(WS_XML_READER*, WS_MOVE_TO, BOOL*, WS_ERROR*); HRESULT WINAPI WsMoveWriter(WS_XML_WRITER*, WS_MOVE_TO, BOOL*, WS_ERROR*); HRESULT WINAPI WsOpenChannel(WS_CHANNEL*, const WS_ENDPOINT_ADDRESS*, const WS_ASYNC_CONTEXT*, WS_ERROR*); +HRESULT WINAPI WsOpenListener(WS_LISTENER*, WS_STRING*, const WS_ASYNC_CONTEXT*, WS_ERROR*); HRESULT WINAPI WsOpenServiceProxy(WS_SERVICE_PROXY*, const WS_ENDPOINT_ADDRESS*, const WS_ASYNC_CONTEXT*, WS_ERROR*); HRESULT WINAPI WsReadAttribute(WS_XML_READER*, const WS_ATTRIBUTE_DESCRIPTION*, WS_READ_OPTION, @@ -1471,6 +1607,8 @@ HRESULT WINAPI WsReadEndElement(WS_XML_READER*, WS_ERROR*); HRESULT WINAPI WsReadEnvelopeEnd(WS_MESSAGE*, WS_ERROR*); HRESULT WINAPI WsReadEnvelopeStart(WS_MESSAGE*, WS_XML_READER*, WS_MESSAGE_DONE_CALLBACK, void*, WS_ERROR*); +HRESULT WINAPI WsReadMessageEnd(WS_CHANNEL*, WS_MESSAGE*, const WS_ASYNC_CONTEXT*, WS_ERROR*); +HRESULT WINAPI WsReadMessageStart(WS_CHANNEL*, WS_MESSAGE*, const WS_ASYNC_CONTEXT*, WS_ERROR*); HRESULT WINAPI WsReadNode(WS_XML_READER*, WS_ERROR*); HRESULT WINAPI WsReadStartAttribute(WS_XML_READER*, ULONG, WS_ERROR*); HRESULT WINAPI WsReadStartElement(WS_XML_READER*, WS_ERROR*); @@ -1491,6 +1629,7 @@ HRESULT WINAPI WsResetChannel(WS_CHANNEL*, WS_ERROR*); HRESULT WINAPI WsResetMessage(WS_MESSAGE*, WS_ERROR*); HRESULT WINAPI WsResetError(WS_ERROR*); HRESULT WINAPI WsResetHeap(WS_HEAP*, WS_ERROR*); +HRESULT WINAPI WsResetListener(WS_LISTENER*, WS_ERROR*); HRESULT WINAPI WsResetMessage(WS_MESSAGE*, WS_ERROR*); HRESULT WINAPI WsRequestReply(WS_CHANNEL*, WS_MESSAGE*, const WS_MESSAGE_DESCRIPTION*, WS_WRITE_OPTION, const void*, ULONG, WS_MESSAGE*, const WS_MESSAGE_DESCRIPTION*, @@ -1508,6 +1647,7 @@ HRESULT WINAPI WsSetInput(WS_XML_READER*, const WS_XML_READER_ENCODING*, const W const WS_XML_READER_PROPERTY*, ULONG, WS_ERROR*); HRESULT WINAPI WsSetInputToBuffer(WS_XML_READER*, WS_XML_BUFFER*, const WS_XML_READER_PROPERTY*, ULONG, WS_ERROR*); +HRESULT WINAPI WsSetListenerProperty(WS_LISTENER*, WS_LISTENER_PROPERTY_ID, const void*, ULONG, WS_ERROR*); HRESULT WINAPI WsSetMessageProperty(WS_MESSAGE*, WS_MESSAGE_PROPERTY_ID, const void*, ULONG, WS_ERROR*); HRESULT WINAPI WsSetOutput(WS_XML_WRITER*, const WS_XML_WRITER_ENCODING*, const WS_XML_WRITER_OUTPUT*, const WS_XML_WRITER_PROPERTY*, ULONG, WS_ERROR*); @@ -1522,6 +1662,7 @@ HRESULT WINAPI WsWriteAttribute(WS_XML_WRITER*, const WS_ATTRIBUTE_DESCRIPTION*, const void*, ULONG, WS_ERROR*); HRESULT WINAPI WsWriteBody(WS_MESSAGE*, const WS_ELEMENT_DESCRIPTION*, WS_WRITE_OPTION, const void*, ULONG, WS_ERROR*); +HRESULT WINAPI WsWriteBytes(WS_XML_WRITER*, const void*, ULONG, WS_ERROR*); HRESULT WINAPI WsWriteElement(WS_XML_WRITER*, const WS_ELEMENT_DESCRIPTION*, WS_WRITE_OPTION, const void*, ULONG, WS_ERROR*); HRESULT WINAPI WsWriteEndAttribute(WS_XML_WRITER*, WS_ERROR*);