DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: content type as XML

  1. #1
    Fraser Stewart Guest

    content type as XML

    I'm using XMLHTTP to send an XMLDOM object which is just some simple XML.
    the servlet receiving it can accept data either as HTTP Forum postings or
    XML and i am sending XML *but* i suspect the problems i'm having with the
    servlet are because the Content Type of what is being sent is not being set
    as xml.....how do i do this?

    thanks,
    frase.r



  2. #2
    MarkN Guest

    Re: content type as XML


    I've done this and it does work. What does your client code look like? What
    errors or indications are you getting? If I remember right, the parameter
    "post" needs to be capitalized.


    "Fraser Stewart" <fstewart@madasafish.com> wrote:
    >I'm using XMLHTTP to send an XMLDOM object which is just some simple XML.
    >the servlet receiving it can accept data either as HTTP Forum postings or
    >XML and i am sending XML *but* i suspect the problems i'm having with the
    >servlet are because the Content Type of what is being sent is not being

    set
    >as xml.....how do i do this?
    >
    >thanks,
    >frase.r
    >
    >



  3. #3
    Fraser Stewart Guest

    Re: content type as XML

    "MarkN" <mnuttall@nospam.com> wrote in message news:3b7bb7b4$1@news.devx.com...
    >
    > I've done this and it does work. What does your client code look like? What
    > errors or indications are you getting? If I remember right, the parameter
    > "post" needs to be capitalized.
    >


    in visual fox pro 7:

    *****************
    xmldom = CREATEOBJECT("msxml2.DOMDocument")
    xmldom.async = .F.

    xmlString = "...XML STUFF..."
    xmldom.loadXML(xmlString)

    xmlhttp = CREATEOBJECT("MSXML2.ServerXMLHTTP.3.0")
    xmlhttp.setTimeouts(2000, 2000, 2000, 20000)
    url = "http://<SERVLET_URL>/

    xmlhttp.open("POST", url, .F.)
    xmlhttp.setRequestHeader("Content-Type","application/xml")
    xmlhttp.send(xmldom)
    *****************

    maybe its a server side problem, i'm awaiting response from the company who wrote and support the servlet. the error is totally generated by the servlet, the Parser and XMLHTTP objects work fine. the error is a catch all one saying mandatory fields are missing.

    i suspect it might not be expecting XML because the header is not set accordingly but i dunno how to do that.
    interestingly i just discovered that ServerXMLHTTP doesn't work at all in windows98 which is one of my target OSs...and XMLHttp is such an inferior object...thankyou M$

    thanks,
    fraser.


  4. #4
    MarkN Guest

    Re: content type as XML


    Make your content type "text/xml"

  5. #5
    MarkN Guest

    Re: content type as XML


    "MarkN" <mnuttall@nospam.com> wrote:
    >
    >Make your content type "text/xml"


    Didn't see the rest of your message. Java is much more flexible in this
    area (and others), especially server side. They could be looking in any
    number of ways. I don't know what you know about Java. The problem could
    be that you have a missing field in your xml, that they are looking for a
    different content type, etc.

    As for MS XML tools it seems to me that the next step for them is integrating
    their version of SOAP into the tools. So if you want to use XML you will
    have to use MS SOAP. Don't quote me though. I need to use XML in an HTTPS
    environment and you can only do it with ServerXMLHTTP and only on the server.
    The only other way was with the SOAP API.

    Curious to know what the solution is.

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center