Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
8cb66987
Commit
8cb66987
authored
Jul 08, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Jul 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Implement WsWriteBody.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
485c9722
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
1 deletion
+120
-1
msg.c
dlls/webservices/msg.c
+26
-0
msg.c
dlls/webservices/tests/msg.c
+93
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
No files found.
dlls/webservices/msg.c
View file @
8cb66987
...
...
@@ -453,3 +453,29 @@ HRESULT WINAPI WsWriteEnvelopeEnd( WS_MESSAGE *handle, WS_ERROR *error )
msg
->
state
=
WS_MESSAGE_STATE_DONE
;
return
S_OK
;
}
/**************************************************************************
* WsWriteBody [webservices.@]
*/
HRESULT
WINAPI
WsWriteBody
(
WS_MESSAGE
*
handle
,
const
WS_ELEMENT_DESCRIPTION
*
desc
,
WS_WRITE_OPTION
option
,
const
void
*
value
,
ULONG
size
,
WS_ERROR
*
error
)
{
struct
msg
*
msg
=
(
struct
msg
*
)
handle
;
HRESULT
hr
;
TRACE
(
"%p %p %08x %p %u %p
\n
"
,
handle
,
desc
,
option
,
value
,
size
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
handle
||
!
desc
)
return
E_INVALIDARG
;
if
(
msg
->
state
!=
WS_MESSAGE_STATE_WRITING
)
return
WS_E_INVALID_OPERATION
;
if
(
desc
->
elementLocalName
&&
(
hr
=
WsWriteStartElement
(
msg
->
writer_body
,
NULL
,
desc
->
elementLocalName
,
desc
->
elementNs
,
NULL
))
!=
S_OK
)
return
hr
;
if
((
hr
=
WsWriteType
(
msg
->
writer_body
,
WS_ANY_ELEMENT_TYPE_MAPPING
,
desc
->
type
,
desc
->
typeDescription
,
option
,
value
,
size
,
NULL
))
!=
S_OK
)
return
hr
;
if
(
desc
->
elementLocalName
)
hr
=
WsWriteEndElement
(
msg
->
writer_body
,
NULL
);
return
hr
;
}
dlls/webservices/tests/msg.c
View file @
8cb66987
...
...
@@ -431,6 +431,98 @@ static void test_WsWriteEnvelopeEnd(void)
WsFreeWriter
(
writer
);
}
static
void
test_WsWriteBody
(
void
)
{
static
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>"
"</s:Header><s:Body><u xmlns=
\"
ns
\"
><val>1</val></u></s:Body></s:Envelope>"
;
static
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>"
;
WS_XML_STRING
localname
=
{
1
,
(
BYTE
*
)
"t"
},
localname2
=
{
1
,
(
BYTE
*
)
"u"
};
WS_XML_STRING
val
=
{
3
,
(
BYTE
*
)
"val"
},
ns
=
{
2
,
(
BYTE
*
)
"ns"
};
HRESULT
hr
;
WS_MESSAGE
*
msg
;
WS_XML_WRITER
*
writer
;
WS_MESSAGE_STATE
state
;
WS_ELEMENT_DESCRIPTION
desc
;
WS_STRUCT_DESCRIPTION
s
;
WS_FIELD_DESCRIPTION
f
,
*
fields
[
1
];
struct
test
{
UINT32
val
;
}
test
,
*
ptr
;
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
=
WsInitializeMessage
(
msg
,
WS_REQUEST_MESSAGE
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateWriter
(
NULL
,
0
,
&
writer
,
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
);
hr
=
WsWriteBody
(
NULL
,
NULL
,
0
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsWriteBody
(
msg
,
NULL
,
0
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
memset
(
&
f
,
0
,
sizeof
(
f
)
);
f
.
mapping
=
WS_ELEMENT_FIELD_MAPPING
;
f
.
localName
=
&
val
;
f
.
ns
=
&
ns
;
f
.
type
=
WS_UINT32_TYPE
;
fields
[
0
]
=
&
f
;
memset
(
&
s
,
0
,
sizeof
(
s
)
);
s
.
size
=
sizeof
(
struct
test
);
s
.
alignment
=
TYPE_ALIGNMENT
(
struct
test
);
s
.
fields
=
fields
;
s
.
fieldCount
=
1
;
s
.
typeLocalName
=
&
localname
;
s
.
typeNs
=
&
ns
;
desc
.
elementLocalName
=
&
localname2
;
desc
.
elementNs
=
&
ns
;
desc
.
type
=
WS_STRUCT_TYPE
;
desc
.
typeDescription
=
&
s
;
ptr
=
&
test
;
test
.
val
=
1
;
hr
=
WsWriteBody
(
msg
,
&
desc
,
WS_WRITE_REQUIRED_POINTER
,
&
ptr
,
sizeof
(
ptr
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
expected
,
240
,
strstr
(
expected
,
"urn:uuid:"
)
-
expected
,
46
,
__LINE__
);
check_output_header
(
msg
,
expected2
,
-
1
,
strstr
(
expected2
,
"urn:uuid:"
)
-
expected2
,
46
,
__LINE__
);
state
=
0xdeadbeef
;
hr
=
WsGetMessageProperty
(
msg
,
WS_MESSAGE_PROPERTY_STATE
,
&
state
,
sizeof
(
state
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
WS_MESSAGE_STATE_WRITING
,
"got %u
\n
"
,
state
);
hr
=
WsWriteEnvelopeEnd
(
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
check_output
(
writer
,
expected
,
-
1
,
strstr
(
expected
,
"urn:uuid:"
)
-
expected
,
46
,
__LINE__
);
check_output_header
(
msg
,
expected2
,
-
1
,
strstr
(
expected2
,
"urn:uuid:"
)
-
expected2
,
46
,
__LINE__
);
hr
=
WsWriteBody
(
msg
,
&
desc
,
WS_WRITE_REQUIRED_POINTER
,
&
ptr
,
sizeof
(
ptr
),
NULL
);
ok
(
hr
==
WS_E_INVALID_OPERATION
,
"got %08x
\n
"
,
hr
);
WsFreeMessage
(
msg
);
WsFreeWriter
(
writer
);
}
START_TEST
(
msg
)
{
test_WsCreateMessage
();
...
...
@@ -439,4 +531,5 @@ START_TEST(msg)
test_WsAddressMessage
();
test_WsWriteEnvelopeStart
();
test_WsWriteEnvelopeEnd
();
test_WsWriteBody
();
}
dlls/webservices/webservices.spec
View file @
8cb66987
...
...
@@ -166,7 +166,7 @@
@ stub WsVerifyXmlNCName
@ stub WsWriteArray
@ stdcall WsWriteAttribute(ptr ptr long ptr long ptr)
@ st
ub WsWriteBody
@ st
dcall WsWriteBody(ptr ptr long ptr long ptr)
@ stub WsWriteBytes
@ stub WsWriteChars
@ stub WsWriteCharsUtf8
...
...
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