Note that there are some explanatory texts on larger screens.

plurals
  1. POGrails Exception: Mapping qname not fond for the package: grails.validation
    primarykey
    data
    text
    <p>I am trying to build a simple SOAP web service (basic CRUD) using Grails with Apache Axis2 Plugin.</p> <p>All works well with methods that have a simple return type (like String, int).</p> <p>The problem is when I try to retrieve a domain class object:</p> <pre><code>class Hotel { static mapping = { datasource 'hotel' table 'hotel' version false hotelId column:'id', insertable: false, updateable: false hotelName column:'hotel_name', sqlType:'varchar', name:'hotelName' } Integer hotelId String hotelName static constraints = { hotelId(max: 2147483647) hotelName(size:1..100) } } </code></pre> <p>I have the following methods, inside my service class:</p> <pre><code>class HotelService { static expose=['axis2'] boolean transactional = false String sayHello(String name) { return "Hello ${name}!" } Hotel soapGetHotel(int id){ return Hotel.get(id) } } </code></pre> <p>Executing a curl for soapGetHotel(int id) gives me this error:</p> <pre><code>| Error 2012-11-13 15:29:46,142 [http-bio-8080-exec-3] ERROR engine.AxisEngine - java.lang.RuntimeException: org.apache.axis2.AxisFault: Mapping qname not fond for the package: grails.validation Message: java.lang.RuntimeException: org.apache.axis2.AxisFault: Mapping qname not fond for the package: grails.validation </code></pre> <p>Please, see bellow my soap-xml file:</p> <pre><code>&lt;soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" soap:encodingStyle="http://www.w3.org/2003/05/soap-encoding"&gt; &lt;soap:Body xmlns:m="http://ws.com"&gt; &lt;m:soapGetHotel&gt; &lt;m:id&gt;13&lt;/m:id&gt; &lt;/m:soapGetHotel&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt; </code></pre> <p>And the curl command:</p> <pre><code>curl --verbose --request POST --header "Content-Type: application/soap+xml" --data @gethotel.xml http://localhost:8080/wsexample/services/hotel </code></pre> <p>I believe it has to do with axis that cannot find the mapping for the object. I tried resolving the issue as it is described in the accepted answer here: <a href="https://stackoverflow.com/questions/3069659/axis2-not-returning-own-objects">Axis2 not returning own objects</a>, but no luck, I still get the error.</p> <p>I followed all steps described in the <a href="http://www.grails.org/Apache+Axis2+Plugin" rel="nofollow noreferrer"> axis2 grails documentation </a>.</p> <p>Any thoughts on how to solve this?</p> <p>Thank you.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload