PrepAway - Latest Free Exam Questions & Answers

Which code segment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Microsoft Windows Communication Foundation (WCF) service that exposes the following service contract. (Line numbers are included for reference only.)

<ServiceContract> _
Public Interface IBlogService
<OperationContract> _
<WebGet(ResponseFormat := WebMessageFormat.Xml)> _
Function GetBlog() As Rss20FeedFormatter
End Interface

You configure the WCF service to use the WebHttpBinding class, and to be exposed at the following URL:
http://www.contoso.com/BlogService
You need to store the result of the GetBlog operation in an XmlDocument variable named xmlBlog in a Web form.
Which code segment should you use?

PrepAway - Latest Free Exam Questions & Answers

A.
Dim url As String = "http: //www.contoso.com/BlogService/GetBlog"
Dim blogReader As XmlReader = XmlReader.Create(url)
xmlBlog.Load(blogReader)

B.
Dim url As String = "http: //www.contoso.com/BlogService"
Dim blogReader As XmlReader = XmlReader.Create(url)
xmlBlog.Load(blogReader)

C.
Dim blogUri As New Uri("http: //www.contoso.com/BlogService")
Dim blogFactory As New ChannelFactory(Of IBlogService)(blogUri)
Dim blogSrv As IBlogService = blogFactory.CreateChannel()
Dim feed As Rss20FeedFormatter = blogSrv.GetBlog()
xmlBlog.LoadXml(feed.ToString())

D.
Dim blogUri As New Uri("http: //www.contoso.com/BlogService/GetBlog")
Dim blogFactory As New ChannelFactory(Of IBlogService)(blogUri)
Dim blogSrv As IBlogService = blogFactory.CreateChannel()
Dim feed As Rss20FeedFormatter = blogSrv.GetBlog()
xmlBlog.LoadXml(feed.Feed.ToString())


Leave a Reply