Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8914

Remove SOAP Envelope

$
0
0

Hi,

I copy the code of removing SOAP envelope in SAP, but I am having error on

d.LoadXml(xmlD.FirstChild.NextSibling.FirstChild.FirstChild.InnerXml)

Error:Object reference not set to an instance of an object.

this is my code

 

Public Function RemoveEnv(ByVal xmlD As Xml.XmlDocument) As Xml.XmlDocument

        Dim d As Xml.XmlDocument

        'Dim s As String

 

 

        d = New Xml.XmlDocument

        If InStr(xmlD.InnerXml, "<env:Fault>") Then

            Return xmlD

        Else

            's = xmlD.FirstChild.NextSibling.FirstChild.FirstChild.InnerXml

            d.LoadXml(xmlD.FirstChild.NextSibling.FirstChild.FirstChild.InnerXml)

        End If

 

 

        Return d

    End Function

 

 

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

 

 

        Dim doc As New Xml.XmlDocument

        doc.Load("C:\temp1.xml")

        RemoveEnv(doc)

        doc.Save("C:\youfile.xml")

    

    End Sub

 

Thanks,

Raphael


Viewing all articles
Browse latest Browse all 8914

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>