<div dir="ltr"><div>Hi Mark,<br><br></div>I am implementing XML::Compile::WSS and the API I am working with expects the header to contain a SecurityTokenReference with X509Data/X509IssuerSerial block.<div><br></div><div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal;margin-top:0px;margin-bottom:0px"><a href="http://www.ws-i.org/Profiles/BasicSecurityProfile-1.1.html#KeyIdentifier_or_X509IssuerSerial_for_External_References" target="_blank" style="outline:none">http://www.ws-i.org/Profiles/BasicSecurityProfile-1.1.html#KeyIdentifier_or_X509IssuerSerial_for_External_References</a></div><div><br></div>XML::Compile::WSS::KeyInfo provides three methods for publish_token (KEYNAME, SECTOKREF_KEYID, <span style="font-size:16px;line-height:normal;font-family:Calibri,Arial,Helvetica,sans-serif">SECTOKREF_URI).  Unfortunately, none of these produce the KeyInfo block in the way desired.  So, I have tried my hand at creating schema-&gt;writer(s).</span><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal;margin-top:0px;margin-bottom:0px"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal;margin-top:0px;margin-bottom:0px">The issue I am encountering is referencing the element types for X509IssuerName and X509SerialNumber as they are elements in a complexType (X509IssuerSerial) under the main X509Data block that do not have a corresponding element (i.e. X509Data =&gt; ds:X509DataType).  As a result, attempts to create schema-&gt;writer for these elements fail:</div><div style="margin-top:0px;margin-bottom:0px"><div style="margin-top:0px;margin-bottom:0px"><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:normal"><br></span></font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:normal">my $x509w = $schema-&gt;writer(&#39;ds:X509Data&#39;);</span></font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:normal">## works correctly</span></font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:normal"><br></span></font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:normal">my $x509isw = $schema-&gt;writer(&#39;ds:X509IssuerSerial&#39;);</span></font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:normal">## returns error: cannot find element or attribute `{<a href="http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial">http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial</a>&#39; at ds:X509IssuerSerial</span></font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:normal"><br></span></font></div><div style="margin-top:0px;margin-bottom:0px"><div style="margin-top:0px;margin-bottom:0px"><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:normal">my $x509inw = $schema-&gt;writer(&#39;ds:X509IssuerName&#39;);</span></font></div><div style="margin-top:0px;margin-bottom:0px"><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:normal">## returns error: cannot find element or attribute `{<a href="http://www.w3.org/2000/09/xmldsig#">http://www.w3.org/2000/09/xmldsig#</a>}</span></font><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal">X509IssuerName</span><font face="Calibri, Arial, Helvetica, sans-serif"><span style="font-size:16px;line-height:normal">&#39; at ds:</span></font><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal">X509IssuerName</span></div><div style="margin-top:0px;margin-bottom:0px"><br></div></div></div></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal;margin-top:0px;margin-bottom:0px">Reviewing the methods for publishing the token, it seems to be just a matter of creating writers for each element and passing them to writers for their parent elements.  Using &#39;seq_ds_X509IssuerSerial&#39; I can reference that element in X509DataType but I&#39;m not sure how to construct writers for elements under X509IssuerSerialType without the corresponding element.  <br><br>As this is part of the specification, I imagine it has come up before and I am just overlooking the solution.  I appreciate your feedback and a big &quot;Thank You&quot; for developing this great suite of modules.</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal;margin-top:0px;margin-bottom:0px"><br></div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal;margin-top:0px;margin-bottom:0px">Best regards,</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal;margin-top:0px;margin-bottom:0px">James Moore</div><div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px;line-height:normal;margin-top:0px;margin-bottom:0px"><a href="mailto:webtechhq@gmail.com">webtechhq@gmail.com</a><br><br><br></div></div>