erlsom
erlsom copied to clipboard
error: 1 - Unexpected event, expected end-tag
Hi.
Got the next error:
{error,{decoding,[{exception,{error,{"1 - Unexpected event, expected end-tag"}}},
{stack,['soap:detail','soap:Fault','soap:Body',
'soap:Envelope']},
{received,{characters,"Invalid login/pass"}}]}}
while processing the next soap xml response:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="urn://pmtv.digisoft.com/systemstatus/schema/v0.1" xmlns:ns3="urn://pmtv.digisoft.com/providerstatus/schema/v0.1" xmlns:ns5="http://schemas.microsoft.com/Message" xmlns:ns4="urn://pmtv.digisoft.com/uploadUsageRecords/wsdl/v0.1" xmlns:ns7="ws.kitd.vx2.ws.EntityNotification/EntityNotificationServiceSoap" xmlns:ns6="ws.kitd.vx2.ws.EntityNotification" xmlns:ns8="ws.kitd.vx2.ws.EntityNotification/EntityNotificationServiceSoap12" xmlns:ns11="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns12="http://schemas.datacontract.org/2004/07/GMCS.PMT.IntegrationInternal" xmlns:ns15="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns16="http://schemas.datacontract.org/2004/07/GMCS.PMT.IntegrationInternal" xmlns:ns9="http://GMCS/PMT/Integration" xmlns:lbapi="urn:api3">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>error_request</faultstring>
<detail>Invalid login/pass</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
If i add the next line:
error_logger:info_msg("~p~n~p~n", [Event, ElementRecord]),
near 444 line of erlsom_parse.erl (before a throw call), i get the next output:
{characters,"Invalid login/pass"}
{'soap:detail',[],undefined}
How can i eliminate this error?
Thanks.
Hello Oleg,
The reason for the error is that erlsom expects one or more elements as
children of the
The soap schema says:
<xs:complexType name="detail"> xs:sequence <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" /> /xs:sequence <xs:anyAttribute namespace="##any" processContents="lax" /> /xs:complexType
So a valid error could look like this:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/
">
SOAP-ENV:Header/SOAP-ENV:Body
SOAP-ENV:Fault
Regards, Willem
On Fri, Aug 21, 2015 at 5:05 PM, Oleg [email protected] wrote:
Hi.
Got the next error:
{error,{decoding,[{exception,{error,{"1 - Unexpected event, expected end-tag"}}}, {stack,['soap:detail','soap:Fault','soap:Body', 'soap:Envelope']}, {received,{characters,"Invalid login/pass"}}]}}
while processing the next soap xml response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="urn://pmtv.digisoft.com/systemstatus/schema/v0.1" xmlns:ns3="urn://pmtv.digisoft.com/providerstatus/schema/v0.1" xmlns:ns5="http://schemas.microsoft.com/Message" xmlns:ns4="urn://pmtv.digisoft.com/uploadUsageRecords/wsdl/v0.1" xmlns:ns7="ws.kitd.vx2.ws.EntityNotification/EntityNotificationServiceSoap" xmlns:ns6="ws.kitd.vx2.ws.EntityNotification" xmlns:ns8="ws.kitd.vx2.ws.EntityNotification/EntityNotificationServiceSoap12" xmlns:ns11="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns12="http://schemas.datacontract.org/2004/07/GMCS.PMT.IntegrationInternal" xmlns:ns15="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:ns16="http://schemas.datacontract.org/2004/07/GMCS.PMT.IntegrationInternal" xmlns:ns9="http://GMCS/PM T/Integration" xmlns:lbapi="urn:api3"> SOAP-ENV:Body SOAP-ENV:Fault
SOAP-ENV:Server error_request Invalid login/pass /SOAP-ENV:Fault /SOAP-ENV:Body /SOAP-ENV:EnvelopeIf i add the next line:
error_logger:info_msg("~p~n~p~n", [Event, ElementRecord]),
near 444 line of erlsom_parse.erl (before a throw call), i get the next output:
{characters,"Invalid login/pass"} {'soap:detail',[],undefined}
How can i eliminate this error?
Thanks.
— Reply to this email directly or view it on GitHub https://github.com/willemdj/erlsom/issues/45.
Thanks for the reply.
This is bad news, because i can't change a server side code. How can i say erlsom to accept the existent wrong format of detail element?
You can change the schema, so that
On Fri, Aug 21, 2015 at 8:16 PM, Oleg [email protected] wrote:
Thanks for the reply.
This is bad news, because i can't change a server side code. How can i say erlsom to accept the existent wrong format of detail element?
— Reply to this email directly or view it on GitHub https://github.com/willemdj/erlsom/issues/45#issuecomment-133519665.
If i'll replace here:
<xs:element name="Fault" type="tns:Fault" />
<xs:complexType name="Fault" final="extension" >
<xs:annotation>
<xs:documentation>
Fault reporting structure
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="faultcode" type="xs:QName" />
<xs:element name="faultstring" type="xs:string" />
<xs:element name="faultactor" type="xs:anyURI" minOccurs="0" />
<xs:element name="detail" type="tns:detail" minOccurs="0" />
</xs:sequence>
</xs:complexType>
the line:
<xs:element name="detail" type="tns:detail" minOccurs="0" />
with:
<xs:any minOccurs="0"/>
Will erlsom parse both correct and incorrect result?
That sounds like a good idea, give it a try.
On Sat, Aug 22, 2015 at 9:31 AM, Oleg [email protected] wrote:
If i'll replace here:
<xs:element name="Fault" type="tns:Fault" /> <xs:complexType name="Fault" final="extension" > xs:annotation xs:documentation Fault reporting structure /xs:documentation /xs:annotation xs:sequence <xs:element name="faultcode" type="xs:QName" /> <xs:element name="faultstring" type="xs:string" /> <xs:element name="faultactor" type="xs:anyURI" minOccurs="0" /> <xs:element name="detail" type="tns:detail" minOccurs="0" /> /xs:sequence /xs:complexType
the line:
<xs:element name="detail" type="tns:detail" minOccurs="0" />
with:
<xs:any minOccurs="0"/>
Will erlsom parse both correct and incorrect result?
— Reply to this email directly or view it on GitHub https://github.com/willemdj/erlsom/issues/45#issuecomment-133648602.
The results of my experiment:
with:
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
i get:
{'soap:Fault',[],
{qname,"http://schemas.xmlsoap.org/soap/envelope/","Server",
"SOAP-ENV","soap"},
"error_request",undefined,undefined}}
with:
<xs:element name="detail" type="xs:string" minOccurs="0"/>
i get:
{'soap:Fault',[],
{qname,"http://schemas.xmlsoap.org/soap/envelope/","Server",
"SOAP-ENV","soap"},
"error_request",undefined,"Invalid login/pass"}}
So, it seems i can't use any element in place of detail element or i do something wrong.
You are right: if you just need to be able to parse the answer without
getting an error, using "any" works, but if you need the information in the
What you might also try is to make the
Good luck, Willem
On Sun, Aug 23, 2015 at 2:30 PM, Oleg [email protected] wrote:
The results of my experiment:
with:
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
i get:
{'soap:Fault',[], {qname,"http://schemas.xmlsoap.org/soap/envelope/","Server", "SOAP-ENV","soap"}, "error_request",undefined,undefined}}
with:
<xs:element name="detail" type="xs:string" minOccurs="0"/>
i get:
{'soap:Fault',[], {qname,"http://schemas.xmlsoap.org/soap/envelope/","Server", "SOAP-ENV","soap"}, "error_request",undefined,"Invalid login/pass"}}
So, it seems i can't use any element in place of detail element or i do something wrong.
— Reply to this email directly or view it on GitHub https://github.com/willemdj/erlsom/issues/45#issuecomment-133826367.
So, with:
<xs:element name="detail" type="tns:detail" minOccurs="0" />
and with mixed="true" i get:
{ok,{'soap:Fault',[],
{qname,"http://schemas.xmlsoap.org/soap/envelope/","Server",
"SOAP-ENV","soap"},
"error_auth",undefined,
{'soap:detail',[],["Client not authorized"]}}}
and with:
<xs:element name="detail" type="xs:string" minOccurs="0" />
and without mixed="true" i get:
{ok,{'soap:Fault',[],
{qname,"http://schemas.xmlsoap.org/soap/envelope/","Server",
"SOAP-ENV","soap"},
"error_auth",undefined,"Client not authorized"}}
With mixed="true" the result looks more complicated, but it works!