phax / peppol-commons

Java library with shared Peppol components - identifier handling, codelists, SBDH handler, SMP Client, SML Client
Apache License 2.0
29 stars 8 forks source link

Invalid SML response HTTP Status code for SOAP Faults #48

Open phax opened 8 months ago

phax commented 8 months ago
---[HTTP request - https://acc.edelivery.tech.ec.europa.eu/edelivery-sml/manageparticipantidentifier]---
Accept: text/xml, multipart/related
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://busdox.org/serviceMetadata/ManageBusinessIdentifierService/1.0/ :createIn"
User-Agent: XML-WS Runtime 4.0.2 git-revision#0264419

<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S=["http://schemas.xmlsoap.org/soap/envelope/"](http://schemas.xmlsoap.org/soap/envelope/)><S:Body><CreateParticipantIdentifier xmlns=["http://busdox.org/serviceMetadata/locator/1.0/"](http://busdox.org/serviceMetadata/locator/1.0/) xmlns:ns2=["http://busdox.org/transport/identifiers/1.0/"](http://busdox.org/transport/identifiers/1.0/)><ServiceMetadataPublisherID>HELGER2-SMP</ServiceMetadataPublisherID><ns2:ParticipantIdentifier scheme="iso6523-actorid-upis">test1234</ns2:ParticipantIdentifier></CreateParticipantIdentifier></S:Body></S:Envelope>
--------------------

Formatted:

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S=["http://schemas.xmlsoap.org/soap/envelope/"](http://schemas.xmlsoap.org/soap/envelope/)>
  <S:Body>
    <CreateParticipantIdentifier xmlns=["http://busdox.org/serviceMetadata/locator/1.0/"](http://busdox.org/serviceMetadata/locator/1.0/) xmlns:ns2=["http://busdox.org/transport/identifiers/1.0/"](http://busdox.org/transport/identifiers/1.0/)>
      <ServiceMetadataPublisherID>HELGER2-SMP</ServiceMetadataPublisherID>
      <ns2:ParticipantIdentifier scheme="iso6523-actorid-upis">test1234</ns2:ParticipantIdentifier>
    </CreateParticipantIdentifier>
  </S:Body>
</S:Envelope>
---[HTTP response - https://acc.edelivery.tech.ec.europa.eu/edelivery-sml/manageparticipantidentifier - 400]---
null: HTTP/1.1 400 Bad Request
Connection: keep-alive
Content-Length: 562
Content-Type: text/xml; charset=UTF-8
Date: Tue, 16 Jan 2024 11:17:59 GMT
Server: Europa
Server-Timing: dtRpid;desc="1162590187", dtSInfo;desc="0"
Set-Cookie: JSESSIONID=xp4R_g_a1nHIDo_p5nGrjn9DN6RreB96fiICePrqfVw4i_XOW78p!1301775479; path=/; HttpOnly
Set-Cookie: dtCookie=v_4_srv_41_sn_D22A8364FD7636032D8649BEBF947978_perc_100000_ol_0_mul_1_app-3Aa59610c0788e5f57_1; Path=/; Domain=.europa.eu/edelivery-sml
X-OneAgent-JS-Injection: true

<soap:Envelope xmlns:soap=["http://schemas.xmlsoap.org/soap/envelope/"](http://schemas.xmlsoap.org/soap/envelope/)><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>[ERR-106] Identifier value test1234 is illegal. [xp4R_g_a1nHIDo_p5nGrjn9DN6RreB96fiICePrqfVw4i_XOW78p!1301775479!1705403879386]</faultstring><detail><BadRequestFault xmlns:ns2=["http://busdox.org/transport/identifiers/1.0/"](http://busdox.org/transport/identifiers/1.0/) xmlns=["http://busdox.org/serviceMetadata/locator/1.0/"](http://busdox.org/serviceMetadata/locator/1.0/)><FaultMessage>[ERR-106] Identifier value test1234 is illegal.</FaultMessage></BadRequestFault></detail></soap:Fault></soap:Body></soap:Envelope>
--------------------

Formatted:

<soap:Envelope xmlns:soap=["http://schemas.xmlsoap.org/soap/envelope/"](http://schemas.xmlsoap.org/soap/envelope/)>
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Server</faultcode>
      <faultstring>[ERR-106] Identifier value test1234 is illegal. [xp4R_g_a1nHIDo_p5nGrjn9DN6RreB96fiICePrqfVw4i_XOW78p!1301775479!1705403879386]</faultstring>
      <detail>
        <BadRequestFault xmlns:ns2=["http://busdox.org/transport/identifiers/1.0/"](http://busdox.org/transport/identifiers/1.0/) xmlns=["http://busdox.org/serviceMetadata/locator/1.0/"](http://busdox.org/serviceMetadata/locator/1.0/)>
          <FaultMessage>[ERR-106] Identifier value test1234 is illegal.</FaultMessage>
        </BadRequestFault>
      </detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>

==> Based on the SOAP specification 1.1, SOAP faults MUST be returned with an HTTP status code 500: https://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383529

==> Only SOAP 1.2 specification allows the HTTP status codes 400 and 500 to be an error.

The SOAP version seems to be determined in the WSDL files by using the SOAP transport URI "http://schemas.xmlsoap.org/soap/http". By using "http://www.w3.org/2003/05/soap/bindings/HTTP/" it would be SOAP 1.2 instead.

Sent an emal to EC support. Lets see :)

phax commented 7 months ago

Feedback from EC support (excerpt):

It does make perfect sense. The (Domi)SML behaviour is like this since BDMSL 3.0.1 version from the year 2016. The change was made based on the Interface Control Document> https://ec.europa.eu/digital-building-blocks/sites/download/attachments/693210596/%28eDelivery%29%28SML%29%28ICD%29%281.40%29.pdf?version=1&modificationDate=1697118220374&api=v2