Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
1acc1b9e
Commit
1acc1b9e
authored
Aug 31, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 31, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsRemoveCustomHeader.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
147cd6b3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
1 deletion
+90
-1
msg.c
dlls/webservices/msg.c
+32
-0
msg.c
dlls/webservices/tests/msg.c
+57
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
No files found.
dlls/webservices/msg.c
View file @
1acc1b9e
...
@@ -962,3 +962,35 @@ HRESULT WINAPI WsAddCustomHeader( WS_MESSAGE *handle, const WS_ELEMENT_DESCRIPTI
...
@@ -962,3 +962,35 @@ HRESULT WINAPI WsAddCustomHeader( WS_MESSAGE *handle, const WS_ELEMENT_DESCRIPTI
msg
->
header
[
i
]
=
header
;
msg
->
header
[
i
]
=
header
;
return
write_envelope
(
msg
);
return
write_envelope
(
msg
);
}
}
/**************************************************************************
* WsRemoveCustomHeader [webservices.@]
*/
HRESULT
WINAPI
WsRemoveCustomHeader
(
WS_MESSAGE
*
handle
,
const
WS_XML_STRING
*
name
,
const
WS_XML_STRING
*
ns
,
WS_ERROR
*
error
)
{
struct
msg
*
msg
=
(
struct
msg
*
)
handle
;
BOOL
removed
=
FALSE
;
ULONG
i
;
TRACE
(
"%p %s %s %p
\n
"
,
handle
,
debugstr_xmlstr
(
name
),
debugstr_xmlstr
(
ns
),
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
handle
||
!
name
||
!
ns
)
return
E_INVALIDARG
;
if
(
msg
->
state
<
WS_MESSAGE_STATE_INITIALIZED
)
return
WS_E_INVALID_OPERATION
;
for
(
i
=
0
;
i
<
msg
->
header_count
;
i
++
)
{
if
(
msg
->
header
[
i
]
->
type
||
msg
->
header
[
i
]
->
mapped
)
continue
;
if
(
WsXmlStringEquals
(
name
,
&
msg
->
header
[
i
]
->
name
,
NULL
)
==
S_OK
&&
WsXmlStringEquals
(
ns
,
&
msg
->
header
[
i
]
->
ns
,
NULL
)
==
S_OK
)
{
remove_header
(
msg
,
i
);
removed
=
TRUE
;
break
;
}
}
if
(
removed
)
return
write_envelope
(
msg
);
return
S_OK
;
}
dlls/webservices/tests/msg.c
View file @
1acc1b9e
...
@@ -803,6 +803,62 @@ static void test_WsAddCustomHeader(void)
...
@@ -803,6 +803,62 @@ static void test_WsAddCustomHeader(void)
WsFreeMessage
(
msg
);
WsFreeMessage
(
msg
);
}
}
static
void
test_WsRemoveCustomHeader
(
void
)
{
static
const
char
expected
[]
=
"<s:Envelope xmlns:a=
\"
http://www.w3.org/2005/08/addressing
\"
"
"xmlns:s=
\"
http://www.w3.org/2003/05/soap-envelope
\"
><s:Header>"
"<a:MessageID>urn:uuid:00000000-0000-0000-0000-000000000000</a:MessageID>"
"<test xmlns=
\"
ns
\"
>value</test></s:Header><s:Body/></s:Envelope>"
;
static
const
char
expected2
[]
=
"<s:Envelope xmlns:a=
\"
http://www.w3.org/2005/08/addressing
\"
"
"xmlns:s=
\"
http://www.w3.org/2003/05/soap-envelope
\"
><s:Header>"
"<a:MessageID>urn:uuid:00000000-0000-0000-0000-000000000000</a:MessageID>"
"</s:Header><s:Body/></s:Envelope>"
;
static
WS_XML_STRING
localname
=
{
4
,
(
BYTE
*
)
"test"
},
ns
=
{
2
,
(
BYTE
*
)
"ns"
};
static
const
WS_XML_STRING
value
=
{
5
,
(
BYTE
*
)
"value"
};
HRESULT
hr
;
WS_MESSAGE
*
msg
;
WS_ELEMENT_DESCRIPTION
desc
;
hr
=
WsRemoveCustomHeader
(
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateMessage
(
WS_ADDRESSING_VERSION_1_0
,
WS_ENVELOPE_VERSION_SOAP_1_2
,
NULL
,
0
,
&
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsRemoveCustomHeader
(
msg
,
&
localname
,
&
ns
,
NULL
);
ok
(
hr
==
WS_E_INVALID_OPERATION
,
"got %08x
\n
"
,
hr
);
hr
=
WsInitializeMessage
(
msg
,
WS_REQUEST_MESSAGE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output_header
(
msg
,
expected2
,
-
1
,
strstr
(
expected2
,
"urn:uuid:"
)
-
expected2
,
46
,
__LINE__
);
desc
.
elementLocalName
=
&
localname
;
desc
.
elementNs
=
&
ns
;
desc
.
type
=
WS_XML_STRING_TYPE
;
desc
.
typeDescription
=
NULL
;
hr
=
WsAddCustomHeader
(
msg
,
&
desc
,
WS_WRITE_REQUIRED_VALUE
,
&
value
,
sizeof
(
value
),
0
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output_header
(
msg
,
expected
,
-
1
,
strstr
(
expected
,
"urn:uuid:"
)
-
expected
,
46
,
__LINE__
);
hr
=
WsRemoveCustomHeader
(
msg
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsRemoveCustomHeader
(
msg
,
&
localname
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsRemoveCustomHeader
(
msg
,
&
localname
,
&
ns
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output_header
(
msg
,
expected2
,
-
1
,
strstr
(
expected2
,
"urn:uuid:"
)
-
expected2
,
46
,
__LINE__
);
/* again */
hr
=
WsRemoveCustomHeader
(
msg
,
&
localname
,
&
ns
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
WsFreeMessage
(
msg
);
}
START_TEST
(
msg
)
START_TEST
(
msg
)
{
{
test_WsCreateMessage
();
test_WsCreateMessage
();
...
@@ -817,4 +873,5 @@ START_TEST(msg)
...
@@ -817,4 +873,5 @@ START_TEST(msg)
test_WsAddMappedHeader
();
test_WsAddMappedHeader
();
test_WsRemoveMappedHeader
();
test_WsRemoveMappedHeader
();
test_WsAddCustomHeader
();
test_WsAddCustomHeader
();
test_WsRemoveCustomHeader
();
}
}
dlls/webservices/webservices.spec
View file @
1acc1b9e
...
@@ -127,7 +127,7 @@
...
@@ -127,7 +127,7 @@
@ stub WsReadXmlBufferFromBytes
@ stub WsReadXmlBufferFromBytes
@ stub WsReceiveMessage
@ stub WsReceiveMessage
@ stub WsRegisterOperationForCancel
@ stub WsRegisterOperationForCancel
@ st
ub WsRemoveCustomHeader
@ st
dcall WsRemoveCustomHeader(ptr ptr ptr ptr)
@ stdcall WsRemoveHeader(ptr long ptr)
@ stdcall WsRemoveHeader(ptr long ptr)
@ stdcall WsRemoveMappedHeader(ptr ptr ptr)
@ stdcall WsRemoveMappedHeader(ptr ptr ptr)
@ stub WsRemoveNode
@ stub WsRemoveNode
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment