You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by Lule Chen <ll...@nortel.com> on 2007/02/23 20:31:07 UTC

Null pointer exception when calling WSSecEncrypt.prepare()

Hi, dims:

I adopted the code in TestWSSecurityNew15.java that encrypts the soap body, but I got the null pointer exception as the following:

Exception in thread "main" java.lang.NullPointerException
        at org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
        at com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.java:240)

I looked at the line of code in WSSecEncrypt.java, it seems failed at 
 
                this.symmetricKey = keyGen.generateKey();

I suspect that keyGen is null. My code snips are as the following:
 
    static final WSSecurityEngine secEngine = new WSSecurityEngine();
    static final Crypto crypto = CryptoFactory.getInstance("cryptoSKI.properties");

...
 
        SOAPEnvelope env = new SOAPEnvelope(new ByteArrayInputStream(byteBuf));
 
        WSSecEncrypt encrypt = new WSSecEncrypt();
        encrypt.setUserInfo("wss4jcert", "security");
        encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
        encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");

        Document doc = env.getAsDocument();
 
        WSSecHeader secHeader = new WSSecHeader();
        secHeader.insertSecurityHeader(doc);
        encrypt.prepare(doc, crypto);
        
...
 
Do you have any idea whats wrong of my code?
 
Thanks,
 
 
Lule

 


RE: Null pointer exception when calling WSSecEncrypt.prepare()

Posted by Lule Chen <ll...@nortel.com>.
Thanks, Ruchith:

The null pointer was caused by server side not configured properly. But now I am facing another problem. I am using a standalone java application to access the web service. I use the code copied from the TestWSSecurityNew6 class to encrypt and sign the soap envelope. I configured the deploy.wsdd on server side as the following:

    <requestFlow>
      <handler name="DoSecurityReceiver" type="java:org.apache.ws.axis.security.WSDoAllReceiver">
      	<parameter name="user" value="wss4jcert"/>
      	<parameter name="mustUnderstand" value="false"/>
      	<parameter name="timestampStrict" value="false"/>
      	<parameter name="passwordCallbackClass" value="com.nortel.ca.wcars2g7.axis.services.NEService.PWCallback"/>
      	<parameter name="action" value="Encrypt Signature"/>
      	<parameter name="enableSignatureConfirmation" value="false" />
      	<parameter name="decryptionPropFile" value="cryptoSKI.properties" />
      	<parameter name="signaturePropFile" value="cryptoSKI.properties" />
      	<parameter name="decryptionKeyIdentifier" value="X509KeyIdentifier" />
      </handler>
    </requestFlow>

And my client can access the web service and get the result back correctly. Once I try to configure the "responseFlow" on server side to encrypt and sign the soap envelope, it begins to throw various exceptions. My question is how can I hook the security header processing handler to my standalone client application and what is the correct responseFlow configuration on the server side that will encrypt and sign the evelope as exactly the same as my client does?

Thanks for your time.

Lule

-----Original Message-----
From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com] 
Sent: Wednesday, February 28, 2007 11:19 AM
To: Chen, Lule (CAR:2Y83)
Cc: dims@apache.org; José Ferreiro; wss4j-dev@ws.apache.org
Subject: Re: Null pointer exception when calling WSSecEncrypt.prepare()


Hi,

hmm ... this seems to be an Axis 1.x issue ... unfortunately I'm not an expert on it :-(

Thanks,
Ruchith

On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
> Thanks, Ruchith. That solves my problem. I simply copied the code from 
> the test program. But now I got the following fault:
>
> Exception in thread "main" AxisFault
>  faultCode: 
> {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode:
>  faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
>  faultActor:
>  faultNode:
>  faultDetail:
>         {http://xml.apache.org/axis/}hostname:wcars2g7.ca.nortel.com
>
> org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
>         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
>         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
>         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
>         at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
>         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
>         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
>         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
>         at org.apache.axis.client.Call.invoke(Call.java:2767)
>         at org.apache.axis.client.Call.invoke(Call.java:1870)
>
> After I encrypted the document and converted it into SOAP message, I 
> passed the SOAP message to the org.apache.axis.client.Call.invoke, 
> then I got the above soap fault.
>
> I am wondering after I encrypted the document, if I need to register 
> the related serializer/deserializer?
>
> Lule
> -----Original Message-----
> From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com]
> Sent: Friday, February 23, 2007 10:53 PM
> To: Chen, Lule (CAR:2Y83)
> Cc: dims@apache.org; José Ferreiro; wss4j-dev@ws.apache.org
> Subject: Re: Null pointer exception when calling 
> WSSecEncrypt.prepare()
>
>
> Hi,
>
> The problem is in this line : 
> encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
>
> Please change it to : 
> encrypt.setSymmetricEncAlgorithm(org.apache.ws.security.WSConstants.TR
> IPLE_DES);
>
> Also you can change :
> encrypt.setUserInfo("wss4jcert", "security");
> to
> encrypt.setUserInfo("wss4jcert");
> since for encryption you just need to have the public key. We do not 
> require the key password to retrieve the public key.
>
> Thanks,
> Ruchith
>
> On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
> >
> >
> >
> > Hi, dims:
> >
> > I adopted the code in TestWSSecurityNew15.java that encrypts the 
> > soap body, but I got the null pointer exception as the following:
> >
> > Exception in thread "main" java.lang.NullPointerException
> >         at
> > org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
> >         at
> > com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.jav
> > a:
> > 240)
> >
> > I looked at the line of code in WSSecEncrypt.java, it seems failed 
> > at
> >
> >                 this.symmetricKey = keyGen.generateKey();
> >
> > I suspect that keyGen is null. My code snips are as the following:
> >
> >     static final WSSecurityEngine secEngine = new WSSecurityEngine();
> >     static final Crypto crypto = 
> > CryptoFactory.getInstance("cryptoSKI.properties");
> >
> > ...
> >
> >         SOAPEnvelope env = new SOAPEnvelope(new 
> > ByteArrayInputStream(byteBuf));
> >
> >         WSSecEncrypt encrypt = new WSSecEncrypt();
> >         encrypt.setUserInfo("wss4jcert", "security");
> >
> > encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
> >
> > encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
> >
> >         Document doc = env.getAsDocument();
> >
> >         WSSecHeader secHeader = new WSSecHeader();
> >         secHeader.insertSecurityHeader(doc);
> >         encrypt.prepare(doc, crypto);
> >
> > ...
> >
> > Do you have any idea whats wrong of my code?
> >
> > Thanks,
> >
> >
> > Lule
> >
> >
>
>
> --
> www.ruchith.org
> www.wso2.org
>


-- 
www.ruchith.org
www.wso2.org

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


RE: Null pointer exception when calling WSSecEncrypt.prepare()

Posted by Lule Chen <ll...@nortel.com>.
Thanks, Ruchith:

The null pointer was caused by server side not configured properly. But now I am facing another problem. I am using a standalone java application to access the web service. I use the code copied from the TestWSSecurityNew6 class to encrypt and sign the soap envelope. I configured the deploy.wsdd on server side as the following:

    <requestFlow>
      <handler name="DoSecurityReceiver" type="java:org.apache.ws.axis.security.WSDoAllReceiver">
      	<parameter name="user" value="wss4jcert"/>
      	<parameter name="mustUnderstand" value="false"/>
      	<parameter name="timestampStrict" value="false"/>
      	<parameter name="passwordCallbackClass" value="com.nortel.ca.wcars2g7.axis.services.NEService.PWCallback"/>
      	<parameter name="action" value="Encrypt Signature"/>
      	<parameter name="enableSignatureConfirmation" value="false" />
      	<parameter name="decryptionPropFile" value="cryptoSKI.properties" />
      	<parameter name="signaturePropFile" value="cryptoSKI.properties" />
      	<parameter name="decryptionKeyIdentifier" value="X509KeyIdentifier" />
      </handler>
    </requestFlow>

And my client can access the web service and get the result back correctly. Once I try to configure the "responseFlow" on server side to encrypt and sign the soap envelope, it begins to throw various exceptions. My question is how can I hook the security header processing handler to my standalone client application and what is the correct responseFlow configuration on the server side that will encrypt and sign the evelope as exactly the same as my client does?

Thanks for your time.

Lule

-----Original Message-----
From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com] 
Sent: Wednesday, February 28, 2007 11:19 AM
To: Chen, Lule (CAR:2Y83)
Cc: dims@apache.org; José Ferreiro; wss4j-dev@ws.apache.org
Subject: Re: Null pointer exception when calling WSSecEncrypt.prepare()


Hi,

hmm ... this seems to be an Axis 1.x issue ... unfortunately I'm not an expert on it :-(

Thanks,
Ruchith

On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
> Thanks, Ruchith. That solves my problem. I simply copied the code from 
> the test program. But now I got the following fault:
>
> Exception in thread "main" AxisFault
>  faultCode: 
> {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode:
>  faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
>  faultActor:
>  faultNode:
>  faultDetail:
>         {http://xml.apache.org/axis/}hostname:wcars2g7.ca.nortel.com
>
> org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
>         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
>         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
>         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
>         at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
>         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
>         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
>         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
>         at org.apache.axis.client.Call.invoke(Call.java:2767)
>         at org.apache.axis.client.Call.invoke(Call.java:1870)
>
> After I encrypted the document and converted it into SOAP message, I 
> passed the SOAP message to the org.apache.axis.client.Call.invoke, 
> then I got the above soap fault.
>
> I am wondering after I encrypted the document, if I need to register 
> the related serializer/deserializer?
>
> Lule
> -----Original Message-----
> From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com]
> Sent: Friday, February 23, 2007 10:53 PM
> To: Chen, Lule (CAR:2Y83)
> Cc: dims@apache.org; José Ferreiro; wss4j-dev@ws.apache.org
> Subject: Re: Null pointer exception when calling 
> WSSecEncrypt.prepare()
>
>
> Hi,
>
> The problem is in this line : 
> encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
>
> Please change it to : 
> encrypt.setSymmetricEncAlgorithm(org.apache.ws.security.WSConstants.TR
> IPLE_DES);
>
> Also you can change :
> encrypt.setUserInfo("wss4jcert", "security");
> to
> encrypt.setUserInfo("wss4jcert");
> since for encryption you just need to have the public key. We do not 
> require the key password to retrieve the public key.
>
> Thanks,
> Ruchith
>
> On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
> >
> >
> >
> > Hi, dims:
> >
> > I adopted the code in TestWSSecurityNew15.java that encrypts the 
> > soap body, but I got the null pointer exception as the following:
> >
> > Exception in thread "main" java.lang.NullPointerException
> >         at
> > org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
> >         at
> > com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.jav
> > a:
> > 240)
> >
> > I looked at the line of code in WSSecEncrypt.java, it seems failed 
> > at
> >
> >                 this.symmetricKey = keyGen.generateKey();
> >
> > I suspect that keyGen is null. My code snips are as the following:
> >
> >     static final WSSecurityEngine secEngine = new WSSecurityEngine();
> >     static final Crypto crypto = 
> > CryptoFactory.getInstance("cryptoSKI.properties");
> >
> > ...
> >
> >         SOAPEnvelope env = new SOAPEnvelope(new 
> > ByteArrayInputStream(byteBuf));
> >
> >         WSSecEncrypt encrypt = new WSSecEncrypt();
> >         encrypt.setUserInfo("wss4jcert", "security");
> >
> > encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
> >
> > encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
> >
> >         Document doc = env.getAsDocument();
> >
> >         WSSecHeader secHeader = new WSSecHeader();
> >         secHeader.insertSecurityHeader(doc);
> >         encrypt.prepare(doc, crypto);
> >
> > ...
> >
> > Do you have any idea whats wrong of my code?
> >
> > Thanks,
> >
> >
> > Lule
> >
> >
>
>
> --
> www.ruchith.org
> www.wso2.org
>


-- 
www.ruchith.org
www.wso2.org

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


Re: Null pointer exception when calling WSSecEncrypt.prepare()

Posted by Ruchith Fernando <ru...@gmail.com>.
Hi,

hmm ... this seems to be an Axis 1.x issue ... unfortunately I'm not
an expert on it :-(

Thanks,
Ruchith

On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
> Thanks, Ruchith. That solves my problem. I simply copied the code from the test program. But now I got the following fault:
>
> Exception in thread "main" AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode:
>  faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
>  faultActor:
>  faultNode:
>  faultDetail:
>         {http://xml.apache.org/axis/}hostname:wcars2g7.ca.nortel.com
>
> org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
>         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
>         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
>         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
>         at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
>         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
>         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
>         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
>         at org.apache.axis.client.Call.invoke(Call.java:2767)
>         at org.apache.axis.client.Call.invoke(Call.java:1870)
>
> After I encrypted the document and converted it into SOAP message, I passed the SOAP message to the org.apache.axis.client.Call.invoke, then I got the above soap fault.
>
> I am wondering after I encrypted the document, if I need to register the related serializer/deserializer?
>
> Lule
> -----Original Message-----
> From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com]
> Sent: Friday, February 23, 2007 10:53 PM
> To: Chen, Lule (CAR:2Y83)
> Cc: dims@apache.org; José Ferreiro; wss4j-dev@ws.apache.org
> Subject: Re: Null pointer exception when calling WSSecEncrypt.prepare()
>
>
> Hi,
>
> The problem is in this line : encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
>
> Please change it to : encrypt.setSymmetricEncAlgorithm(org.apache.ws.security.WSConstants.TRIPLE_DES);
>
> Also you can change :
> encrypt.setUserInfo("wss4jcert", "security");
> to
> encrypt.setUserInfo("wss4jcert");
> since for encryption you just need to have the public key. We do not require the key password to retrieve the public key.
>
> Thanks,
> Ruchith
>
> On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
> >
> >
> >
> > Hi, dims:
> >
> > I adopted the code in TestWSSecurityNew15.java that encrypts the soap
> > body, but I got the null pointer exception as the following:
> >
> > Exception in thread "main" java.lang.NullPointerException
> >         at
> > org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
> >         at
> > com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.java:
> > 240)
> >
> > I looked at the line of code in WSSecEncrypt.java, it seems failed at
> >
> >                 this.symmetricKey = keyGen.generateKey();
> >
> > I suspect that keyGen is null. My code snips are as the following:
> >
> >     static final WSSecurityEngine secEngine = new WSSecurityEngine();
> >     static final Crypto crypto =
> > CryptoFactory.getInstance("cryptoSKI.properties");
> >
> > ...
> >
> >         SOAPEnvelope env = new SOAPEnvelope(new
> > ByteArrayInputStream(byteBuf));
> >
> >         WSSecEncrypt encrypt = new WSSecEncrypt();
> >         encrypt.setUserInfo("wss4jcert", "security");
> >
> > encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
> >
> > encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
> >
> >         Document doc = env.getAsDocument();
> >
> >         WSSecHeader secHeader = new WSSecHeader();
> >         secHeader.insertSecurityHeader(doc);
> >         encrypt.prepare(doc, crypto);
> >
> > ...
> >
> > Do you have any idea whats wrong of my code?
> >
> > Thanks,
> >
> >
> > Lule
> >
> >
>
>
> --
> www.ruchith.org
> www.wso2.org
>


-- 
www.ruchith.org
www.wso2.org

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


Re: Null pointer exception when calling WSSecEncrypt.prepare()

Posted by Ruchith Fernando <ru...@gmail.com>.
Hi,

hmm ... this seems to be an Axis 1.x issue ... unfortunately I'm not
an expert on it :-(

Thanks,
Ruchith

On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
> Thanks, Ruchith. That solves my problem. I simply copied the code from the test program. But now I got the following fault:
>
> Exception in thread "main" AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode:
>  faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
>  faultActor:
>  faultNode:
>  faultDetail:
>         {http://xml.apache.org/axis/}hostname:wcars2g7.ca.nortel.com
>
> org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
>         at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
>         at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
>         at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
>         at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
>         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
>         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
>         at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
>         at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
>         at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
>         at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
>         at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
>         at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
>         at org.apache.axis.client.Call.invoke(Call.java:2767)
>         at org.apache.axis.client.Call.invoke(Call.java:1870)
>
> After I encrypted the document and converted it into SOAP message, I passed the SOAP message to the org.apache.axis.client.Call.invoke, then I got the above soap fault.
>
> I am wondering after I encrypted the document, if I need to register the related serializer/deserializer?
>
> Lule
> -----Original Message-----
> From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com]
> Sent: Friday, February 23, 2007 10:53 PM
> To: Chen, Lule (CAR:2Y83)
> Cc: dims@apache.org; José Ferreiro; wss4j-dev@ws.apache.org
> Subject: Re: Null pointer exception when calling WSSecEncrypt.prepare()
>
>
> Hi,
>
> The problem is in this line : encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
>
> Please change it to : encrypt.setSymmetricEncAlgorithm(org.apache.ws.security.WSConstants.TRIPLE_DES);
>
> Also you can change :
> encrypt.setUserInfo("wss4jcert", "security");
> to
> encrypt.setUserInfo("wss4jcert");
> since for encryption you just need to have the public key. We do not require the key password to retrieve the public key.
>
> Thanks,
> Ruchith
>
> On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
> >
> >
> >
> > Hi, dims:
> >
> > I adopted the code in TestWSSecurityNew15.java that encrypts the soap
> > body, but I got the null pointer exception as the following:
> >
> > Exception in thread "main" java.lang.NullPointerException
> >         at
> > org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
> >         at
> > com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.java:
> > 240)
> >
> > I looked at the line of code in WSSecEncrypt.java, it seems failed at
> >
> >                 this.symmetricKey = keyGen.generateKey();
> >
> > I suspect that keyGen is null. My code snips are as the following:
> >
> >     static final WSSecurityEngine secEngine = new WSSecurityEngine();
> >     static final Crypto crypto =
> > CryptoFactory.getInstance("cryptoSKI.properties");
> >
> > ...
> >
> >         SOAPEnvelope env = new SOAPEnvelope(new
> > ByteArrayInputStream(byteBuf));
> >
> >         WSSecEncrypt encrypt = new WSSecEncrypt();
> >         encrypt.setUserInfo("wss4jcert", "security");
> >
> > encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
> >
> > encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
> >
> >         Document doc = env.getAsDocument();
> >
> >         WSSecHeader secHeader = new WSSecHeader();
> >         secHeader.insertSecurityHeader(doc);
> >         encrypt.prepare(doc, crypto);
> >
> > ...
> >
> > Do you have any idea whats wrong of my code?
> >
> > Thanks,
> >
> >
> > Lule
> >
> >
>
>
> --
> www.ruchith.org
> www.wso2.org
>


-- 
www.ruchith.org
www.wso2.org

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


RE: Null pointer exception when calling WSSecEncrypt.prepare()

Posted by Lule Chen <ll...@nortel.com>.
Thanks, Ruchith. That solves my problem. I simply copied the code from the test program. But now I got the following fault:

Exception in thread "main" AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
 faultActor: 
 faultNode: 
 faultDetail: 
	{http://xml.apache.org/axis/}hostname:wcars2g7.ca.nortel.com

org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
	at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
	at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
	at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
	at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
	at org.apache.axis.client.Call.invoke(Call.java:2767)
	at org.apache.axis.client.Call.invoke(Call.java:1870)

After I encrypted the document and converted it into SOAP message, I passed the SOAP message to the org.apache.axis.client.Call.invoke, then I got the above soap fault. 

I am wondering after I encrypted the document, if I need to register the related serializer/deserializer?

Lule
-----Original Message-----
From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com] 
Sent: Friday, February 23, 2007 10:53 PM
To: Chen, Lule (CAR:2Y83)
Cc: dims@apache.org; José Ferreiro; wss4j-dev@ws.apache.org
Subject: Re: Null pointer exception when calling WSSecEncrypt.prepare()


Hi,

The problem is in this line : encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");

Please change it to : encrypt.setSymmetricEncAlgorithm(org.apache.ws.security.WSConstants.TRIPLE_DES);

Also you can change :
encrypt.setUserInfo("wss4jcert", "security");
to
encrypt.setUserInfo("wss4jcert");
since for encryption you just need to have the public key. We do not require the key password to retrieve the public key.

Thanks,
Ruchith

On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
>
>
>
> Hi, dims:
>
> I adopted the code in TestWSSecurityNew15.java that encrypts the soap 
> body, but I got the null pointer exception as the following:
>
> Exception in thread "main" java.lang.NullPointerException
>         at
> org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
>         at
> com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.java:
> 240)
>
> I looked at the line of code in WSSecEncrypt.java, it seems failed at
>
>                 this.symmetricKey = keyGen.generateKey();
>
> I suspect that keyGen is null. My code snips are as the following:
>
>     static final WSSecurityEngine secEngine = new WSSecurityEngine();
>     static final Crypto crypto = 
> CryptoFactory.getInstance("cryptoSKI.properties");
>
> ...
>
>         SOAPEnvelope env = new SOAPEnvelope(new 
> ByteArrayInputStream(byteBuf));
>
>         WSSecEncrypt encrypt = new WSSecEncrypt();
>         encrypt.setUserInfo("wss4jcert", "security");
>
> encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
>
> encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
>
>         Document doc = env.getAsDocument();
>
>         WSSecHeader secHeader = new WSSecHeader();
>         secHeader.insertSecurityHeader(doc);
>         encrypt.prepare(doc, crypto);
>
> ...
>
> Do you have any idea whats wrong of my code?
>
> Thanks,
>
>
> Lule
>
>


-- 
www.ruchith.org
www.wso2.org

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


RE: Null pointer exception when calling WSSecEncrypt.prepare()

Posted by Lule Chen <ll...@nortel.com>.
Thanks, Ruchith. That solves my problem. I simply copied the code from the test program. But now I got the following fault:

Exception in thread "main" AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
 faultActor: 
 faultNode: 
 faultDetail: 
	{http://xml.apache.org/axis/}hostname:wcars2g7.ca.nortel.com

org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
	at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
	at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
	at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
	at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
	at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
	at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
	at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
	at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
	at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
	at org.apache.axis.client.Call.invoke(Call.java:2767)
	at org.apache.axis.client.Call.invoke(Call.java:1870)

After I encrypted the document and converted it into SOAP message, I passed the SOAP message to the org.apache.axis.client.Call.invoke, then I got the above soap fault. 

I am wondering after I encrypted the document, if I need to register the related serializer/deserializer?

Lule
-----Original Message-----
From: Ruchith Fernando [mailto:ruchith.fernando@gmail.com] 
Sent: Friday, February 23, 2007 10:53 PM
To: Chen, Lule (CAR:2Y83)
Cc: dims@apache.org; José Ferreiro; wss4j-dev@ws.apache.org
Subject: Re: Null pointer exception when calling WSSecEncrypt.prepare()


Hi,

The problem is in this line : encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");

Please change it to : encrypt.setSymmetricEncAlgorithm(org.apache.ws.security.WSConstants.TRIPLE_DES);

Also you can change :
encrypt.setUserInfo("wss4jcert", "security");
to
encrypt.setUserInfo("wss4jcert");
since for encryption you just need to have the public key. We do not require the key password to retrieve the public key.

Thanks,
Ruchith

On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
>
>
>
> Hi, dims:
>
> I adopted the code in TestWSSecurityNew15.java that encrypts the soap 
> body, but I got the null pointer exception as the following:
>
> Exception in thread "main" java.lang.NullPointerException
>         at
> org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
>         at
> com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.java:
> 240)
>
> I looked at the line of code in WSSecEncrypt.java, it seems failed at
>
>                 this.symmetricKey = keyGen.generateKey();
>
> I suspect that keyGen is null. My code snips are as the following:
>
>     static final WSSecurityEngine secEngine = new WSSecurityEngine();
>     static final Crypto crypto = 
> CryptoFactory.getInstance("cryptoSKI.properties");
>
> ...
>
>         SOAPEnvelope env = new SOAPEnvelope(new 
> ByteArrayInputStream(byteBuf));
>
>         WSSecEncrypt encrypt = new WSSecEncrypt();
>         encrypt.setUserInfo("wss4jcert", "security");
>
> encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
>
> encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
>
>         Document doc = env.getAsDocument();
>
>         WSSecHeader secHeader = new WSSecHeader();
>         secHeader.insertSecurityHeader(doc);
>         encrypt.prepare(doc, crypto);
>
> ...
>
> Do you have any idea whats wrong of my code?
>
> Thanks,
>
>
> Lule
>
>


-- 
www.ruchith.org
www.wso2.org

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


Re: Null pointer exception when calling WSSecEncrypt.prepare()

Posted by Ruchith Fernando <ru...@gmail.com>.
Hi,

The problem is in this line :
encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");

Please change it to :
encrypt.setSymmetricEncAlgorithm(org.apache.ws.security.WSConstants.TRIPLE_DES);

Also you can change :
encrypt.setUserInfo("wss4jcert", "security");
to
encrypt.setUserInfo("wss4jcert");
since for encryption you just need to have the public key. We do not
require the key password to retrieve the public key.

Thanks,
Ruchith

On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
>
>
>
> Hi, dims:
>
> I adopted the code in TestWSSecurityNew15.java that encrypts the soap body,
> but I got the null pointer exception as the following:
>
> Exception in thread "main" java.lang.NullPointerException
>         at
> org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
>         at
> com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.java:240)
>
> I looked at the line of code in WSSecEncrypt.java, it seems failed at
>
>                 this.symmetricKey = keyGen.generateKey();
>
> I suspect that keyGen is null. My code snips are as the following:
>
>     static final WSSecurityEngine secEngine = new WSSecurityEngine();
>     static final Crypto crypto =
> CryptoFactory.getInstance("cryptoSKI.properties");
>
> ...
>
>         SOAPEnvelope env = new SOAPEnvelope(new
> ByteArrayInputStream(byteBuf));
>
>         WSSecEncrypt encrypt = new WSSecEncrypt();
>         encrypt.setUserInfo("wss4jcert", "security");
>
> encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
>
> encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
>
>         Document doc = env.getAsDocument();
>
>         WSSecHeader secHeader = new WSSecHeader();
>         secHeader.insertSecurityHeader(doc);
>         encrypt.prepare(doc, crypto);
>
> ...
>
> Do you have any idea whats wrong of my code?
>
> Thanks,
>
>
> Lule
>
>


-- 
www.ruchith.org
www.wso2.org

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


Re: Null pointer exception when calling WSSecEncrypt.prepare()

Posted by Ruchith Fernando <ru...@gmail.com>.
Hi,

The problem is in this line :
encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");

Please change it to :
encrypt.setSymmetricEncAlgorithm(org.apache.ws.security.WSConstants.TRIPLE_DES);

Also you can change :
encrypt.setUserInfo("wss4jcert", "security");
to
encrypt.setUserInfo("wss4jcert");
since for encryption you just need to have the public key. We do not
require the key password to retrieve the public key.

Thanks,
Ruchith

On 2/24/07, Lule Chen <ll...@nortel.com> wrote:
>
>
>
> Hi, dims:
>
> I adopted the code in TestWSSecurityNew15.java that encrypts the soap body,
> but I got the null pointer exception as the following:
>
> Exception in thread "main" java.lang.NullPointerException
>         at
> org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
>         at
> com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.java:240)
>
> I looked at the line of code in WSSecEncrypt.java, it seems failed at
>
>                 this.symmetricKey = keyGen.generateKey();
>
> I suspect that keyGen is null. My code snips are as the following:
>
>     static final WSSecurityEngine secEngine = new WSSecurityEngine();
>     static final Crypto crypto =
> CryptoFactory.getInstance("cryptoSKI.properties");
>
> ...
>
>         SOAPEnvelope env = new SOAPEnvelope(new
> ByteArrayInputStream(byteBuf));
>
>         WSSecEncrypt encrypt = new WSSecEncrypt();
>         encrypt.setUserInfo("wss4jcert", "security");
>
> encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
>
> encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
>
>         Document doc = env.getAsDocument();
>
>         WSSecHeader secHeader = new WSSecHeader();
>         secHeader.insertSecurityHeader(doc);
>         encrypt.prepare(doc, crypto);
>
> ...
>
> Do you have any idea whats wrong of my code?
>
> Thanks,
>
>
> Lule
>
>


-- 
www.ruchith.org
www.wso2.org

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


Re: Null pointer exception when calling WSSecEncrypt.prepare()

Posted by Davanum Srinivas <da...@gmail.com>.
Lule,

Hopefully Ruchith will chime in, i have no clue :)

-- dims

On 2/23/07, Lule Chen <ll...@nortel.com> wrote:
>
>
>
> Hi, dims:
>
> I adopted the code in TestWSSecurityNew15.java that encrypts the soap body,
> but I got the null pointer exception as the following:
>
> Exception in thread "main" java.lang.NullPointerException
>         at
> org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
>         at
> com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.java:240)
>
> I looked at the line of code in WSSecEncrypt.java, it seems failed at
>
>                 this.symmetricKey = keyGen.generateKey();
>
> I suspect that keyGen is null. My code snips are as the following:
>
>     static final WSSecurityEngine secEngine = new WSSecurityEngine();
>     static final Crypto crypto =
> CryptoFactory.getInstance("cryptoSKI.properties");
>
> ...
>
>         SOAPEnvelope env = new SOAPEnvelope(new
> ByteArrayInputStream(byteBuf));
>
>         WSSecEncrypt encrypt = new WSSecEncrypt();
>         encrypt.setUserInfo("wss4jcert", "security");
>
> encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
>
> encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
>
>         Document doc = env.getAsDocument();
>
>         WSSecHeader secHeader = new WSSecHeader();
>         secHeader.insertSecurityHeader(doc);
>         encrypt.prepare(doc, crypto);
>
> ...
>
> Do you have any idea whats wrong of my code?
>
> Thanks,
>
>
> Lule
>
>


-- 
Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers

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


Re: Null pointer exception when calling WSSecEncrypt.prepare()

Posted by Davanum Srinivas <da...@gmail.com>.
Lule,

Hopefully Ruchith will chime in, i have no clue :)

-- dims

On 2/23/07, Lule Chen <ll...@nortel.com> wrote:
>
>
>
> Hi, dims:
>
> I adopted the code in TestWSSecurityNew15.java that encrypts the soap body,
> but I got the null pointer exception as the following:
>
> Exception in thread "main" java.lang.NullPointerException
>         at
> org.apache.ws.security.message.WSSecEncrypt.prepare(WSSecEncrypt.java:197)
>         at
> com.nortel.cdma.axis.Client.NEServiceClient.main(NEServiceClient.java:240)
>
> I looked at the line of code in WSSecEncrypt.java, it seems failed at
>
>                 this.symmetricKey = keyGen.generateKey();
>
> I suspect that keyGen is null. My code snips are as the following:
>
>     static final WSSecurityEngine secEngine = new WSSecurityEngine();
>     static final Crypto crypto =
> CryptoFactory.getInstance("cryptoSKI.properties");
>
> ...
>
>         SOAPEnvelope env = new SOAPEnvelope(new
> ByteArrayInputStream(byteBuf));
>
>         WSSecEncrypt encrypt = new WSSecEncrypt();
>         encrypt.setUserInfo("wss4jcert", "security");
>
> encrypt.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
>
> encrypt.setSymmetricEncAlgorithm("WSConstants.TRIPLE_DES");
>
>         Document doc = env.getAsDocument();
>
>         WSSecHeader secHeader = new WSSecHeader();
>         secHeader.insertSecurityHeader(doc);
>         encrypt.prepare(doc, crypto);
>
> ...
>
> Do you have any idea whats wrong of my code?
>
> Thanks,
>
>
> Lule
>
>


-- 
Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers

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