Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing error messages #29

Open
des75 opened this issue Aug 21, 2017 · 3 comments
Open

Parsing error messages #29

des75 opened this issue Aug 21, 2017 · 3 comments

Comments

@des75
Copy link

des75 commented Aug 21, 2017

Hi,
I use the library to consume SOAP service and when error 500 occurres, the XML returns as string, like following:

{:error,
 {:client,
  {:parsing_message, 500,
   [{'connection', 'close'}, {'date', 'Mon, 21 Aug 2017 09:13:58 GMT'},
    {'server', 'serverName'}, {'content-length', '525'},
    {'content-type', 'text/xml;charset=utf-8'}], :error, :function_clause}},
 "<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\"><S:Body><S:Fault xmlns:ns4=\"http://www.w3.org/2003/05/soap-envelope\"><faultcode>S:Server</faultcode><faultstring>FailtString</faultstring><detail><ns2:RecordName xmlns:ns2=\"http://soap.url\"><errorCode>NOT_FOUND</errorCode><message>Error Message</message></ns2:RecordName></detail></S:Fault></S:Body></S:Envelope>"}

There is generated record for fault message, but it is not used.

-record('P:RecordName ', {
	errorCode :: string() | undefined,
	message :: string() | undefined}).

How to make it parse XML into a erlang records when SOAP service returns an error?

@deadtrickster
Copy link

After further debugging it turned out current version can't process complex detail tags. Only strings. I think they even hard-coded.

-record(faultdetail, {uri :: string(),
                      tag :: string(),
                      text :: string()}).

@deadtrickster
Copy link

text :: string()}).

deadtrickster added a commit to deadtrickster/soap that referenced this issue Feb 9, 2018
@deadtrickster
Copy link

Addressed here: deadtrickster@1b85a23

What's missing:

  1. operations generated have set faults to empty list/undefined;
  2. faults (and perhaps responses in generatal) aren't validated that they actually the responses/faults for this particular operation;
  3. no 1.2 support.

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

No branches or pull requests

2 participants