unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: 32983@debbugs.gnu.org
Subject: bug#32983: 27.0.50; soap-client shall accept "multipart/related" Content-type
Date: Mon, 08 Oct 2018 11:07:44 +0200	[thread overview]
Message-ID: <87woqs7qn3.fsf@gmx.de> (raw)
In-Reply-To: <871s9095f9.fsf@gmx.de> (Michael Albinus's message of "Mon, 08 Oct 2018 11:03:06 +0200")

Michael Albinus <michael.albinus@gmx.de> writes:

> The soap-client checks HTTPS responses for a proper Content-type
> "text/xml". However, not all SOAP servers return this. For example, the
> Perl SOAP::Lite module returns sometimes the Content-type
> "multipart/related". As an example one could load the GNU ELPA package
> debbugs, and eval the form (debbugs-get-bug-log 25235)
>
> This shall be supported by soap-client.

The following patch works for me. Shall be reviewed by the soap-client
maintainers.

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/net/soap-client.el b/lisp/net/soap-client.el
index f5de05dc3d..5c819636e6 100644
--- a/lisp/net/soap-client.el
+++ b/lisp/net/soap-client.el
@@ -2337,6 +2337,14 @@ soap-wsdl-resolve-references
 (defun soap-parse-server-response ()
   "Error-check and parse the XML contents of the current buffer."
   (let ((mime-part (mm-dissect-buffer t t)))
+    (when (and
+           (equal (mm-handle-media-type mime-part) "multipart/related")
+           (equal (get-text-property 0 'type (mm-handle-media-type mime-part))
+                  "text/xml"))
+      (setq mime-part
+            (mm-make-handle
+             (get-text-property 0 'buffer (mm-handle-media-type mime-part))
+             `(,(get-text-property 0 'type (mm-handle-media-type mime-part))))))
     (unless mime-part
       (error "Failed to decode response from server"))
     (unless (equal (car (mm-handle-type mime-part)) "text/xml")
--8<---------------cut here---------------end--------------->8---






  reply	other threads:[~2018-10-08  9:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-08  9:03 bug#32983: 27.0.50; soap-client shall accept "multipart/related" Content-type Michael Albinus
2018-10-08  9:07 ` Michael Albinus [this message]
2018-10-16 14:38   ` Michael Albinus
2018-10-16 15:34     ` Thomas Fitzsimmons
2018-10-16 17:48       ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87woqs7qn3.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=32983@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).