bet365 / soap

Make it easy to use SOAP from Erlang
Apache License 2.0
200 stars 75 forks source link

bug: soap_fault:parse_fault_1_1 funciton_clause #24

Open define-null opened 7 years ago

define-null commented 7 years ago

soap_fault module fails on parsing xml that looks like this

<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">
<soap:Body>
<soap:Fault>
  <faultcode>soap:Server</faultcode>
  <faultstring>Some description goes here</faultstring>
  <detail><ns2:SomeTag xmlns:ns2=\"http://some_namespace_goes_here/\">
             <tag1>something</tag1>
             <tag2>something else</tag2>
         </ns2:SomeTag>
  </detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>

The stacktrace looks like:

  "stacktrace" : [
    "{soap_fault,parse_fault_1_1, [{startElement,[],\"tag1\",[],[]}, 
[{\"ns2\",\"http://some_namespace_goes_here/\"},
{\"soap\",\"http://schemas.xmlsoap.org/soap/envelope/\"}],             
{pf_state,'1.1',detail,[], {faultcode,\"http://schemas.xmlsoap.org/soap/envelope/\",\"Server\",undefined}, \"Some description goes here\", undefined,[],undefined,  {\"SomeTag\",\"http://some_namespace_goes_here\"}, []}], [{file,\"src/soap_fault.erl\"},{line,327}]}",
    "{soap_client_util,xml_parser_cb,2,[{file,\"src/soap_client_util.erl\"},{line,421}]}",
    "{erlsom_sax_utf8,wrapCallback,2,[{file,\"src/erlsom_sax_utf8.erl\"},{line,1408}]}",
    "{erlsom_sax_utf8,parseContentLT,2,[{file,\"src/erlsom_sax_utf8.erl\"},{line,936}]}",
    "{erlsom_sax_utf8,parse,2,[{file,\"src/erlsom_sax_utf8.erl\"},{line,196}]}",
    "{soap_client_util,parse_xml,9,[{file,\"src/soap_client_util.erl\"},{line,259}]}",
    ...
define-null commented 7 years ago

So I guess the proper fix for this would lead to non-compatible change as it also requires changes to soap_fault types. Any plans to fix this?

deadtrickster commented 6 years ago

I addressed this issue here: https://github.com/deadtrickster/soap/commit/1b85a239457e0944a75a4423105a21ed151edb04

baladzhova commented 6 years ago

Hey, there. I am having the same problem. Is there going to be a fix soon?

define-null commented 6 years ago

@deadtrickster Have you finished with that fix? Maybe create a pullrequest towards this repo, or https://github.com/willemdj/soap ?