Question Error Msg Using Proxy Class (VB 2008 Exp)

adept710

New member
Joined
Feb 11, 2009
Messages
2
Programming Experience
Beginner
Hello Everyone,

I am coding a project in Visual Basic 2008 Express and I am using two separate proxy classes that are created from 2 separate WSDL files on the same server. The first proxy class creates was for login and simply passed username and password for authentication, then upon approval it sent back a key which was then to be placed as the first argument on all other methods found in the second created class proxy. This first class is working fine, however had similar problems to the problem I am getting on the second class, and the way I fixed the original class was to add the System.Web.Services as a reference to my project. I am hoping this error on the second one is the same problem, only a different reference.

Firstly here is the code I am using to call the second class, after using the first to log in:

Dim objMSInfo As New Racing()
Dim MSResult As String

MSResult = objMSInfo.MeetingSummary(myKey, strJ, strRD, strTC)


The problem is occuring on the last line of this code above and begins after the “MSResult =” The rest of this line is underlined with a blue wavy line, and the error generated in the error window, says the following to me:

Value of type 'System.Xml.XmlElement' cannot be converted to 'String'.

To save on space here, I will simply post the section of the created Racing.vb file, which shows the syntax for this method. If the rest of the document is needed then please let me know and I will post the whole document, however is a large file (over 73 000 characters).

'''<remarks/>
<System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://direct.tab.com.au/LiveOdds/MeetingSummary", RequestNamespace:="http://direct.tab.com.au/LiveOdds/", ResponseNamespace:="http://direct.tab.com.au/LiveOdds/", Use:=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle:=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)> _
Public Function MeetingSummary(ByVal Key As String, ByVal Jurisdiction As String, ByVal [Date] As String, ByVal TypeCode As String) As System.Xml.XmlElement
Dim results() As Object = Me.Invoke("MeetingSummary", New Object() {Key, Jurisdiction, [Date], TypeCode})
Return CType(results(0),System.Xml.XmlElement)
End Function


I hope this is enough information to help you to help me find the problem, however if you need any more info, please let me know, and I will supply it at the very first chance I get.

Thank you in advance to the smart ones who can help me.
 

adept710

New member
Joined
Feb 11, 2009
Messages
2
Programming Experience
Beginner
??????????????????????????

Well guys and gals,

I assume my problem is outside of the knowledge of this forum's members, as no one has taken the time to reply, so I am going to move this question to the other more helpful forums.

Cheers
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,324
Location
Norway
Programming Experience
10+
MeetingSummary method returns a XmlElement object, not a String object. You have declared MSResult variable as String, and as the error message says the returned XmlElement object can't be converted to a String object.
 
Top Bottom