Skip to content
This repository has been archived by the owner on Aug 10, 2018. It is now read-only.

Feature request: SOAP simpleType #9

Closed
GoogleCodeExporter opened this issue Mar 22, 2015 · 6 comments
Closed

Feature request: SOAP simpleType #9

GoogleCodeExporter opened this issue Mar 22, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10331

From: Ken Harris <kengruven@gmail.com>
Subject: bug#10331: Feature request: SOAP simpleType
Newsgroups: gmane.emacs.bugs
To: 10331@debbugs.gnu.org
Date: Mon, 19 Dec 2011 13:27:18 -0800 (14 hours, 36 minutes, 43 seconds ago)
Resent-From: Ken Harris <kengruven@gmail.com>

Hi, emacs!  I hope this is the right place to send feature requests.

I've been playing with Emacs 24's soap-client.el library, which is a
fantastic concept.

The "soap-load-wsdl-from-url" function seems to work in some cases,
but not in others.  I am certainly not an expert on SOAP or
soap-client but one thing that I've discovered is that it does not
seem to know about "simpleType".  (The term "simpleType" does not
appear in the source code.  The function soap-parse-schema looks at
only xsd:complexType and xsd:element.)

Here's an example of a WSDL that fails on a simpleType (called "AdultOption"):

    (soap-load-wsdl-from-url "http://api.search.live.net/search.wsdl")

Rather than parsing and returning a WSDL object, it gives a backtrace.
 Here's the top of it (the interesting part):

Debugger entered--Lisp error: (error
"Soap-wsdl-get((http://schemas.microsoft.com/LiveSearch/2008/03/Search
. AdultOption)): cannot find element")
  signal(error ("Soap-wsdl-get((http://schemas.microsoft.com/LiveSearch/2008/03/Search
. AdultOption)): cannot find element"))
  error("Soap-wsdl-get(%s): cannot find element"
("http://schemas.microsoft.com/LiveSearch/2008/03/Search" .
"AdultOption"))
  (if element nil (error "Soap-wsdl-get(%s): cannot find element" name))
  (unless element (error "Soap-wsdl-get(%s): cannot find element" name))
  (let ((alias-table ...) namespace element-name element) (when
(symbolp name) (setq name ...)) (when use-local-alias-table (setq
alias-table ...)) (cond (... ... ... ... ...) (... ... ...) (t ...))
(setq element (soap-namespace-get element-name namespace ...)) (unless
element (error "Soap-wsdl-get(%s): cannot find element" name)) (if
(soap-namespace-link-p element) (soap-wsdl-get ... wsdl predicate)
element))
  soap-wsdl-get(("http://schemas.microsoft.com/LiveSearch/2008/03/Search"
. "AdultOption") [cl-struct-soap-wsdl nil ([cl-struct-soap-port
"BingPort" nil "http://api.search.live.net:80/soap.asmx" ...]) (("ns1"
. "urn:BingPortType") ("soapenc" .
"http://schemas.xmlsoap.org/soap/encoding/") ("xsd" .
"http://www.w3.org/2001/XMLSchema") ("tns" .
"http://schemas.microsoft.com/LiveSearch/2008/03/Search") ("wsa" .
"http://schemas.xmlsoap.org/ws/2004/08/addressing") ("wsdl" .
"http://schemas.xmlsoap.org/wsdl/") ("soap" .
"http://schemas.xmlsoap.org/wsdl/soap/") ("xsi" .
"http://www.w3.org/2001/XMLSchema-instance") ("xsd" .
"http://www.w3.org/2001/XMLSchema")) ([cl-struct-soap-namespace
"urn:BingPortType" #s(hash-table size 65 test equal rehash-size 1.5
rehash-threshold 0.8 data ("Search" ... "SearchRequestMessage" ...
"SearchResponseMessage" ... ...))] [cl-struct-soap-namespace
"http://schemas.microsoft.com/LiveSearch/2008/03/Search" #s(hash-table
size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data
("SearchRequest" ... "ArrayOfSearchOption" ... "ArrayOfSourceType" ...
"WebRequest" ... "ArrayOfWebSearchOption" ... "ArrayOfString" ...
"ImageRequest" ... "PhonebookRequest" ... "VideoRequest" ...
"NewsRequest" ... "MobileWebRequest" ...
"ArrayOfMobileWebSearchOption" ... "TranslationRequest" ...
"SearchResponse" ... "Query" ... "SpellResponse" ...
"ArrayOfSpellResult" ... "SpellResult" ... "WebResponse" ...
"ArrayOfWebResult" ... "WebResult" ... "ArrayOfWebSearchTag" ...
"WebSearchTag" ... "ArrayOfDeepLink" ... "DeepLink" ...
"ImageResponse" ... "ArrayOfImageResult" ... "ImageResult" ...
"Thumbnail" ... "RelatedSearchResponse" ...
"ArrayOfRelatedSearchResult" ... "RelatedSearchResult" ...
"PhonebookResponse" ... "ArrayOfPhonebookResult" ... "PhonebookResult"
... "VideoResponse" ... "ArrayOfVideoResult" ... "VideoResult" ...
"InstantAnswerResponse" ... "ArrayOfInstantAnswerResult" ...
"InstantAnswerResult" ... "NewsResponse" ...
"ArrayOfNewsRelatedSearch" ... "NewsRelatedSearch" ...
"ArrayOfNewsResult" ... "NewsResult" ... "ArrayOfNewsCollection" ...
"NewsCollection" ... "ArrayOfNewsArticle" ... "NewsArticle" ... ...))]
[cl-struct-soap-namespace "http://schemas.xmlsoap.org/soap/encoding/"
#s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8
data ("string" ... "dateTime" ... "boolean" ... "long" ... "int" ...
"integer" ... "byte" ... "float" ... "base64Binary" ... "anyType" ...
"anyURI" ... "Array" ... "byte[]" ... ...))] [cl-struct-soap-namespace
"http://www.w3.org/2001/XMLSchema" #s(hash-table size 65 test equal
rehash-size 1.5 rehash-threshold 0.8 data ("string" ... "dateTime" ...
"boolean" ... "long" ... "int" ... "integer" ... "byte" ... "float"
... "base64Binary" ... "anyType" ... "anyURI" ... "Array" ... "byte[]"
... ...))])] soap-type-p)

[...and more...]

I've found that with my own application's WSDL, if I comment out all
uses of simpleType, then soap-client.el can load it just fine.

I have no idea how hard it would be to implement simpleType, but it
would definitely be very useful!  I may take a stab at this myself,
but no promises.


- Ken

Original issue reported on code.google.com by michael....@gmail.com on 20 Dec 2011 at 12:06

@GoogleCodeExporter
Copy link
Author

Thanks for reporting this, I will add simpleType to the list of supported SOAP 
types.

Original comment by AlexHars...@gmail.com on 20 Dec 2011 at 10:25

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

This issue was updated by revision a0ff70908303.


Added support for the simpleType and the WSDL at
http://api.search.live.net/search.wsdl loads without error.  Unfortunately it
is not usable yet because the WSDL document defines two entities with the same
name: "SearchRequest" is both an xsd:element and an xsd:complexType.
soap-client.el will need to be modified to account for this possibility.

Original comment by AlexHars...@gmail.com on 21 Dec 2011 at 1:07

@GoogleCodeExporter
Copy link
Author

This issue was updated by revision 135e07156c5a.


I added a workaround for preventing simple self references, which works with
the WSDL from http://api.search.live.net/search.wsdl; It is unclear to me what
the correct/general solution would be.

Original comment by AlexHars...@gmail.com on 30 Dec 2011 at 12:51

@GoogleCodeExporter
Copy link
Author

The referenced WSDL now loads properly, but there is a bug in the Emacs xml.el 
which prevents the response from the server to be parsed.  This has been 
reported as:

    http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10405

Also, the search API is not usable since it requires specifying an "AppId" 
parameter, which need to be obtained first (this is outside the scope of 
soap-client), see this link for details:

    http://msdn.microsoft.com/en-us/library/dd251020.aspx


Original comment by AlexHars...@gmail.com on 30 Dec 2011 at 12:55

@GoogleCodeExporter
Copy link
Author

Closing issue, changes applied to Emacs source and original bug closed.

Original comment by AlexHars...@gmail.com on 5 Jun 2012 at 11:33

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Original comment by AlexHars...@gmail.com on 16 Feb 2014 at 9:23

  • Added labels: Bing-Soap

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant