Yes the class is returning what's expected because when it runs standing alone, it decodes the data without any problems.
 
-----Original Message-----
From: Bell, Douglas [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 30, 2005 03:29 PM
To: [email protected]
Subject: RE: Base 64 decoding in web service

I'd check and see if this class is returning what's expected before it sends it across the wire. If it works when standing alone I'm guessing it's not the problem.
 
- Doug


From: Gabsaga Tata [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 30, 2005 12:08 PM
To: [email protected]
Subject: Base 64 decoding in web service

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