How to SEE ENTIRE XML returned from Web Service

We have a web service that takes a complex type as input and returns a complex type as output

How do we SEE the entire XML of the output?


    Private Sub BtnSend_CORS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSend_CORS.Click
        Dim svc As New SxM.Service1

        Dim CORs As New SxM.CustomerOrderRequests()

        Dim COR As New SxM.CustomerOrderRequest
        COR.CreatedBy = Me.tbCreatedBy.Text
        COR.DateCreated = Now()
        COR.MessageId = CInt(Me.tbMessageId.Text)
        COR.MessageTypeId = 0
        COR.StatusChangeAuthor = "StatusChangeAuthor"

        Dim CORCO As New SxM.CustomerOrderRequestCustomerOrder()
        CORCO.AffiliateId = 0
        CORCO.AffiliateIdSpecified = CBool(False)
        CORCO.AffiliateOrderNumber = Me.tbAffiliateOrderNumber.Text
        CORCO.CustomerOrderId = CInt(Me.tbCustomerOrderId.Text)
        CORCO.PromotionalMaterialType = "PromotionalMaterialType"

        Dim CORCOCOU As New SxM.CustomerOrderRequestCustomerOrderCustomerOrderUnit()
        CORCOCOU.Address1 = Me.tbAddress1.Text
        CORCOCOU.Address2 = "Address2"
        CORCOCOU.BillingAmount = 0
        CORCOCOU.City = "City"
        CORCOCOU.Company = Me.tbCompany.Text
        CORCOCOU.Country = "Country"

        CORCO.CustomerOrderUnit = CORCOCOU
        COR.CustomerOrder = CORCO
        CORs.CustomerOrderRequest = COR

'The response is a complex type returning an object SxM.CsiNotification
        Dim ret As SxM.CsiNotification
'Here we call the Web Service and pass in the complex CORS structure
        ret = svc.postCOU(CORs)
'Here we want to SEE the xml ... below doesn't work
        tbResponse.Text = ret.ToString()
'all I get in text box is:   Client.SxM.CsiNotification

    End Sub

I want to see the entire XML received back from the web service call

Who is Participating?
strickddConnect With a Mentor Commented:
The easiest way is to call the web service with the same inputs through a third part application (i.e., Web Service Studio or SoapUI). That will give you the raw XML.
You can enable WCF Message Logging:
'The response is a complex type returning an object SxM.CsiNotification

according to this sentence, the return is an object, check what properties are populated in that object, you may find a raw xml string too
7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

volkingAuthor Commented:
@Strickdd - I need "See" the XML in about 20 places in my code. That solution may (or may not) work, but I'll try it as a last resort.

@mansooralia - I've looked and can find nothing about XML in the objects.

@wdosanjos - Trying your suggestion now.

Thanks - Volking
volkingAuthor Commented:
@wdosanjos - Took awhile to realize, we're not using WCF. This is an OLD WebService originally written for Framework 2.0 using Visual Studio 2003. It has evolved over the years. From what I read, looks like WCF Message Logging isn't applicable.
OK. I guess your application is probably using WSE, if so the following link should work for you.

Web Services Enhancements Diagnostic Settings

      <section name="microsoft.web.services3"
               type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <trace enabled="true" 

Open in new window

Note: Give the proper access to the trace folder for the ASP.NET Machine Account (generally 'ASPNET'), otherwise it will fail to create/write the trace files.
volkingAuthor Commented:
Although clumsy, this is the only solution that worked
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.