Generering af et signeret SOAP kald
HejJeg står og skal gøre brug af en SOAP webservice som er lidt ud over det sædvanlige. Det er en opkobling mod Dansk Motor Register (DMR)
Samtlige kald jeg har prøvet at lave med standart SOAP kald via PHP fejler også selv om jeg prøver at sende certificatet med i headers.
Mit problem er at jeg skal have indsat en security-header som skal indeholde en signering af både timestamp og selve indholdet.
JEg har et PKCS12 test certificat som jeg udemærket skan læse og trækker selve certificatet og privatekey ud af, men når jeg bruger PHP's indbyggede certificering får jeg bare en valideringsfejl tilbage
Reference: #wsu-Timestamp does not validate.
Den XML som jeg skal generer skal ligne dette:
(alle data er testdata)
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" SOAP-ENV:mustUnderstand="1">
<wsu:Timestamp
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="wsu-Timestamp">
<wsu:Created>2012-04-26T06:46:06Z</wsu:Created>
<wsu:Expires>2012-04-26T06:51:06Z</wsu:Expires>
</wsu:Timestamp>
<wsse:BinarySecurityToken xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" wsu:Id="wsse-BinarySecurityToken">MIIE/jCCBGegAwIBAgIEQDfJZDANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQGEwJESzEMMAoGA1UEChMDVERDMSIwIAYDVQQDExlUREMgT0NFUyBTeXN0ZW10ZXN0IENBIElJMB4XDTExMDMwNzA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UTBPMQswCQYDVQQGEwJESzEMMAoGA1UEChMDVERDMSIwIAYDVQQDExlUREMgT0NFUyBTeXN0ZW10ZXN0IENBIElJMQ4wDAYDVQQDEwVDUkwyNjAxoC+gLYYraHR0cDovL3Rlc3QuY3JsLm9jZXMuY2VydGlmaWthdC5kay9vY2VzLmNybDAfBgNVHSMEGDAWgBQcmAlHGkw4uRDFBClb8fROgGrMfjAdBgNVHQ4EFgQUuFTJ/nE9jaKj5SAUgw8J2XXGD88wCQYDVR0TBAIwADAZBgkqhkiG9n0HQQAEDDAKGwRWNy4xAwIDqDANBgkqhkiG9w0BAQUFAAOBgQBbreDzsmcDPG88FiWsaBrxZSX1nu3RIsEJ50DK2HZRPY/Y/6KHnl3N3SNJ0M2c+1HE1ej/skoxSV+ziec1qOMS5Pd1asWF8gb0iuvuf0A4PtoiNOkjLxzExtQkorn2H7XIwqqBwgJZIQ7JBmGLEuX3JOQhMtWHxhram0qWvWJqVA==</wsse:BinarySecurityToken>
<ds:Signature
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:CanonicalizationMethod>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"></ds:SignatureMethod>
<ds:Reference URI="#SOAP-ENV-Body">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
<ds:DigestValue>MhOai3
+fLd4koWrVvo3r686XtZU=</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#wsu-Timestamp">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"></ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></ds:DigestMethod>
<ds:DigestValue>fB1k8xmUNncOCqgBVzbzbmY6C28=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>OJAGoJ42jHPIjVuTmk8dPYKAgHY1G0OEu2ti9A0q6EXJn1QVy
+LYn60/2LptU4G75VMekE12e0U3PYZFbI3pTjSraBYXav5jWdTDZO5U970gdF3XsiTpovz9Q
+CPkQcIdmLaE22vWdEWs06HVB6Y0/+YQ6rHpDfqGruLs8rDcgbQ=</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference>
<wsse:Reference URI="#wsse-BinarySecurityToken"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"></wsse:Reference>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="SOAP-ENV-Body">
<ns1:USKoeretoejRegistreringSekundaerErhvervListeHent_I
xmlns:ns1="http://skat.dk/dmr/2007/05/31/">
<ns2:HovedOplysninger xmlns:ns2="http://rep.oio.dk/skat.dk/basis/kontekst/xml/schemas/2006/09/01/">
<ns2:TransaktionIdentifikator>AZ123456</ns2:TransaktionIdentifikator>
<ns2:TransaktionTid>2012-04-26T06:46:06Z</ns2:TransaktionTid>
</ns2:HovedOplysninger>
<ns1:RegistreringNummerNummer>AZ123456</ns1:RegistreringNummerNummer>
</ns1:USKoeretoejRegistreringSekundaerErhvervListeHent_I>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Hvis flere point eller flere oplysninger kan hjælpe på svarene så sig endelig til så jeg om muligt kan give jer det ;-)
Mvh
Casper