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
0f227b22
Commit
0f227b22
authored
Aug 16, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WS_ADDRESSING_VERSION_TRANSPORT.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ac42d701
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
6 deletions
+32
-6
msg.c
dlls/webservices/msg.c
+15
-6
msg.c
dlls/webservices/tests/msg.c
+17
-0
No files found.
dlls/webservices/msg.c
View file @
0f227b22
...
@@ -349,6 +349,11 @@ static HRESULT get_addr_namespace( WS_ADDRESSING_VERSION ver, WS_XML_STRING *str
...
@@ -349,6 +349,11 @@ static HRESULT get_addr_namespace( WS_ADDRESSING_VERSION ver, WS_XML_STRING *str
str
->
length
=
sizeof
(
ns_addr_1_0
)
/
sizeof
(
ns_addr_1_0
[
0
])
-
1
;
str
->
length
=
sizeof
(
ns_addr_1_0
)
/
sizeof
(
ns_addr_1_0
[
0
])
-
1
;
return
S_OK
;
return
S_OK
;
case
WS_ADDRESSING_VERSION_TRANSPORT
:
str
->
bytes
=
NULL
;
str
->
length
=
0
;
return
S_OK
;
default:
default:
ERR
(
"unhandled addressing version %u
\n
"
,
ver
);
ERR
(
"unhandled addressing version %u
\n
"
,
ver
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
...
@@ -409,14 +414,18 @@ static HRESULT write_envelope_start( struct msg *msg, WS_XML_WRITER *writer )
...
@@ -409,14 +414,18 @@ static HRESULT write_envelope_start( struct msg *msg, WS_XML_WRITER *writer )
if
((
hr
=
get_addr_namespace
(
msg
->
version_addr
,
&
ns_addr
))
!=
S_OK
)
return
hr
;
if
((
hr
=
get_addr_namespace
(
msg
->
version_addr
,
&
ns_addr
))
!=
S_OK
)
return
hr
;
if
((
hr
=
WsWriteStartElement
(
writer
,
&
prefix_s
,
&
envelope
,
&
ns_env
,
NULL
))
!=
S_OK
)
return
hr
;
if
((
hr
=
WsWriteStartElement
(
writer
,
&
prefix_s
,
&
envelope
,
&
ns_env
,
NULL
))
!=
S_OK
)
return
hr
;
if
((
hr
=
WsWriteXmlnsAttribute
(
writer
,
&
prefix_a
,
&
ns_addr
,
FALSE
,
NULL
))
!=
S_OK
)
return
hr
;
if
(
msg
->
version_addr
<
WS_ADDRESSING_VERSION_TRANSPORT
&&
(
hr
=
WsWriteXmlnsAttribute
(
writer
,
&
prefix_a
,
&
ns_addr
,
FALSE
,
NULL
))
!=
S_OK
)
return
hr
;
if
((
hr
=
WsWriteStartElement
(
writer
,
&
prefix_s
,
&
header
,
&
ns_env
,
NULL
))
!=
S_OK
)
return
hr
;
if
((
hr
=
WsWriteStartElement
(
writer
,
&
prefix_s
,
&
header
,
&
ns_env
,
NULL
))
!=
S_OK
)
return
hr
;
if
((
hr
=
WsWriteStartElement
(
writer
,
&
prefix_a
,
&
msgid
,
&
ns_addr
,
NULL
))
!=
S_OK
)
return
hr
;
urn
.
text
.
textType
=
WS_XML_TEXT_TYPE_UNIQUE_ID
;
if
(
msg
->
version_addr
<
WS_ADDRESSING_VERSION_TRANSPORT
)
memcpy
(
&
urn
.
value
,
&
msg
->
id
,
sizeof
(
msg
->
id
)
);
{
if
((
hr
=
WsWriteText
(
writer
,
&
urn
.
text
,
NULL
))
!=
S_OK
)
return
hr
;
if
((
hr
=
WsWriteStartElement
(
writer
,
&
prefix_a
,
&
msgid
,
&
ns_addr
,
NULL
))
!=
S_OK
)
return
hr
;
if
((
hr
=
WsWriteEndElement
(
writer
,
NULL
))
!=
S_OK
)
return
hr
;
/* </a:MessageID> */
urn
.
text
.
textType
=
WS_XML_TEXT_TYPE_UNIQUE_ID
;
memcpy
(
&
urn
.
value
,
&
msg
->
id
,
sizeof
(
msg
->
id
)
);
if
((
hr
=
WsWriteText
(
writer
,
&
urn
.
text
,
NULL
))
!=
S_OK
)
return
hr
;
if
((
hr
=
WsWriteEndElement
(
writer
,
NULL
))
!=
S_OK
)
return
hr
;
/* </a:MessageID> */
}
for
(
i
=
0
;
i
<
msg
->
header_count
;
i
++
)
for
(
i
=
0
;
i
<
msg
->
header_count
;
i
++
)
{
{
...
...
dlls/webservices/tests/msg.c
View file @
0f227b22
...
@@ -339,6 +339,8 @@ static void test_WsWriteEnvelopeStart(void)
...
@@ -339,6 +339,8 @@ static void test_WsWriteEnvelopeStart(void)
"<a:MessageID>urn:uuid:00000000-0000-0000-0000-000000000000</a:MessageID>"
"<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:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address>"
"</a:ReplyTo></s:Header><s:Body/></s:Envelope>"
;
"</a:ReplyTo></s:Header><s:Body/></s:Envelope>"
;
static
const
char
expected3
[]
=
"<s:Envelope xmlns:s=
\"
http://schemas.xmlsoap.org/soap/envelope/
\"
><s:Header/><s:Body/></s:Envelope>"
;
HRESULT
hr
;
HRESULT
hr
;
WS_MESSAGE
*
msg
;
WS_MESSAGE
*
msg
;
WS_XML_WRITER
*
writer
;
WS_XML_WRITER
*
writer
;
...
@@ -375,6 +377,21 @@ static void test_WsWriteEnvelopeStart(void)
...
@@ -375,6 +377,21 @@ static void test_WsWriteEnvelopeStart(void)
hr
=
WsGetMessageProperty
(
msg
,
WS_MESSAGE_PROPERTY_STATE
,
&
state
,
sizeof
(
state
),
NULL
);
hr
=
WsGetMessageProperty
(
msg
,
WS_MESSAGE_PROPERTY_STATE
,
&
state
,
sizeof
(
state
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
WS_MESSAGE_STATE_WRITING
,
"got %u
\n
"
,
state
);
ok
(
state
==
WS_MESSAGE_STATE_WRITING
,
"got %u
\n
"
,
state
);
WsFreeMessage
(
msg
);
hr
=
WsCreateMessage
(
WS_ENVELOPE_VERSION_SOAP_1_1
,
WS_ADDRESSING_VERSION_TRANSPORT
,
NULL
,
0
,
&
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsInitializeMessage
(
msg
,
WS_REQUEST_MESSAGE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
set_output
(
writer
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsWriteEnvelopeStart
(
msg
,
writer
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output_header
(
msg
,
expected3
,
-
1
,
0
,
0
,
__LINE__
);
WsFreeMessage
(
msg
);
WsFreeMessage
(
msg
);
WsFreeWriter
(
writer
);
WsFreeWriter
(
writer
);
...
...
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