Here's an example of an adapter which allows you to develop your xml
code independently of your AOLserver code:

proc ::wsdl::server::accept { why } {

    log Notice "Accepting Connection with $why"

    foreach {server service port binding address} $why {}

    # 0. Get POSTed Data:
    set headerSet [ns_conn headers]
    set length [ns_set iget $headerSet "Content-length"]
    set tmpFile [ns_tmpnam]
    log Notice "Using tmpFile = $tmpFile"
    set fp [ns_openexcl $tmpFile]
    fconfigure $fp -translation binary
    ns_conn copy 0 $length $fp
    close $fp

    # 0.1 Package File and Headers:
    set headerLength [ns_set size $headerSet]
    for {set i 0} {$i < $headerLength} {incr i} {
        lappend headers [ns_set key $headerSet $i] [ns_set value $headerSet $i]
    }

    set requestID [::request::new $headers $tmpFile $why]

    # Note Binding
    log Notice "wsdl::server::accept binding = $binding"

    # 2. Let Binding handle the request

    set responseList [[set
::wsdb::bindings::${binding}::handleRequest] $requestID]

    ns_return [lindex $responseList 0] [lindex $responseList 1]
[lindex $responseList 3]

}

Instead of ns_conn content, I use ns_conn copy to create a temporary
file for the xml document. The filename and a tcl copy of the headers
and request is passed to a potentially AOLserver ignorant package.

tom jackson

On Wed, Apr 7, 2010 at 7:09 AM, Brad Chick <b...@doitsports.com> wrote:
> Thanks. That was simple enough.
>
> Just a "ns_conn content" and then tdom.
>
> It just wasn't easy to find much info on this.
>
> On 4/7/2010 4:31 AM, Gustaf Neumann wrote:
>>
>> Is there something wrong with "ns_conn content" ?
>>
>> Am 07.04.10 09:03, schrieb Bas Scheffers:
>>>
>>> I think the question is *how* to grab the raw post data?
>>>
>>> On Wednesday, April 7, 2010 4:12pm, "Gustaf
>>> Neumann"<neum...@wu-wien.ac.at> said:
>>>>
>>>> Grab the post data and use an xml parser to get the content
>>>> There are multiple xml parsers for tcl available that you can use.
>>>> I would recommend tdom, which supports among other
>>>> things xpath (see http://www.tdom.org/)
>>>>
>>>> -gustaf neumann
>>>>
>>>> Am 07.04.10 06:40, schrieb Brad Chick:
>>>>>
>>>>> This should be fairly simple, but I having issues parsing a form
>>>>> post that is
>>>>> of Content-Type "text/xml".
>>>>>
>>>>> The methods I see to handle the form data all try to parse the body
>>>>> into
>>>>> key/value pairs.
>>>>>
>>>>> This is not what I need.
>>>>>
>>>>> Rather, I just need the xml payload.
>>>>>
>>>>> any help would be appreciated.
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>> --
>>>>> AOLserver - http://www.aolserver.com/
>>>>>
>>>>> To Remove yourself from this list, simply send an email
>>>>> to<lists...@listserv.aol.com> with the
>>>>> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
>>>>> Subject:
>>>>> field of your email blank.
>>>>>
>>>>
>>>> --
>>>> AOLserver - http://www.aolserver.com/
>>>>
>>>> To Remove yourself from this list, simply send an email to
>>>> <lists...@listserv.aol.com> with the
>>>> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
>>>> Subject: field
>>>> of your email blank.
>>>>
>>>
>>> --
>>> AOLserver - http://www.aolserver.com/
>>>
>>> To Remove yourself from this list, simply send an email
>>> to<lists...@listserv.aol.com> with the
>>> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
>>> Subject: field of your email blank.
>>
>>
>> --
>> AOLserver - http://www.aolserver.com/
>>
>> To Remove yourself from this list, simply send an email to
>> <lists...@listserv.aol.com> with the
>> body of "SIGNOFF AOLSERVER" in the email message. You can leave the
>> Subject: field of your email blank.
>
>
> --
> AOLserver - http://www.aolserver.com/
>
> To Remove yourself from this list, simply send an email to
> <lists...@listserv.aol.com> with the
> body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject:
> field of your email blank.
>


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to 
<lists...@listserv.aol.com> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to