K
Keith Chadwick
Using MSXML2.XMLHTTP to create a soap package that contains xml in the body
which works perfectly well. But in the web service no matter WHAT I do in
my service to reference the passed xmlnode it returns object not set to an
instance of the node.
This is the soap package I am sending to the service.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header></soap:Header>
<soap:Body>
<submitContact xmlns="evententerprise">
<data>
<contact address="asdfasdfasdf">
<Test>this is a test</Test>
</contact>
</data>
</submitContact>
</soap:Body>
</soap:Envelope>
My web service basically is as follows:
<WebMethod(EnableSession:=True)> _
Public Function submitContact(ByVal data As XmlNode) As String
Dim result As String
Dim xe As XmlElement
Try
xe = data.SelectSingleNode("//Test")
result = xe.Value
Catch ex As Exception
result = ex.Message
End Try
Return result
End Function
I have even tried place the data.outerXml into a new xmldocument and trying
to reference that but no go. No matter what I do it comes back with the
exception message 'Object reference not set to an instance of an object'
Please help am going nuts trying to figure out what is going on!!
Cheers
Keith
which works perfectly well. But in the web service no matter WHAT I do in
my service to reference the passed xmlnode it returns object not set to an
instance of the node.
This is the soap package I am sending to the service.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header></soap:Header>
<soap:Body>
<submitContact xmlns="evententerprise">
<data>
<contact address="asdfasdfasdf">
<Test>this is a test</Test>
</contact>
</data>
</submitContact>
</soap:Body>
</soap:Envelope>
My web service basically is as follows:
<WebMethod(EnableSession:=True)> _
Public Function submitContact(ByVal data As XmlNode) As String
Dim result As String
Dim xe As XmlElement
Try
xe = data.SelectSingleNode("//Test")
result = xe.Value
Catch ex As Exception
result = ex.Message
End Try
Return result
End Function
I have even tried place the data.outerXml into a new xmldocument and trying
to reference that but no go. No matter what I do it comes back with the
exception message 'Object reference not set to an instance of an object'
Please help am going nuts trying to figure out what is going on!!
Cheers
Keith