The code is similar to the samples given by CreateSignature.java and VerifySignature.java. When I run the code in the same machine, verifying is successful. But if I put the code on two machines, one to create signature, the other to verify, verifying is failed for *Verification failed for URI "" *. Can anybody give me some suggestion? Thanks.
PS: The security soap message is as below <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=" http://www.w3.org/2001/XMLSchema" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header><wsse:Security<http://www.w3.org/2001/XMLSchema-instance%22%3E%3Csoapenv:Header%3E%3Cwsse:Security>xmlns:wsse=" http://schemas.xmlsoap.org/ws/2002/04/secext"/><ds:Signature<http://schemas.xmlsoap.org/ws/2002/04/secext%22/%3E%3Cds:Signature>xmlns:ds=" http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:CanonicalizationMethod Algorithm=" http://www.w3.org/TR/2001/REC-xml-c14n-20010315" xmlns:ds=" http://www.w3.org/2000/09/xmldsig#"/> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/> <ds:Reference URI="" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:Transforms xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:Transform Algorithm=" http://www.w3.org/2000/09/xmldsig#enveloped-signature" xmlns:ds=" http://www.w3.org/2000/09/xmldsig#"/> <ds:Transform Algorithm=" http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments" xmlns:ds=" http://www.w3.org/2000/09/xmldsig#"/> </ds:Transforms> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"/> <ds:DigestValue xmlns:ds=" http://www.w3.org/2000/09/xmldsig#">yx7ek5OheM5b+24yHpC1i9dlY5A=</ds:DigestValue > </ds:Reference> </ds:SignedInfo> <ds:SignatureValue xmlns:ds=" http://www.w3.org/2000/09/xmldsig#">SOJ+8AUgW/FcGbrWjJjoVrfqMd1+91tKEUOgWuTvKPcctDzV1HzFUA==</ds:SignatureValue > <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:X509Data xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:X509Certificate xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> MIIC9jCCArQCBDruqiowCwYHKoZIzjgEAwUAMGExCzAJBgNVBAYTAkRFMR0wGwYDVQQKExRVbml2 ZXJzaXR5IG9mIFNpZWdlbjEQMA4GA1UECxMHRkIxMk5VRTEhMB8GA1UEAxMYQ2hyaXN0aWFuIEdl dWVyLVBvbGxtYW5uMB4XDTAxMDUwMTEyMjA1OFoXDTA2MTAyMjEyMjA1OFowYTELMAkGA1UEBhMC REUxHTAbBgNVBAoTFFVuaXZlcnNpdHkgb2YgU2llZ2VuMRAwDgYDVQQLEwdGQjEyTlVFMSEwHwYD VQQDExhDaHJpc3RpYW4gR2V1ZXItUG9sbG1hbm4wggG3MIIBLAYHKoZIzjgEATCCAR8CgYEA/X9T gR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuAHTRv 8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOuK2HX Ku/yIgMZndFIAccCFQCXYFCPFSMLzLKSuYKi64QL8Fgc9QKBgQD34aCF1ps93su8q1w2uFe5eZSv u/o66oL5V0wLPQeCZ1FZV4661FlP5nEHEIGAtEkWcSPoTCgWE7fPCTKMyKbhPBZ6i1R8jSjgo64e K7OmdZFuo38L+iE1YvH7YnoBJDvMpPG+qFGQiaiD3+Fa5Z8GkotmXoB7VSVkAUw7/s9JKgOBhAAC gYASWfn+G1k/nWntj9jX7Nk5JKaiLZ9BLR16eJJxqff33THLfdGs98Xmh2oRWZVh9PMV8oTP3hpR cRipjZUZVEIqsBlOGTVLCg4H5TJ81JWOiprh+mkhClNqUr8l5Hu7FBSvQB6inryeva7j0aKNiIvK 8vfHTiUZpnyNRhkveBlM0jALBgcqhkjOOAQDBQADLwAwLAIUPDd/UmB9GeHqvGjny30Bvjt0AkUC FA9ab72kKuB5geYGeckbBrcgPnZk </ds:X509Certificate> </ds:X509Data> <ds:KeyValue xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:DSAKeyValue xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> <ds:P xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> /X9TgR11EilS30qcLuzk5/YRt1I870QAwx4/gLZRJmlFXUAiUftZPY1Y+r/F9bow9subVWzXgTuA HTRv8mZgt2uZUKWkn5/oBHsQIsJPu6nX/rfGG/g7V+fGqKYVDwT7g/bTxR7DAjVUE1oWkTL2dfOu K2HXKu/yIgMZndFIAcc= </ds:P> <ds:Q xmlns:ds=" http://www.w3.org/2000/09/xmldsig#">l2BQjxUjC8yykrmCouuEC/BYHPU=</ds:Q> <ds:G xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> 9+GghdabPd7LvKtcNrhXuXmUr7v6OuqC+VdMCz0HgmdRWVeOutRZT+ZxBxCBgLRJFnEj6EwoFhO3 zwkyjMim4TwWeotUfI0o4KOuHiuzpnWRbqN/C/ohNWLx+2J6ASQ7zKTxvqhRkImog9/hWuWfBpKL Zl6Ae1UlZAFMO/7PSSo= </ds:G> <ds:Y xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> Eln5/htZP51p7Y/Y1+zZOSSmoi2fQS0deniScan3990xy33RrPfF5odqEVmVYfTzFfKEz94aUXEY qY2VGVRCKrAZThk1SwoOB+UyfNSVjoqa4fppIQpTalK/JeR7uxQUr0Aeop68nr2u49GijYiLyvL3 x04lGaZ8jUYZL3gZTNI= </ds:Y> </ds:DSAKeyValue> </ds:KeyValue> </ds:KeyInfo> </ds:Signature></soapenv:Header><soapenv:Body><xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Type=" http://www.w3.org/2001/04/xmlenc#Content"><xenc:EncryptionMethod Algorithm=" http://www.w3.org/2001/04/xmlenc#aes128-cbc" xmlns:xenc=" http://www.w3.org/2001/04/xmlenc#"/><ds:KeyInfo xmlns:ds=" http://www.w3.org/2000/09/xmldsig#"> <xenc:EncryptedKey xmlns:xenc=" http://www.w3.org/2001/04/xmlenc#"><xenc:EncryptionMethod Algorithm=" http://www.w3.org/2001/04/xmlenc#kw-tripledes" xmlns:xenc=" http://www.w3.org/2001/04/xmlenc#"/><xenc:CipherData xmlns:xenc=" http://www.w3.org/2001/04/xmlenc#"><xenc:CipherValue xmlns:xenc=" http://www.w3.org/2001/04/xmlenc#">BGLYZF7nslzdhtZ17z0L/TW3BM2wn+ytuFmfGX7PRyE=</xenc:CipherValue></xenc:CipherData></xenc:EncryptedKey></ds:KeyInfo><xenc:CipherDataxmlns:xenc=" http://www.w3.org/2001/04/xmlenc#"><xenc:CipherValue xmlns:xenc=" http://www.w3.org/2001/04/xmlenc#">lF0XyaOyWkIy4lFWFSkjTwW9md/FnDVXkV+nJ3Je05Ej8iq9zeyhS6s/c5cmE4gakd8pWf/ydLQm JEL+fPpb1TqeOlSa9zfGrnXge85omvlkBgppm/D1ixUHr1mgCr8YdEEJpACQaysPiF/S0JOpAgmj T7bn19CnQWxz39i58eUGpSEtm4EmyJhHB/iCAMoMgP54SaAWcLUGsWO+umWWZh+PflCFC2tVwCzf wPnMnndX+BzSWv9KRP2jJsDJipU+Q7VYqj08b4PWd060H6XY5jKi1VLUMn1uP1jublQLr1Y=</xenc:CipherValue></xenc:CipherData></xenc:EncryptedData></soapenv:Body></soapenv:Envelope> -- http://sourceforge.net/projects/mycodeline/ http://rubyforge.org/projects/ropenwiki/