Elem, poruka treba da izgleda kao:
Code:
<soapenv:Envelope xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsse="http://docs.oasis-open.org/wss...-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss...wss-wssecurity-utility-1.0.xsd"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pid="http://pid.purs.gov.rs">
<soapenv:Header>
<wsse:Security>
<ds:Signature>
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#X509-sertifikatId">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>...</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#id-1">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>...</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>...</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference>
<wsse:Reference URI="#X509-sertifikatId"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
<wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss...sage-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss...-x509-token-profile-1.0#X509v3" wsu:Id="X509-sertifikatId">
...
</wsse:BinarySecurityToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body wsu:Id="id-1">
...
</soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsse="http://docs.oasis-open.org/wss...-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss...wss-wssecurity-utility-1.0.xsd"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pid="http://pid.purs.gov.rs">
<soapenv:Header>
<wsse:Security>
<ds:Signature>
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<ds:Reference URI="#X509-sertifikatId">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>...</ds:DigestValue>
</ds:Reference>
<ds:Reference URI="#id-1">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<ds:DigestValue>...</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>...</ds:SignatureValue>
<ds:KeyInfo>
<wsse:SecurityTokenReference>
<wsse:Reference URI="#X509-sertifikatId"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
<wsse:BinarySecurityToken EncodingType="http://docs.oasis-open.org/wss...sage-security-1.0#Base64Binary" ValueType="http://docs.oasis-open.org/wss...-x509-token-profile-1.0#X509v3" wsu:Id="X509-sertifikatId">
...
</wsse:BinarySecurityToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body wsu:Id="id-1">
...
</soapenv:Body>
</soapenv:Envelope>
Potpisuje se ceo body deo.
Elem imam 3 mogućnosti:
1) spring framework - ima lep deo za web servise i već sam koristio za neki ranije. Koristio bi Wss4jSecurityInterceptor ili XwsSecurityInterceptor i ima gomila primera i dokumentacije ali je problem što ja za potpisivanje koristim smart karticu a u svim primerima se koristi keystore koji se nalazi na disku. E sad dal ima i neka podrška za smart kartice ili neki drugi način nisam video.
2) Axis - da naštrikam SOAPMessage (već uradio), pa da to potpišem i da ubacim u header - nalazio sam neke primere ali ako neko ima direktnog iskustva ili neki primer bilo bi super
3) Šta god, imam malo iskustva sa web servisima i još manje sa digitalnim potpisivanjem pa ako ima nešto drugo slobodno recite
Uglavnom, ako ima neki sapatnik rado ću primiti svaki savet :)