Forum Discussion

RohitBBorse's avatar
RohitBBorse
Contributor
12 years ago

org.xml.sax.SAXException: SimpleDeserializer encountered a c

Hi,

I am using soapUI 4.5.1. I have created a key using below command.

keytool -genkey -alias test -keyalg "RSA" -sigalg "SHA1withRSA" -dname "CN=test, C=US" -keystore test.jks

The above command generates an RSA key, with RSA-SHA1 as the signature algorithm.

Then, this key is used for applying WS-Security. But after following the procedures as stated in soapUI tutorial to apply outgoing WS-Security to request, I got a soap fault error "org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.".

Please help me to resolve same.

----------- Original Request --------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mat="http://maths">
<soapenv:Header/>
<soapenv:Body>
<mat:getAddition>
<mat:Number1>1</mat:Number1>
<mat:Number2>1</mat:Number2>
</mat:getAddition>
</soapenv:Body>
</soapenv:Envelope>


------------- RAW Request after applyinh outgong -ws security ------------
<soapenv:Envelope xmlns:mat="http://maths" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security 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">
<xenc:EncryptedKey Id="EK-855E5335D62BDCFA9513663794195781" 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>
<ds:X509Data>
<ds:X509IssuerSerial>
<ds:X509IssuerName>CN=test,C=US</ds:X509IssuerName>
<ds:X509SerialNumber>1500124275</ds:X509SerialNumber>
</ds:X509IssuerSerial>
</ds:X509Data>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>ZTg4UUqIiatl7HSA+nb0x1YvDHYucTb9jxUcjKO6fDDmxS2PoFtc1vB5VFdhrIVTkIeVyGuVm67+iOdfpU1lGuHnaXEwUyj/TeZzRGCGdUJsga5I1gEirtXVafMfIfHz7RZAhnoWgl436YE1DyaIwCK6MCvE3HApYvkcszDKRyOX7lf0BWcxw3SUgaxHsyCl5O/GjcX1CvnddD7TzDp26KjW6Wqp4INLS9OphrkO1E3+4Ul5EJNqByYsPVc39wiUTecuPkwTuZhz6NWVoPi/TTxkE/BwENDj44DKxRXy0K2LnrMgO4ryrnkDLvYhh+2hoKsAs2klikdJ0kzMyKwPbg==</xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI="#ED-1"/>
</xenc:ReferenceList>
</xenc:EncryptedKey>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<xenc:EncryptedData Id="ED-1" 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#aes128-cbc"/>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference wsse11:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd">
<wsse:Reference URI="#EK-855E5335D62BDCFA9513663794195781"/>
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>TNk+fGfhFsY5V9BSPty7YZG3usgUi3OhnLRirwnGQIrQJONaV4uuDVbCIPdl+THFGkEM2rCMnr6VhsFgJAWo01vBy6t6PA1gwu/R7JfugyiA4f2XR5xAKtpx5rIllUsLY4A9hlv4wsSkOM6F4F5Lx7zAvN2zKwnn1bKlE1pLqis/26hvcSkAMEKz2U5ZUD14LPb9NdOY6Yf+n0n6fEEWbyh+ZocMyM+Uw/YV7Zi+2DDqmMyAdBaRAmxFTPeOh6ZC58i/4BWIGlZGTB4iv1jeTa0X63Zoxhx6D4cZ/h0nk/bPxApijnKc264LG8xeuh57</xenc:CipherValue>
</xenc:CipherData>
</xenc:EncryptedData>
</soapenv:Body>
</soapenv:Envelope>


------------- Response --------------
<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>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.</faultstring>
<detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">rbb-1057</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
No RepliesBe the first to reply