Commit 7b6b34d0 authored by Owen Rudge's avatar Owen Rudge Committed by Alexandre Julliard

wsdapi: Add support for sending reference parameters in the Hello message.

parent 5e74b9ea
......@@ -77,6 +77,7 @@ static const WCHAR bodyString[] = { 'B','o','d','y', 0 };
static const WCHAR helloString[] = { 'H','e','l','l','o', 0 };
static const WCHAR endpointReferenceString[] = { 'E','n','d','p','o','i','n','t','R','e','f','e','r','e','n','c','e', 0 };
static const WCHAR addressString[] = { 'A','d','d','r','e','s','s', 0 };
static const WCHAR referenceParametersString[] = { 'R','e','f','e','r','e','n','c','e','P','a','r','a','m','e','t','e','r','s', 0 };
static const WCHAR typesString[] = { 'T','y','p','e','s', 0 };
static const WCHAR scopesString[] = { 'S','c','o','p','e','s', 0 };
static const WCHAR xAddrsString[] = { 'X','A','d','d','r','s', 0 };
......@@ -883,7 +884,7 @@ HRESULT send_hello_message(IWSDiscoveryPublisherImpl *impl, LPCWSTR id, ULONGLON
const WSD_URI_LIST *xaddrs_list, const WSDXML_ELEMENT *hdr_any, const WSDXML_ELEMENT *ref_param_any,
const WSDXML_ELEMENT *endpoint_ref_any, const WSDXML_ELEMENT *any)
{
WSDXML_ELEMENT *body_element = NULL, *hello_element, *endpoint_reference_element;
WSDXML_ELEMENT *body_element = NULL, *hello_element, *endpoint_reference_element, *ref_params_element;
struct list *discoveredNamespaces = NULL;
WSDXML_NAME *body_name = NULL;
WSD_SOAP_HEADER soapHeader;
......@@ -923,6 +924,17 @@ HRESULT send_hello_message(IWSDiscoveryPublisherImpl *impl, LPCWSTR id, ULONGLON
ret = add_child_element(impl->xmlContext, endpoint_reference_element, addressingNsUri, addressString, id, NULL);
if (FAILED(ret)) goto cleanup;
/* Write any reference parameters */
if (ref_param_any != NULL)
{
ret = add_child_element(impl->xmlContext, endpoint_reference_element, addressingNsUri, referenceParametersString,
NULL, &ref_params_element);
if (FAILED(ret)) goto cleanup;
ret = duplicate_element(ref_params_element, ref_param_any, discoveredNamespaces);
if (FAILED(ret)) goto cleanup;
}
/* Write any endpoint reference headers */
if (endpoint_ref_any != NULL)
{
......
......@@ -514,7 +514,7 @@ static void Publish_tests(void)
HRESULT rc;
ULONG ref;
char *msg;
WSDXML_ELEMENT *header_any_element, *body_any_element, *endpoint_any_element;
WSDXML_ELEMENT *header_any_element, *body_any_element, *endpoint_any_element, *ref_param_any_element;
WSDXML_NAME header_any_name, another_name;
WSDXML_NAMESPACE ns, ns2;
WCHAR header_any_name_text[] = {'B','e','e','r',0};
......@@ -522,6 +522,7 @@ static void Publish_tests(void)
static const WCHAR header_any_text[] = {'P','u','b','l','i','s','h','T','e','s','t',0};
static const WCHAR body_any_text[] = {'B','o','d','y','T','e','s','t',0};
static const WCHAR endpoint_any_text[] = {'E','n','d','P','T','e','s','t',0};
static const WCHAR ref_param_any_text[] = {'R','e','f','P','T','e','s','t',0};
static const WCHAR uri[] = {'h','t','t','p',':','/','/','w','i','n','e','.','t','e','s','t','/',0};
static const WCHAR prefix[] = {'w','i','n','e',0};
static const WCHAR uri2[] = {'h','t','t','p',':','/','/','m','o','r','e','.','t','e','s','t','s','/',0};
......@@ -606,6 +607,9 @@ static void Publish_tests(void)
rc = WSDXMLBuildAnyForSingleElement(&header_any_name, endpoint_any_text, &endpoint_any_element);
ok(rc == S_OK, "WSDXMLBuildAnyForSingleElement failed with %08x\n", rc);
rc = WSDXMLBuildAnyForSingleElement(&header_any_name, ref_param_any_text, &ref_param_any_element);
ok(rc == S_OK, "WSDXMLBuildAnyForSingleElement failed with %08x\n", rc);
/* Create types list */
ns2.Uri = uri2;
ns2.PreferredPrefix = prefix2;
......@@ -634,11 +638,12 @@ static void Publish_tests(void)
/* Publish the service */
rc = IWSDiscoveryPublisher_PublishEx(publisher, publisherIdW, 1, 1, 1, sequenceIdW, &types_list, &scopes_list,
&xaddrs_list, header_any_element, NULL, NULL, endpoint_any_element, body_any_element);
&xaddrs_list, header_any_element, ref_param_any_element, NULL, endpoint_any_element, body_any_element);
WSDFreeLinkedMemory(header_any_element);
WSDFreeLinkedMemory(body_any_element);
WSDFreeLinkedMemory(endpoint_any_element);
WSDFreeLinkedMemory(ref_param_any_element);
free(types_list.Next);
free(scopes_list.Next);
free(xaddrs_list.Next);
......@@ -658,7 +663,10 @@ static void Publish_tests(void)
/* Verify we've received a message */
ok(msgStorage->messageCount >= 1, "No messages received\n");
sprintf(endpointReferenceString, "<wsa:EndpointReference><wsa:Address>%s</wsa:Address><wine:Beer>EndPTest</wine:Beer></wsa:EndpointReference>", publisherId);
sprintf(endpointReferenceString, "<wsa:EndpointReference><wsa:Address>%s</wsa:Address><wsa:ReferenceParameters>"
"<wine:Beer>RefPTest</wine:Beer></wsa:ReferenceParameters><wine:Beer>EndPTest</wine:Beer>"
"</wsa:EndpointReference>", publisherId);
sprintf(app_sequence_string, "<wsd:AppSequence InstanceId=\"1\" SequenceId=\"%s\" MessageNumber=\"1\"></wsd:AppSequence>",
sequenceId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment