Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
a8d7d1e0
Commit
a8d7d1e0
authored
Jul 23, 2022
by
Shaun Ren
Committed by
Alexandre Julliard
Aug 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Write the correct headers when a request message is addressed.
Signed-off-by:
Shaun Ren
<
sren@codeweavers.com
>
parent
86895f07
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
10 deletions
+52
-10
msg.c
dlls/webservices/msg.c
+12
-10
msg.c
dlls/webservices/tests/msg.c
+40
-0
No files found.
dlls/webservices/msg.c
View file @
a8d7d1e0
...
...
@@ -625,23 +625,25 @@ static HRESULT write_headers( struct msg *msg, WS_MESSAGE_INITIALIZATION init, W
if
((
hr
=
write_action_header
(
writer
,
prefix_env
,
ns_env
,
prefix_addr
,
ns_addr
,
msg
->
action
))
!=
S_OK
)
return
hr
;
if
(
init
==
WS_REPLY_MESSAGE
)
if
(
init
==
WS_REPLY_MESSAGE
||
init
==
WS_FAULT_MESSAGE
)
{
if
((
hr
=
write_relatesto_header
(
writer
,
prefix_env
,
ns_env
,
prefix_addr
,
ns_addr
,
&
msg
->
id_req
))
!=
S_OK
)
return
hr
;
}
else
if
(
msg
->
addr
.
length
)
{
if
((
hr
=
write_to_header
(
writer
,
prefix_env
,
ns_env
,
prefix_addr
,
ns_addr
,
&
msg
->
addr
))
!=
S_OK
)
return
hr
;
}
else
{
if
(
init
==
WS_REQUEST_MESSAGE
&&
(
hr
=
write_msgid_header
(
writer
,
prefix_env
,
ns_env
,
prefix_addr
,
ns_addr
,
&
msg
->
id
))
!=
S_OK
)
return
hr
;
if
(
init
==
WS_REQUEST_MESSAGE
)
{
if
((
hr
=
write_msgid_header
(
writer
,
prefix_env
,
ns_env
,
prefix_addr
,
ns_addr
,
&
msg
->
id
))
!=
S_OK
)
return
hr
;
if
(
msg
->
version_addr
==
WS_ADDRESSING_VERSION_0_9
&&
(
hr
=
write_replyto_header
(
writer
,
prefix_env
,
ns_env
,
prefix_addr
,
ns_addr
))
!=
S_OK
)
return
hr
;
}
if
(
msg
->
version_addr
==
WS_ADDRESSING_VERSION_0_9
&&
(
hr
=
write_replyto_header
(
writer
,
prefix_env
,
ns_env
,
prefix_addr
,
ns_addr
))
!=
S_OK
)
return
hr
;
if
(
msg
->
addr
.
length
&&
(
hr
=
write_to_header
(
writer
,
prefix_env
,
ns_env
,
prefix_addr
,
ns_addr
,
&
msg
->
addr
))
!=
S_OK
)
return
hr
;
}
for
(
i
=
0
;
i
<
msg
->
header_count
;
i
++
)
...
...
dlls/webservices/tests/msg.c
View file @
a8d7d1e0
...
...
@@ -408,10 +408,26 @@ static void test_WsWriteEnvelopeStart(void)
static
const
char
expected8
[]
=
"<s:Envelope xmlns:a=
\"
http://www.w3.org/2005/08/addressing
\"
"
"xmlns:s=
\"
http://schemas.xmlsoap.org/soap/envelope/
\"
><s:Header/><s:Body/></s:Envelope>"
;
static
const
char
expected9
[]
=
"<s:Envelope xmlns:a=
\"
http://schemas.xmlsoap.org/ws/2004/08/addressing
\"
"
"xmlns:s=
\"
http://schemas.xmlsoap.org/soap/envelope/
\"
><s:Header>"
"<a:MessageID>urn:uuid:00000000-0000-0000-0000-000000000000</a:MessageID>"
"<a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>"
"</a:ReplyTo><a:To s:mustUnderstand=
\"
1
\"
>http://localhost/</a:To></s:Header><s:Body/></s:Envelope>"
;
static
const
char
expected10
[]
=
"<s:Envelope xmlns:a=
\"
http://www.w3.org/2005/08/addressing
\"
"
"xmlns:s=
\"
http://schemas.xmlsoap.org/soap/envelope/
\"
><s:Header>"
"<a:MessageID>urn:uuid:00000000-0000-0000-0000-000000000000</a:MessageID>"
"<a:To s:mustUnderstand=
\"
1
\"
>http://localhost/</a:To></s:Header><s:Body/></s:Envelope>"
;
HRESULT
hr
;
WS_MESSAGE
*
msg
;
WS_XML_WRITER
*
writer
;
WS_MESSAGE_STATE
state
;
WS_ENDPOINT_ADDRESS
addr
;
memset
(
&
addr
,
0
,
sizeof
(
addr
)
);
addr
.
url
.
chars
=
(
WCHAR
*
)
L"http://localhost/"
;
addr
.
url
.
length
=
17
;
hr
=
WsWriteEnvelopeStart
(
NULL
,
NULL
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %#lx
\n
"
,
hr
);
...
...
@@ -509,6 +525,30 @@ static void test_WsWriteEnvelopeStart(void)
check_output_header
(
msg
,
expected8
,
-
1
,
0
,
0
,
__LINE__
);
WsFreeMessage
(
msg
);
hr
=
WsCreateMessage
(
WS_ENVELOPE_VERSION_SOAP_1_1
,
WS_ADDRESSING_VERSION_0_9
,
NULL
,
0
,
&
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
WsInitializeMessage
(
msg
,
WS_REQUEST_MESSAGE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
WsAddressMessage
(
msg
,
&
addr
,
NULL
);
hr
=
set_output
(
writer
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
WsWriteEnvelopeStart
(
msg
,
writer
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
check_output_header
(
msg
,
expected9
,
-
1
,
strstr
(
expected9
,
"urn:uuid:"
)
-
expected9
,
46
,
__LINE__
);
WsFreeMessage
(
msg
);
hr
=
WsCreateMessage
(
WS_ENVELOPE_VERSION_SOAP_1_1
,
WS_ADDRESSING_VERSION_1_0
,
NULL
,
0
,
&
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
WsInitializeMessage
(
msg
,
WS_REQUEST_MESSAGE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
WsAddressMessage
(
msg
,
&
addr
,
NULL
);
hr
=
set_output
(
writer
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
WsWriteEnvelopeStart
(
msg
,
writer
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
check_output_header
(
msg
,
expected10
,
-
1
,
strstr
(
expected10
,
"urn:uuid:"
)
-
expected10
,
46
,
__LINE__
);
WsFreeMessage
(
msg
);
hr
=
WsCreateMessage
(
WS_ENVELOPE_VERSION_SOAP_1_2
,
WS_ADDRESSING_VERSION_1_0
,
NULL
,
0
,
&
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %#lx
\n
"
,
hr
);
hr
=
WsInitializeMessage
(
msg
,
WS_REQUEST_MESSAGE
,
NULL
,
NULL
);
...
...
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