I am using the package org.apache.soap.encoding.soapenc.Base64 to decode base 64 encoded data. Below is my decode method in my webservice app.

    public byte[] base64DecodeData(String data)
    {    
        byte[] bytes = null; 
    
        Base64 base64 = new Base64();
        try
        {
            bytes = base64.decode(data);       
        }
        catch (Exception ex)
        {
            System.out.println("Decoding exception: " + ex.toString());
        }
        return bytes;      
    }


The string data parameter is the value extracted from element tag:
<data encoding="base64-MIME">Base64EncodedDataHere</data>
from a DOM Object where the value bas been base 64 encoded by the client application.
 
 
I get the following error when running my base64DecodeData method. Any ideas what could be causing this? When my webservice is implemented as a regular java class, it works fine but when I convert it to a webservice, I get this error.
Any help will be greatly appreciated.
 
 
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.reflect.InvocationTargetException
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}hostname:USAGXXTEST2286
java.lang.reflect.InvocationTargetException
        at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
        at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:128)
        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.DTDConfiguration.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(Unknown Source)
        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:424)
        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:2765)
        at org.apache.axis.client.Call.invoke(Call.java:2748)
        at org.apache.axis.client.Call.invoke(Call.java:2424)
        at org.apache.axis.client.Call.invoke(Call.java:2347)
        at org.apache.axis.client.Call.invoke(Call.java:1804)
        at com.simpaq.ws.CipherSoapBindingStub.processDocument(CipherSoapBindingStub.java:153)
        at CipherClient.run(CipherClient.java:78)
        at CipherClient.main(CipherClient.java:105)

Reply via email to