By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,723 Members | 1,147 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,723 IT Pros & Developers. It's quick & easy.

facing problem to "Calling dotnet created Web Services in VB6"

P: n/a
I am facing a problem while reading the result which is loaded in DOMDocument.
In which I am sending a request to web service and getting a record of
Single Order.
This is my VB Code which is i am using....
.........................
Dim Connector As SoapConnector30 ' To connect to webservice
Dim Serializer As SoapSerializer30 ' To serialize the XML data
Dim Reader As SoapReader30 ' To read the Webservice
response data

Dim domResult As New MSXML2.DOMDocument
Dim ResultElm As IXMLDOMElement ' To store the Webservice
response in DOM
Dim FaultElm As IXMLDOMElement ' for Error handling

Dim END_POINT_URL As String ' URL of the Webservice to call
Dim SoapAction As String
Dim CALC_NS As String

Dim objNodeList As IXMLDOMNodeList

END_POINT_URL = "http://localhost/webservicesserver/UsingDataSet.asmx"
'SoapAction = "UsingDataSetNameSpace/GetCustomerByArray"
SoapAction = "UsingDataSetNameSpace/GetRecord"
CALC_NS = "UsingDataSetNameSpace"

'To Connect webservice
Set Connector = New HttpConnector30
Connector.Property("EndPointURL") = END_POINT_URL
Connector.Connect
' binding/operation/soapoperation
Connector.Property("SoapAction") = SoapAction '& Method
Connector.BeginMessage

'Preapare the SOAP Request
Set Serializer = New SoapSerializer30
Serializer.Init Connector.InputStream

Serializer.StartEnvelope
Serializer.StartBody
Serializer.StartElement Method, CALC_NS ' Setting Method name

Serializer.EndElement

Serializer.EndBody
Serializer.EndEnvelope

Connector.EndMessage ' This statement actually send the data to
webservice

'Reading Webservice Response
Set Reader = New SoapReader30
Reader.Load Connector.OutputStream

If Not Reader.Fault Is Nothing Then
MsgBox Reader.FaultString.Text, vbExclamation ' In case of Error
Else
Set ResultElm = Reader.RpcResult ' Response come as XML document
Set domResult = Reader.Dom
End If

'MsgBox domResult.xml

'MsgBox ResultElm.xml

MsgBox domResult.getElementsByTagName("GetRecordResult"). length

Dim i As Integer
For i = 0 To domResult.getElementsByTagName("GetRecordResult"). length - 1
MsgBox
domResult.getElementsByTagName("GetRecordResult"). Item(0).nodeName
Next

End Sub
.........................................

My Request in xml format ot Web Services is....

<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAPSDK4:GetRecord
xmlns:SOAPSDK4="http://localhost/webservicesserver/UsingDataSetNameSpace/GetRecord"/></SOAP-ENV:Body></SOAP-ENV:Envelope>

My Web Service Response is...

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetRecordResponse
xmlns="http://localhost/webservicesserver/UsingDataSetNameSpace"><GetRecordResult orderId="60823"
productCd="MBFX" carrierCd="CONC" statusCd="ACTV"
/></GetRecordResponse></soap:Body></soap:Envelope>
I am unable to read DOMDocument by getElementsByTagName...

Thanks in advance for your Reply....
Nov 2 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You might want to post this question in a vb6 related newsgroup.
What ever created the webservice (.NET or not), is irrelevant to the client.
The soap received is what matters, and as long as this comlies with the soap
standard, you ought to be fine.
--
rgds.
/Claus Konrad
MCSD.NET (C#)
"rakesh kumawat" wrote:
I am facing a problem while reading the result which is loaded in DOMDocument.
In which I am sending a request to web service and getting a record of
Single Order.
This is my VB Code which is i am using....
........................
Dim Connector As SoapConnector30 ' To connect to webservice
Dim Serializer As SoapSerializer30 ' To serialize the XML data
Dim Reader As SoapReader30 ' To read the Webservice
response data

Dim domResult As New MSXML2.DOMDocument
Dim ResultElm As IXMLDOMElement ' To store the Webservice
response in DOM
Dim FaultElm As IXMLDOMElement ' for Error handling

Dim END_POINT_URL As String ' URL of the Webservice to call
Dim SoapAction As String
Dim CALC_NS As String

Dim objNodeList As IXMLDOMNodeList

END_POINT_URL = "http://localhost/webservicesserver/UsingDataSet.asmx"
'SoapAction = "UsingDataSetNameSpace/GetCustomerByArray"
SoapAction = "UsingDataSetNameSpace/GetRecord"
CALC_NS = "UsingDataSetNameSpace"

'To Connect webservice
Set Connector = New HttpConnector30
Connector.Property("EndPointURL") = END_POINT_URL
Connector.Connect
' binding/operation/soapoperation
Connector.Property("SoapAction") = SoapAction '& Method
Connector.BeginMessage

'Preapare the SOAP Request
Set Serializer = New SoapSerializer30
Serializer.Init Connector.InputStream

Serializer.StartEnvelope
Serializer.StartBody
Serializer.StartElement Method, CALC_NS ' Setting Method name

Serializer.EndElement

Serializer.EndBody
Serializer.EndEnvelope

Connector.EndMessage ' This statement actually send the data to
webservice

'Reading Webservice Response
Set Reader = New SoapReader30
Reader.Load Connector.OutputStream

If Not Reader.Fault Is Nothing Then
MsgBox Reader.FaultString.Text, vbExclamation ' In case of Error
Else
Set ResultElm = Reader.RpcResult ' Response come as XML document
Set domResult = Reader.Dom
End If

'MsgBox domResult.xml

'MsgBox ResultElm.xml

MsgBox domResult.getElementsByTagName("GetRecordResult"). length

Dim i As Integer
For i = 0 To domResult.getElementsByTagName("GetRecordResult"). length - 1
MsgBox
domResult.getElementsByTagName("GetRecordResult"). Item(0).nodeName
Next

End Sub
........................................

My Request in xml format ot Web Services is....

<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAPSDK4:GetRecord
xmlns:SOAPSDK4="http://localhost/webservicesserver/UsingDataSetNameSpace/GetRecord"/></SOAP-ENV:Body></SOAP-ENV:Envelope>

My Web Service Response is...

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetRecordResponse
xmlns="http://localhost/webservicesserver/UsingDataSetNameSpace"><GetRecordResult orderId="60823"
productCd="MBFX" carrierCd="CONC" statusCd="ACTV"
/></GetRecordResponse></soap:Body></soap:Envelope>
I am unable to read DOMDocument by getElementsByTagName...

Thanks in advance for your Reply....
Nov 2 '06 #2

P: n/a
By the way:
If you can not make this work, how about creating the proxy in a .NET
language and expose this assembly as a COM component? This allows you to make
use of the VS.NET embedded support for generating proxies and the relative
ease to create the communication.

When instantiating this component from vb6, you ought to use it like this:
dim proxy as SomeProxy = new SomeProxy()
proxy.CallMethod(arguments...)

--
rgds.
/Claus Konrad
MCSD.NET (C#)
"rakesh kumawat" wrote:
I am facing a problem while reading the result which is loaded in DOMDocument.
In which I am sending a request to web service and getting a record of
Single Order.
This is my VB Code which is i am using....
........................
Dim Connector As SoapConnector30 ' To connect to webservice
Dim Serializer As SoapSerializer30 ' To serialize the XML data
Dim Reader As SoapReader30 ' To read the Webservice
response data

Dim domResult As New MSXML2.DOMDocument
Dim ResultElm As IXMLDOMElement ' To store the Webservice
response in DOM
Dim FaultElm As IXMLDOMElement ' for Error handling

Dim END_POINT_URL As String ' URL of the Webservice to call
Dim SoapAction As String
Dim CALC_NS As String

Dim objNodeList As IXMLDOMNodeList

END_POINT_URL = "http://localhost/webservicesserver/UsingDataSet.asmx"
'SoapAction = "UsingDataSetNameSpace/GetCustomerByArray"
SoapAction = "UsingDataSetNameSpace/GetRecord"
CALC_NS = "UsingDataSetNameSpace"

'To Connect webservice
Set Connector = New HttpConnector30
Connector.Property("EndPointURL") = END_POINT_URL
Connector.Connect
' binding/operation/soapoperation
Connector.Property("SoapAction") = SoapAction '& Method
Connector.BeginMessage

'Preapare the SOAP Request
Set Serializer = New SoapSerializer30
Serializer.Init Connector.InputStream

Serializer.StartEnvelope
Serializer.StartBody
Serializer.StartElement Method, CALC_NS ' Setting Method name

Serializer.EndElement

Serializer.EndBody
Serializer.EndEnvelope

Connector.EndMessage ' This statement actually send the data to
webservice

'Reading Webservice Response
Set Reader = New SoapReader30
Reader.Load Connector.OutputStream

If Not Reader.Fault Is Nothing Then
MsgBox Reader.FaultString.Text, vbExclamation ' In case of Error
Else
Set ResultElm = Reader.RpcResult ' Response come as XML document
Set domResult = Reader.Dom
End If

'MsgBox domResult.xml

'MsgBox ResultElm.xml

MsgBox domResult.getElementsByTagName("GetRecordResult"). length

Dim i As Integer
For i = 0 To domResult.getElementsByTagName("GetRecordResult"). length - 1
MsgBox
domResult.getElementsByTagName("GetRecordResult"). Item(0).nodeName
Next

End Sub
........................................

My Request in xml format ot Web Services is....

<?xml version="1.0" encoding="UTF-8" standalone="no"?><SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAPSDK4:GetRecord
xmlns:SOAPSDK4="http://localhost/webservicesserver/UsingDataSetNameSpace/GetRecord"/></SOAP-ENV:Body></SOAP-ENV:Envelope>

My Web Service Response is...

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetRecordResponse
xmlns="http://localhost/webservicesserver/UsingDataSetNameSpace"><GetRecordResult orderId="60823"
productCd="MBFX" carrierCd="CONC" statusCd="ACTV"
/></GetRecordResponse></soap:Body></soap:Envelope>
I am unable to read DOMDocument by getElementsByTagName...

Thanks in advance for your Reply....
Nov 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.