T
Tony C
I have played with XML Web Services for a while now and can get them
working with simple parameters such as integers and strings but now I
want to do something more complicated and I have become stuck. The
SOAP request below is going to be posted to my Web Service. The format
of the XML is such that there will be many <Command> elements for all
the different pieces and there moves.
Example SOAP Request
====================
<soap:Envelope>
<soap:Body>
<Player xmlns="http://tempuri.org/chess">
<Information>
<PlayerID>D345B</PlayerID>
<PlayerName>Barney Smith</PlayerName>
</Information>
<Commands>
<Command CurPos="B6" NewPos="D6" Colour"White">ROOK</Command>
<Command CurPos="D1" NewPos="A4" Colour"White">QUEEN</Command>
<Command CurPos="F1" NewPos="E4"
Colour"White">KNIGHT</Command>
</Commands>
</Player>
</soap:Body>
</soap:Envelope>
My intention is to parse the XML coming into the Web Service and place
each of the players moves into a table in a SQL Server database.
Question: "What would the signature of the Web Service need to be to
accept this reponse?"
I have done some looking and I have seen references to a Type called
XMLNodeKey or something, that can hold an XML document minus all the
declaritive stuff. This would give me a signature of:
AcceptMove(ByVal XMLPlayerMove as XMLNodeKey) as Integer
if this is correct then fine. but I cant see how I can then treat this
as an XMLDocument and pick out all the relevant stuff.
Maybe somebody out there as done this before, and could help. The
database stuff i can handle its just the signature of the Web Service
and some example code of how to extract the data from the XML that I
need.
I would really appreciate if anyone out there could help me, as i
think Im gonna go mad.
Cheers
working with simple parameters such as integers and strings but now I
want to do something more complicated and I have become stuck. The
SOAP request below is going to be posted to my Web Service. The format
of the XML is such that there will be many <Command> elements for all
the different pieces and there moves.
Example SOAP Request
====================
<soap:Envelope>
<soap:Body>
<Player xmlns="http://tempuri.org/chess">
<Information>
<PlayerID>D345B</PlayerID>
<PlayerName>Barney Smith</PlayerName>
</Information>
<Commands>
<Command CurPos="B6" NewPos="D6" Colour"White">ROOK</Command>
<Command CurPos="D1" NewPos="A4" Colour"White">QUEEN</Command>
<Command CurPos="F1" NewPos="E4"
Colour"White">KNIGHT</Command>
</Commands>
</Player>
</soap:Body>
</soap:Envelope>
My intention is to parse the XML coming into the Web Service and place
each of the players moves into a table in a SQL Server database.
Question: "What would the signature of the Web Service need to be to
accept this reponse?"
I have done some looking and I have seen references to a Type called
XMLNodeKey or something, that can hold an XML document minus all the
declaritive stuff. This would give me a signature of:
AcceptMove(ByVal XMLPlayerMove as XMLNodeKey) as Integer
if this is correct then fine. but I cant see how I can then treat this
as an XMLDocument and pick out all the relevant stuff.
Maybe somebody out there as done this before, and could help. The
database stuff i can handle its just the signature of the Web Service
and some example code of how to extract the data from the XML that I
need.
I would really appreciate if anyone out there could help me, as i
think Im gonna go mad.
Cheers