CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Posts
    29

    Run-time error '287' Application-defined or object-defined error... can anyone help?

    Hi
    Thanks for answering my early question...
    Now I'm getting the above error when I do a
    "MSXML2.XMLHTTP" - send method. Below is my code:

    Code:
    Dim objHTTP As New MSXML2.XMLHTTP
    
    objHTTP.open "post", "http://127.0.0.1:8189", False
    objHTTP.setRequestHeader "X-NOKIA-MMSC-Charging", "100"
    objHTTP.setRequestHeader "Content-Type",
                                                "application/vnd.wap.mms-message"
    objHTTP.setRequestHeader "Content-Length", UBound(b)
    objHTTP.send b
    
    Note: 'b' is Byte Array. Im using "Microsoft XML, v2.6"
    What's wrong with my code? Please advice...
    Thanks for your time.

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Think this is more related to Xml forum

    I am moving this question there

    Btw,
    Code:
    Private Sub Form_Load()
    'Dim objHTTP As New MSXML2.xmlhttp
    Dim myVariantB As Variant
    myVariantB = "abc=123"
    ''Dim b(10) As Byte
    'objHTTP.open "post", "http://127.0.0.1:8189", False
    'objHTTP.setRequestHeader "X-NOKIA-MMSC-Charging", "100"
    'objHTTP.setRequestHeader "Content-Type", "application/vnd.wap.mms-message"
    'objHTTP.setRequestHeader "Content-Length", Len(myVariantB)
    'objHTTP.send 'myVariantB
    'example from msdn
    Dim xmlhttp As New MSXML2.xmlhttp
    xmlhttp.open "GET", "http://localhost/sample.xml", False
    xmlhttp.send myVariantB
    MsgBox xmlhttp.responseXML.xml
    
    End Sub
    'from MSDN
    'SYMPTOMS
    'When you use the Send method of XMLHttp on XML 2.6
    'and XML 3.0, you may see a return result code of 0x800C0008.
    'CAUSE
    'There are no languages specified in Internet Explorer.
    'RESOLUTION
    'To check these settings in Internet Explorer, click Tools,
    'click Internet Options, and then click Languages....
    'If this box is empty, add at least one language.
    
    'MORE Information
    'Steps to Reproduce This Behavior
    'Clear the languages section in Internet Explorer.
    'Use the following code to create a Receiver.asp file
    'on the Internet Information Services (IIS) server:
    
    '<%@language=vbscript%>
    '   <%
    '      Value = Request.Form("id")
    '      response.ContentType = "text/xml"
    '      response.write "<ReturnValue>" & Value & "</ReturnValue>"
    '   %>
    'On the client, create a Windows Script Host file named
    'Test.vbs using the following code:
    'NOTE: Replace <ServerName> with the name of your IIS server.
    'DataToSend = "id=1"
    'Set xmlhttp = CreateObject("MSXML2.XMLHTTP.2.6")
    'xmlhttp.open "POST", "http://servername/receiver.asp", False
    'xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    'xmlhttp.send DataToSend
    'WScript.Echo xmlhttp.responseXML.xml
    
    
    
    'Run Test.vbs. You should see the error code returned in a dialog box.
    
    
    
    '[Visual Basic]
    'Visual Basic Syntax
    'oXMLHttpRequest.send (varBody)
    'Parameters
    'varBody
    'Variant. Case-insensitive name.
    'Example
    'Dim xmlhttp As New MSXML2.xmlhttp
    'xmlhttp.open "GET", "http://localhost/sample.xml", False
    'xmlhttp.send
    'MsgBox xmlhttp.responseXML.xml
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured