tags:

views:

245

answers:

1

I am new to web development and WCF. I am tasked to create a WCF application/service that can be accessed by other technologies as well. Thus I ended up with basichttpbinding. I will have a XML parameter. Here is my code:

<OperationContract()> _
<WebInvoke(Method:="POST", UriTemplate:="")> _
Function ReceiveMessage( _
             ByVal input As Stream) _
As String

Public Function ReceiveMessage(ByVal input As System.IO.Stream) As String Implements IService.ReceiveMessage
    Dim rssDS As New DataSet
    Dim MsgStrHeader As String = ""

    Dim sr As New System.IO.StreamReader(input)
    rssDS.ReadXml(sr)

    For Each RssRow As DataRow In rssDS.Tables(0).Rows
        MsgStrHeader = RssRow.Item(0).ToString & " -- " & RssRow.Item(2).ToString & " Unread Messages"
    Next

    Return MsgStrHeader
End Function


Any concrete example on how do I go about this? How do I test this one? Using a simple HTML page.

A: 

There is a problem sending an XML parameter over WCF.

The easy work around is to convert the XML document to a string.

See: http://stackoverflow.com/questions/141863/is-there-an-issue-sending-xml-via-wcf

Shiraz Bhaiji