SOAP - ACL creates multiple soap-env:Header tags

Chaitanya Gupta <[email protected]> Mon, 16 Oct 2006 21:22:36 +0530
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
Hi,

Here's another question related to ACL's SOAP API. I want a couple of 
headers to be included in a SOAP request like this -

<SOAP-ENV:Header>
    <h1>
      <h1-sub xsi:type='xsd:string'>abc</h1-sub>
    </h1>
    <h2>
      <h2-sub xsi:type='xsd:string'>def</h2-sub>
    </h2>
</SOAP-ENV:Header>


However, when I try to do this using the following code -

(defun test-session ()
  (let* ((conn (soap-message-client :url *some-url*
                    :lisp-package :keyword))
     (head1 (make-soap-header conn
                  '(:element :|h1| (:complex (:seq (:element "h1-sub" 
xsd:|string|))))
                  :|h1-sub| "abc"))
     (head2 (make-soap-header conn
                  '(:element :|h2| (:complex (:seq (:element "h2-sub" 
xsd:|string|))))
                  :|h2-sub| "def")))
    (soap-add-header conn head1)
    (soap-add-header conn head2)
    (call-soap-method conn
              '(:element "body-el" (:simple nil)))))

the following SOAP request is created -

<?xml version="1.0"?>
<SOAP-ENV:Envelope
    SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'
    xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
    xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
    >
  <SOAP-ENV:Header>
    <h1>
      <h1-sub xsi:type='xsd:string'>abc
      </h1-sub>
    </h1>
  </SOAP-ENV:Header>
  <SOAP-ENV:Header>
    <h2>
      <h2-sub xsi:type='xsd:string'>def
      </h2-sub>
    </h2>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <body-el/></SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Note the twin SOAP-ENV:Header tags. I don't want that. I just want <h1> 
and <h2> inside the same Header tag.
I tried passing a (:complex (:seq (:element ...) ...)) form as second 
argument to make-soap-header (just like for call-soap-method when you 
need multiple elements in the SOAP Body), but then I got the following 
error -
 :COMPLEX fell through a ECASE form.  The valid cases were :ANY and
:ELEMENT

How can I solve this problem? I am using ACL version 8.0

Thanks,
Chaitanya