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
23a64ca0
Commit
23a64ca0
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 WsReadBody.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6b583f93
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
110 additions
and
1 deletion
+110
-1
msg.c
dlls/webservices/msg.c
+17
-0
msg.c
dlls/webservices/tests/msg.c
+90
-0
webservices.spec
dlls/webservices/webservices.spec
+1
-1
webservices.h
include/webservices.h
+2
-0
No files found.
dlls/webservices/msg.c
View file @
23a64ca0
...
...
@@ -616,6 +616,23 @@ HRESULT WINAPI WsReadEnvelopeEnd( WS_MESSAGE *handle, WS_ERROR *error )
}
/**************************************************************************
* WsReadBody [webservices.@]
*/
HRESULT
WINAPI
WsReadBody
(
WS_MESSAGE
*
handle
,
const
WS_ELEMENT_DESCRIPTION
*
desc
,
WS_READ_OPTION
option
,
WS_HEAP
*
heap
,
void
*
value
,
ULONG
size
,
WS_ERROR
*
error
)
{
struct
msg
*
msg
=
(
struct
msg
*
)
handle
;
TRACE
(
"%p %p %08x %p %p %u %p
\n
"
,
handle
,
desc
,
option
,
heap
,
value
,
size
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
handle
||
!
desc
)
return
E_INVALIDARG
;
if
(
msg
->
state
!=
WS_MESSAGE_STATE_READING
)
return
WS_E_INVALID_OPERATION
;
return
WsReadElement
(
msg
->
reader_body
,
desc
,
option
,
heap
,
value
,
size
,
NULL
);
}
/**************************************************************************
* WsInitializeMessage [webservices.@]
*/
HRESULT
WINAPI
WsInitializeMessage
(
WS_MESSAGE
*
handle
,
WS_MESSAGE_INITIALIZATION
init
,
...
...
dlls/webservices/tests/msg.c
View file @
23a64ca0
...
...
@@ -962,6 +962,95 @@ static void test_WsReadEnvelopeEnd(void)
WsFreeReader
(
reader
);
}
static
void
test_WsReadBody
(
void
)
{
static
const
char
xml
[]
=
"<s:Envelope xmlns:s=
\"
http://schemas.xmlsoap.org/soap/envelope/
\"
><s:Body>"
"<u xmlns=
\"
ns
\"
><val>1</val></u></s:Body></s:Envelope>"
;
WS_HEAP
*
heap
;
WS_MESSAGE
*
msg
,
*
msg2
;
WS_XML_READER
*
reader
;
WS_MESSAGE_STATE
state
;
WS_XML_STRING
localname
=
{
1
,
(
BYTE
*
)
"t"
},
localname2
=
{
1
,
(
BYTE
*
)
"u"
};
WS_XML_STRING
val
=
{
3
,
(
BYTE
*
)
"val"
},
ns
=
{
2
,
(
BYTE
*
)
"ns"
};
WS_ELEMENT_DESCRIPTION
desc
;
WS_STRUCT_DESCRIPTION
s
;
WS_FIELD_DESCRIPTION
f
,
*
fields
[
1
];
struct
test
{
UINT32
val
;
}
test
;
HRESULT
hr
;
hr
=
WsCreateHeap
(
1
<<
16
,
0
,
NULL
,
0
,
&
heap
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadBody
(
NULL
,
NULL
,
0
,
NULL
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateMessage
(
WS_ADDRESSING_VERSION_0_9
,
WS_ENVELOPE_VERSION_SOAP_1_1
,
NULL
,
0
,
&
msg
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsCreateReader
(
NULL
,
0
,
&
reader
,
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
=
WsCreateMessage
(
WS_ADDRESSING_VERSION_0_9
,
WS_ENVELOPE_VERSION_SOAP_1_1
,
NULL
,
0
,
&
msg2
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadBody
(
msg2
,
NULL
,
0
,
NULL
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
set_input
(
reader
,
xml
,
strlen
(
xml
)
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadEnvelopeStart
(
msg2
,
reader
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsReadBody
(
msg2
,
NULL
,
WS_READ_REQUIRED_VALUE
,
heap
,
&
test
,
sizeof
(
test
),
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
;
memset
(
&
test
,
0
,
sizeof
(
test
)
);
hr
=
WsReadBody
(
msg2
,
&
desc
,
WS_READ_REQUIRED_VALUE
,
heap
,
&
test
,
sizeof
(
test
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
test
.
val
==
1
,
"got %u
\n
"
,
test
.
val
);
state
=
0xdeadbeef
;
hr
=
WsGetMessageProperty
(
msg2
,
WS_MESSAGE_PROPERTY_STATE
,
&
state
,
sizeof
(
state
),
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
state
==
WS_MESSAGE_STATE_READING
,
"got %u
\n
"
,
state
);
hr
=
WsReadEnvelopeEnd
(
msg2
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
WsFreeMessage
(
msg
);
WsFreeMessage
(
msg2
);
WsFreeReader
(
reader
);
WsFreeHeap
(
heap
);
}
START_TEST
(
msg
)
{
test_WsCreateMessage
();
...
...
@@ -979,4 +1068,5 @@ START_TEST(msg)
test_WsRemoveCustomHeader
();
test_WsReadEnvelopeStart
();
test_WsReadEnvelopeEnd
();
test_WsReadBody
();
}
dlls/webservices/webservices.spec
View file @
23a64ca0
...
...
@@ -103,7 +103,7 @@
@ stub WsPushBytes
@ stub WsReadArray
@ stub WsReadAttribute
@ st
ub WsReadBody
@ st
dcall WsReadBody(ptr ptr long ptr ptr long ptr)
@ stub WsReadBytes
@ stub WsReadChars
@ stub WsReadCharsUtf8
...
...
include/webservices.h
View file @
23a64ca0
...
...
@@ -1440,6 +1440,8 @@ HRESULT WINAPI WsOpenServiceProxy(WS_SERVICE_PROXY*, const WS_ENDPOINT_ADDRESS*,
WS_ERROR
*
);
HRESULT
WINAPI
WsReadAttribute
(
WS_XML_READER
*
,
const
WS_ATTRIBUTE_DESCRIPTION
*
,
WS_READ_OPTION
,
WS_HEAP
*
,
void
*
,
ULONG
,
WS_ERROR
*
);
HRESULT
WINAPI
WsReadBody
(
WS_MESSAGE
*
,
const
WS_ELEMENT_DESCRIPTION
*
,
WS_READ_OPTION
,
WS_HEAP
*
,
void
*
,
ULONG
,
WS_ERROR
*
);
HRESULT
WINAPI
WsReadElement
(
WS_XML_READER
*
,
const
WS_ELEMENT_DESCRIPTION
*
,
WS_READ_OPTION
,
WS_HEAP
*
,
void
*
,
ULONG
,
WS_ERROR
*
);
HRESULT
WINAPI
WsReadEndAttribute
(
WS_XML_READER
*
,
WS_ERROR
*
);
...
...
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