Results 1 to 3 of 3

Thread: Error Msg Using Proxy Class (VB 2008 Exp)

  1. #1
    adept710 is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Feb 2009
    Posts
    2
    Reputation
    0

    Exclamation Error Msg Using Proxy Class (VB 2008 Exp)

    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.SoapDocumentMethodA ttribute("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.SoapBindingUs e.Literal, ParameterStyle:=System.Web.Services.Protocols.Soap ParameterStyle.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.

  2. #2
    adept710 is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5 (VS 2008)
    Join Date
    Feb 2009
    Posts
    2
    Reputation
    0

    Thumbs down ??????????????????????????

    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

  3. #3
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    14,186
    Reputation
    2368
    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.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking