Skip to content

Parsing error messages #29

Description

@des75

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions