phax / phoss-smp

phoss SMP - a Peppol and OASIS BDXR SMP Server, CEF eDelivery compliant
129 stars 37 forks source link

Support for extension elements on EndpointTyp #74

Closed Martijn-ATO closed 6 years ago

Martijn-ATO commented 6 years ago

The SMP specification allows extensions at several points in the XML schema for service metadata. The project I am currently working on requires an extension on the EndpointType to allow for metadata about corner 3.

We are kindly requesting if it would be possible to add support for this in your awesome product :-)

The current method of adding extension elements to Service Group would suffice.

****
Martijn-ATO commented 6 years ago

Hi Philip,

I can create an Endpoint with one extension and the REST response shows the Extension element. But when I edit the Endpoint, the contents of the extension is not populated in the textarea for Extension. When I add content and save the Endpoint, the previous extension is overwritten with the new one.

Martijn-ATO commented 6 years ago

Oh, I'm using the XML backend version, not the SQL version.

phax commented 6 years ago

Thanks for the inforation - sorry for that. Bad testing on my side :(

phax commented 6 years ago

But now :)

Martijn-ATO commented 6 years ago

Yay, the textarea is now populated with the existing extension content, however, I'm afraid it is becoming more complicated. The system doesn't accept an XML fragment. Since we would like to adhere to the OASIS specification, the Extension element consists of several child elements. At the moment I can add one XML element but not multiple. This works

<Wrapper>
   <One>1</One>
   <Two>2</Two>
</Wrapper>

And turns into

   <bdxr:Extension>
      <Wrapper>
         <One>1</One>
         <Two>2</Two>
         </Wrapper>
   </bdxr:Extension>
</bdxr:Endpoint>

But entering this

<One>1</One>
<Two>2</Two>

in the textarea results in an error: Optional extension to the endpoint. If present it must be valid XML content! The extension must be XML content.

Kind regards, Martijn.

phax commented 6 years ago

Here I'm having a slight problem. I have no real way to determine, if this is done by purpose or not. I suggest we stick to the current solution of having exactly one XML extension, and as soon as PEPPOL switches to the OASIS BDXR scheme, I can drop a lot of legacy and will also improve the extensions. Does that sound okay for you for now? If that is feasable, I will create an issue and refer to this one.