A followup:

(After fixing the bugs in the code snippets I sent in the earlier
message, I'm wondering if what I need is a quick tutorial in using
HTTP messaging with Unicon.  (I've looked at the Steven Lumos'
document and it helps, but I'm still a bit thick on the subject):

I want to send the following (say) as an HTTP POST action:
----------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
 xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance";
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
 xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
 xmlns:xsd="http://www.w3.org/1999/XMLSchema";
 SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
 <SOAP-ENV:Body>
  <namesp:query xmlns:namesp="http://weaver.tuc.noao.edu/VSO_NSO";>
    <value1 xsi:type="xsd:string">*</value1>
    <value2 xsi:type="xsd:string">host = 'weaver'</value2>
    <value3 xsi:type="xsd:string">date DESC</value3>
  </namesp:query>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
----------------------------------------------------------------------

and then read back the result.  What attributes do I need to
add to the open command to get that to happen?  Note that it's
not a multipart form - the 'real content type' is 'text/xml' -
so I don't know how to get Unicon to recognize that I want
to send a POST action.  I've tried:
------------------------------------------------------------
    method call(rpc, args[])
        local msg
        msg := buildSoapMsg(rpc, args)
        hdrs := mkHttpPostHdrs(msg)
        write("Sending: \n",msg)

        args := [proxy, "m"] ||| hdrs
        svc := (open ! args) |
               stop("Cannot get '",uri,"' connection!")
               
        writes(svc, msg)
        result := ""
        while result ||:= reads(svc, 8192)
        close(svc)
        write("\n\n\n")
        write("Got: \n",result)
--------------------------------------------------------------

Where mkHttpPostHdrs(msg) is:

--------------------------------------------------------------
    method mkHttpPostHdrs(msg)
        local a

        a := []
        put(a, "Context-Type: text/xml; charset=\"utf-8\" form")
        put(a, "Content-Length: "||*msg)
        put(a, "SOAPAction: \""||proxy||"\"")
        return a
    end
--------------------------------------------------------------

(These headers are what SOAP says are appropriate for use with
a SOAP request message - plus the additional header (first)
as: "POST: /SOAP HTTP/1.1" - I didn't show that here because
my reading of the Unicon source code shows that being generated
within Unicon on POST messages...)

But the server gets an empty POST request.  Can someone point me
to what I should be doing instead?  Thanks!

-- 
Steve Wampler <[EMAIL PROTECTED]>
National Solar Observatory


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to