473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
2 4647
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: asj | last post by:
from the borg lady: http://www.freeroller.net/page/Sayaka/20030819#walmart_deadline_shows_java_cashing ------------------------------------------------- I/We read with interest Walmart's new...
4
by: Jerry Krinock | last post by:
I've written the following demo to help me understand a problem I'm having in a larger program. The "main" function constructs a Foo object, and then later "reconstructs" it by calling the...
3
by: Summit | last post by:
Does anyone know what the C# equivalent for VB6 End is? I'm starting up a form with a boolean test. If I fail, I just want to end the app. Even though I close the form, it picks up on the line...
3
by: Michael Rodriguez | last post by:
I've installed WSE, both 1.0 and 2.0. The namespace Microsoft.Web.Services is visible from my VB.NET projects, but not in C#. In C#, it tells me there is no "Web" under "Microsoft". Any ideas?...
4
by: Peter Hemmingsen | last post by:
Hi, I have a dotnet object (implemented in mc++ and used in c#) which have a property called "Info". The Info property is also a dotnet object (implemented in mc++). In the constructor of the...
0
by: adolf garlic | last post by:
Currently we have an app (asp.net 1.1) that has a dynamic content client scripted treeview which will allow the display of reporting services reports in the right hand part of the screen. My...
1
by: aaa | last post by:
I am using a third party provider for Travel related web services. These services are not very well documented and I am having to wing my way thru nearly every one. Some I can pull data from...
0
by: =?Utf-8?B?S2V2aW4gU2NobmVpZGVy?= | last post by:
I have two projects (one using .NET 1.1 the other using 2.0). When I call a particular method in a webservice from the 1.1 project everything works great. When I call the same method from the 2.0...
7
by: Anna Smidt | last post by:
I have a function which will return a shape from an image everytime it's called. Since it's time consuming I would like it to run itself only once, and at every subsequent calls it should return...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.