Do I format the SOAP request message correctly?

0

Hi,

My JasperServer is running fine.

I'm testing on its webservices using SOAPUI.

Below is SOAP Request and Response Message. I'm getting an error for the SOAP Response Message.

Can someone please advise if the SOAP Request Message is correct? If it's correct, what could be the possible reason of JasperServer web service reply with such response?

Thanks.

 

Code:
SOAP Request Message
=====================
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:axis="http://axis2.ws.jasperserver.jaspersoft.com">
   <soapenv:Header/>
   <soapenv:Body>
      <axis:list soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <requestXmlString xsi:type="xsd:string">
            <request operationName="list" locale="en">
               <resourceDescriptor name="" wsType="folder" uriString="/" isNew="false">
                  <label>null</label>
               </resourceDescriptor>
            </request>
         </requestXmlString>
      </axis:list>
   </soapenv:Body>
</soapenv:Envelope>
 
 
SOAP Response Message
=====================
<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/">jbchurn</ns1:hostname>
         </detail>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope></td></tr></tbody></table>
jbchurn's picture
58
Joined: Sep 8 2008 - 6:30pm
Last seen: 11 years 3 months ago

1 Answer:

2

I found the answer already.

I should have added <![CDATA[<   .....   ]]> to enclose the value of requestXmlString.

Code:
Corrected SOAP request
======================
 
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:axis="http://axis2.ws.jasperserver.jaspersoft.com">
   <soapenv:Header/>
   <soapenv:Body>
      <axis:list soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <requestXmlString xsi:type="xsd:string">
            <![CDATA[<request operationName="list" locale="en">
               <resourceDescriptor name="" wsType="folder" uriString="/" isNew="false">
                  <label>null</label>
               </resourceDescriptor>
            </request>]]>
         </requestXmlString>
      </axis:list>
   </soapenv:Body>
</soapenv:Envelope>
</td></tr></tbody></table>
jbchurn's picture
58
Joined: Sep 8 2008 - 6:30pm
Last seen: 11 years 3 months ago

Hello, jbchurn

Thank you so much for your comment. It helped me a lot when I started to work with soap web services.
Below I want to quote my LIST request that should return the contents of the public folder:

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:axis="http://axis2.ws.jasperserver.jaspersoft.com">
<soapenv:Header/>
<soapenv:Body>
<axis:list soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<requestXmlString xsi:type="xsd:string">
<![CDATA[<request operationName="list" locale="en">
<resourceDescriptor name="" wsType="folder" uriString="/public" isNew="false">
<label>null</label>
</resourceDescriptor>
</request>]]>
</requestXmlString>
</axis:list>
</soapenv:Body>
</soapenv:Envelope>

akonkin - 6 years 6 months ago

Following was the Request1 in SoapUI. Tried to put in my request (mutiple actially) inside the <sXML> </sXML> worked only after I enclosed it within <![CDATA[ ]]

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:int="http://interfaces.hub.ml.com">
<soapenv:Header/>
<soapenv:Body>
<int:getHairCut>
<sXML>
<![CDATA[
<MHRequests>
<MHRequest RequestID="20170425150456"></MHRequest>
<MHRequest RequestID="20170425150457"></MHRequest>
</MHRequests>
]]>
</sXML>
</int:getHairCut>
</soapenv:Body>
</soapenv:Envelope>

JayLaxme - 2 years 6 months ago
Feedback
randomness