Hello,

I've a strange problem using wss4j 1.5.0 with axis 1.4.

During the parsing of the ready encoded soap xml Document the following exception occured

2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.enterprise: Mapping Exception to AxisFault org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)

The soap request is (from the SOAP Mointor)

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="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";>
 <soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";>
     <xenc:EncryptedKey Id="EncKeyId-534353">
<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>
<wsse:KeyIdentifier EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"; ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3";>MIIDljCCAv+gAwIBAgIJALveiiZKbS80MA0GCSqGSIb3DQEBBAUAMIGPMQswCQYDVQQGEwJERTEPMA0GA1UECBMGQmVybGluMQ8wDQYDVQQHEwZCZXJsaW4xCzAJBgNVBAoTAkFBMQ4wDAYDVQQLEwVBQS1DQTEYMBYGA1UEAxMPTWF0aGlhcyBMb2VzY2hlMScwJQYJKoZIhvcNAQkBFhhtYXRoaWFzLmxvZXNjaGVAZGlwbG8uZGUwHhcNMDYxMTAxMDkwMjU1WhcNMDcxMTAxMDkwMjU1WjBkM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ZJXAF0uJqdm1ZKKPJlMZU2MiUnxpg50b04nolTHLM24gzZlXrY8ttoSG8wblxnnzkv4mvC7+LNoafJM6rJBckx7As60xr3dLF6cOunzSOK61GG6DMs=</xenc:CipherValue>
       </xenc:CipherData>
       <xenc:ReferenceList>
         <xenc:DataReference URI="#EncDataId-29594051"/>
       </xenc:ReferenceList>
     </xenc:EncryptedKey>
   </wsse:Security>
 </soapenv:Header>
 <soapenv:Body>
<ns1:hallo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns1="http://aa";>
     <name xsi:type="xsd:string">blablabla</name>
   </ns1:hallo>
 </soapenv:Body>
</soapenv:Envelope>


generated with the following Client:

import org.apache.xml.utils.*;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;

import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;

public class cl_HelloWorld
{
  public static void main(String [] args) {
      try {

          Options options = new Options(args);

          String endpointURL =
                   "http://127.0.0.1:8080/axis/services/HelloWorldXmlEnc";;

          String textToSend;

           args = options.getRemainingArgs();
           if ((args == null) || (args.length < 1)) {
               textToSend = "<nothing>";
           } else {
               textToSend = args[0];
           }

           Service  service = new Service();
           Call     call    = (Call) service.createCall();

           call.setTargetEndpointAddress( new java.net.URL(endpointURL) );
           call.setOperationName( new QName("http://aa";, "hallo") );
call.addParameter( "name", org.apache.axis.Constants.XSD_STRING, ParameterMode.IN);
           call.setReturnType(org.apache.axis.Constants.XSD_STRING);

String ret = (String) call.invoke( new Object[] { textToSend } );


          System.out.println( ret );
      } catch (Exception e) {
          System.err.println(e.toString());
      }
  }
}


The encryption and decryption works fine as I can see in the log. The I can find the encrypted and later the decrypted soapbody.

When I call a plain service, the generated soap request is:

<?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:Body>
<ns1:hallo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns1="http://aa";>
     <name xsi:type="xsd:string">test</name>
   </ns1:hallo>
 </soapenv:Body>
</soapenv:Envelope>

All works fine. I use the same client, except the URL of the service of cause.

Here the last messages before the exception occured
8080-Processor25] org.apache.axis.providers.java.RPCProvider: body is <ns1:hallo soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns1="http://aa"; xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><name xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>blablabla</name></ns1:hallo> 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.i18n.ProjectResourceBundle: org.apache.axis.i18n.resource::handleGetObject(pushHandler00) 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.encoding.DeserializationContext: Pushing handler [EMAIL PROTECTED] 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.encoding.DeserializationContext: Enter: DeserializationContext::startPrefixMapping(ns1, http://aa) 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.utils.NSStack: NSPush (32) 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.utils.NSStack: NSPush (32) 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.encoding.DeserializationContext: Exit: DeserializationContext::startPrefixMapping() 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.encoding.DeserializationContext: Enter: DeserializationContext::startElement(http://aa, hallo) 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.message.RPCHandler: Enter: RPCHandler.onStartChild() 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.i18n.ProjectResourceBundle: org.apache.axis.i18n.resource::handleGetObject(typeFromAttr00) 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.message.RPCHandler: Type from attributes is: null 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.message.RPCHandler: Exit: RPCHandler.onStartChild() 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.i18n.ProjectResourceBundle: org.apache.axis.i18n.resource::handleGetObject(pushHandler00) 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.encoding.DeserializationContext: Pushing handler [EMAIL PROTECTED] 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.encoding.DeserializationContext: Exit: DeserializationContext::startElement() 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.encoding.DeserializationContext: Enter: DeserializationContext::startElement(, name) 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.i18n.ProjectResourceBundle: org.apache.axis.i18n.resource::handleGetObject(cantHandle00) 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.i18n.ProjectResourceBundle: org.apache.axis.i18n.resource::handleGetObject(toAxisFault00) 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.enterprise: Mapping Exception to AxisFault org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.

Following logs are strange in my eyes:
2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.message.RPCHandler: Type from attributes is: null 2006-11-09 12:03:16,029 DEBUG [http-8080-Processor25] org.apache.axis.encoding.DeserializationContext: Enter: DeserializationContext::startElement(, name)

All runs with jdk1.5.0-09.

I tried for days to get any idea what could be wrong, but unfortunately without any progress. Does anyone have any idea, what or where could be the problem or where to debug next?
It would me make very,very glad.


Thanks a lot !

Mathias



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to