You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by mjh <ma...@aol.com> on 2006/10/12 16:49:12 UTC

Empty message document in MessageContext when using wss4j

Hi all,

I am running into a bit of a thorny issue when invoking a wss4j(1.5)-secured
service deployed on Axis 1.4.  The scenario is as follows: a client
application sends an encrypted and signed request.  Server-side processing
of the message seems to occur at some level, as evidenced by traces of the
pushing and popping of the message elements in the axis logs.  However, by
the time the WSDoAllReceiver (or alternately an JAXRPCHandler wrapping a
WSS4JHandler) handles the request, the document that is parsed from the
message in the MessageContext is empty (no elements, no attributes).  In
other words, by the time Axis parses the message into a document to hand off
to the security handler, the document has no elements.  The security handler
then cannot find the security header and the inevitable Message Does not
Contain Required Security Header fault is thrown.

Working hypothesis at the moment are that something in the handler chain is
interfering with the handling of the message, or the distinct possibility of 

Attached are the server-side deploy.wsdd and the message itself (data
elements excluded).  Any insights or alternate hypotheses would be greatly
appreciated.

<<deploy.wsdd>>

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
    xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
    
    <service name="SevisService" provider="java:RPC" use="literal">
        <parameter name="className" value="xxx.MyService"/>
        <parameter name="allowedMethods" value="*"/>
        <parameter name="scope" value="application"/>
        <requestFlow>
            <handler
type="java:org.apache.ws.axis.security.WSDoAllReceiver">
                <parameter name="passwordCallbackClass"
value="xxx.PWCallback"/>
                <parameter name="action" value="Signature Encrypt"/>
                <parameter name="signaturePropFile"
value="xxx/xxx/crypto.properties" />
            </handler>
        </requestFlow>
    </service>

</deployment>


<<XML message>>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soap:Header>
        <wsse:Security soap:mustUnderstand="1"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <xenc:EncryptedKey Id="EncKeyId-11642082"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
                <xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
                <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                    <wsse:SecurityTokenReference
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                        <ds:X509Data
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                            <ds:X509IssuerSerial
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                                <ds:X509IssuerName
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">CN=xxx</ds:X509IssuerName>
                                <ds:X509SerialNumber
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">1152847318</ds:X509SerialNumber>
                            </ds:X509IssuerSerial>
                        </ds:X509Data>
                    </wsse:SecurityTokenReference>
                </ds:KeyInfo>
                <xenc:CipherData>
                    <xenc:CipherValue>xxx</xenc:CipherValue>
                </xenc:CipherData>
                <xenc:ReferenceList>
                    <xenc:DataReference URI="#EncDataId-31761534" />
                </xenc:ReferenceList>
            </xenc:EncryptedKey>
            <ds:Signature Id="Signature-14600371"
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/2001/10/xml-exc-c14n#"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" />
                    <ds:SignatureMethod
Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#" />
                    <ds:Reference URI="#id-31761534"
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/2001/10/xml-exc-c14n#"
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#">2DEywQQaKkgqNzGGmso9OE2/XKM=</ds:DigestValue>
                    </ds:Reference>
                </ds:SignedInfo>
                <ds:SignatureValue
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">xxx</ds:SignatureValue>
                <ds:KeyInfo Id="KeyId-9690924"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                    <wsse:SecurityTokenReference wsu:Id="STRId-25463023"
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">
                        <ds:X509Data
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                            <ds:X509IssuerSerial
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                                <ds:X509IssuerName
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">CN=xxx</ds:X509IssuerName>
                                <ds:X509SerialNumber
xmlns:ds="http://www.w3.org/2000/09/xmldsig#">xxx</ds:X509SerialNumber>
                            </ds:X509IssuerSerial>
                        </ds:X509Data>
                    </wsse:SecurityTokenReference>
                </ds:KeyInfo>
            </ds:Signature>
        </wsse:Security>
    </soap:Header>
    <soap:Body wsu:Id="id-31761534"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
        <xenc:EncryptedData Id="EncDataId-31761534"
Type="http://www.w3.org/2001/04/xmlenc#Content"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
            <xenc:EncryptionMethod
Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"
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#">xxx</xenc:CipherValue>
            </xenc:CipherData>
        </xenc:EncryptedData>
    </soap:Body>
</soap:Envelope>

Thanks and regards,
Mark
-- 
View this message in context: http://www.nabble.com/Empty-message-document-in-MessageContext-when-using-wss4j-tf2430768.html#a6777694
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org