Axis2 Plugin having problems?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Axis2 Plugin having problems?

Gregory Pierce
Okay so I've broken this down to a very simple test case. I create a  
new project, install the axis2 plugin, and create a single service:

class TestService {

        static expose=['axis2']

     boolean transactional = true

     def helloWord( String name ) {
                println "Talking to ${name}"
               
                return "Hello ${name}"
     }
}

I then try to connect to this service using SoapUI using the endpoint:

http://localhost:8080/axisTest/services/test


I'm getting back an AxisFault

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/ 
">
    <soapenv:Body>
       <soapenv:Fault>
          <faultcode>soapenv:Server</faultcode>
          <faultstring>org.apache.axis2.AxisFault: Mapping qname not  
fond for the package: org.codehaus.groovy.runtime</faultstring>
          <detail/>
       </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>


Platform: JDK1.6, OSX 10.5, Grails 1.0.4


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Axis2 Plugin having problems?

Graeme Rocher-3
At a guess, the method is returning a Groovy GString which Axis 2
doesn't know how to marshal to XML

Try changing the return signature of helloWorld to:

String helloWord( String name ) {

So that it is automatically coerced to a property String

Cheers

On Fri, Dec 12, 2008 at 6:05 PM, Gregory Pierce <[hidden email]> wrote:

> Okay so I've broken this down to a very simple test case. I create a new
> project, install the axis2 plugin, and create a single service:
>
> class TestService {
>
>        static expose=['axis2']
>
>    boolean transactional = true
>
>    def helloWord( String name ) {
>                println "Talking to ${name}"
>
>                return "Hello ${name}"
>    }
> }
>
> I then try to connect to this service using SoapUI using the endpoint:
>
> http://localhost:8080/axisTest/services/test
>
>
> I'm getting back an AxisFault
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>   <soapenv:Body>
>      <soapenv:Fault>
>         <faultcode>soapenv:Server</faultcode>
>         <faultstring>org.apache.axis2.AxisFault: Mapping qname not fond for
> the package: org.codehaus.groovy.runtime</faultstring>
>         <detail/>
>      </soapenv:Fault>
>   </soapenv:Body>
> </soapenv:Envelope>
>
>
> Platform: JDK1.6, OSX 10.5, Grails 1.0.4
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>



--
Graeme Rocher
Head of Grails Development
SpringSource - Weapons for the War on Java Complexity
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Axis2 Plugin having problems?

Gregory Pierce
So if I have a service that is returning lists of objects (the original root of the problem) I need to say that they are returning List?

For example:

    def autocomplete( String query )
    {
        println("Performing autocomplete operation with " + query );

        def users = User.findAllByNameLike("%${query}%");

        return users;
    }


The signature should look like:

   List autocomplete( String query )
   { ... }


Graeme Rocher-3 wrote
At a guess, the method is returning a Groovy GString which Axis 2
doesn't know how to marshal to XML

Try changing the return signature of helloWorld to:

String helloWord( String name ) {

So that it is automatically coerced to a property String

Cheers

On Fri, Dec 12, 2008 at 6:05 PM, Gregory Pierce <gregorypierce@gmail.com> wrote:
> Okay so I've broken this down to a very simple test case. I create a new
> project, install the axis2 plugin, and create a single service:
>
> class TestService {
>
>        static expose=['axis2']
>
>    boolean transactional = true
>
>    def helloWord( String name ) {
>                println "Talking to ${name}"
>
>                return "Hello ${name}"
>    }
> }
>
> I then try to connect to this service using SoapUI using the endpoint:
>
> http://localhost:8080/axisTest/services/test
>
>
> I'm getting back an AxisFault
>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>   <soapenv:Body>
>      <soapenv:Fault>
>         <faultcode>soapenv:Server</faultcode>
>         <faultstring>org.apache.axis2.AxisFault: Mapping qname not fond for
> the package: org.codehaus.groovy.runtime</faultstring>
>         <detail/>
>      </soapenv:Fault>
>   </soapenv:Body>
> </soapenv:Envelope>
>
>
> Platform: JDK1.6, OSX 10.5, Grails 1.0.4
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>   http://xircles.codehaus.org/manage_email
>
>
>



--
Graeme Rocher
Head of Grails Development
SpringSource - Weapons for the War on Java Complexity
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Axis2 Plugin having problems?

Gregory Pierce
When I try to return a list of objects:

        List getObjects( String somethingDiscarded )
        {
                Movie movie1 = new Movie(title:"Love Movie", description:"A love story... about love", rating:3, gross:1.44)
                Movie movie2 = new Movie(title:"War&Hate", description:"A movie about war", rating:4, gross:3.2)
                               
                return [movie1, movie2];
        }

The whole thing explodes in a frenzy of NullPointerException :) This is (more importantly) the issue that I am trying to resolve

[5894] receivers.RPCMessageReceiver java.lang.NullPointerException
org.apache.axiom.om.OMException: java.lang.NullPointerException
        at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:249)
        at org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:327)
        at org.apache.axiom.om.impl.llom.OMElementImpl.build(OMElementImpl.java:706)
        at org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:675)
        at org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:124)
        at org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:274)
Reply | Threaded
Open this post in threaded view
|

RE: Axis2 Plugin having problems?

Hayram Nicacio-2
In reply to this post by Gregory Pierce


I would use:

    User[] autocomplete( String query )
    {
        println("Performing autocomplete operation with " + query );

        def users = User.findAllByNameLike("%${query}%");

        return users;
    }


Hayram Nicacio
Research & Development
http://www.ingenico.com


-----Original Message-----
From: grgeorypierce [mailto:[hidden email]]
Sent: sexta-feira, 12 de dezembro de 2008 16:26
To: [hidden email]
Subject: Re: [grails-user] Axis2 Plugin having problems?



So if I have a service that is returning lists of objects (the original root
of the problem) I need to say that they are returning List?

For example:

    def autocomplete( String query )
    {
        println("Performing autocomplete operation with " + query );

        def users = User.findAllByNameLike("%${query}%");

        return users;
    }


The signature should look like:

   List autocomplete( String query )
   { ... }



Graeme Rocher-3 wrote:

>
> At a guess, the method is returning a Groovy GString which Axis 2
> doesn't know how to marshal to XML
>
> Try changing the return signature of helloWorld to:
>
> String helloWord( String name ) {
>
> So that it is automatically coerced to a property String
>
> Cheers
>
> On Fri, Dec 12, 2008 at 6:05 PM, Gregory Pierce <[hidden email]>
> wrote:
>> Okay so I've broken this down to a very simple test case. I create a new
>> project, install the axis2 plugin, and create a single service:
>>
>> class TestService {
>>
>>        static expose=['axis2']
>>
>>    boolean transactional = true
>>
>>    def helloWord( String name ) {
>>                println "Talking to ${name}"
>>
>>                return "Hello ${name}"
>>    }
>> }
>>
>> I then try to connect to this service using SoapUI using the endpoint:
>>
>> http://localhost:8080/axisTest/services/test
>>
>>
>> I'm getting back an AxisFault
>>
>> <soapenv:Envelope
>> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>>   <soapenv:Body>
>>      <soapenv:Fault>
>>         <faultcode>soapenv:Server</faultcode>
>>         <faultstring>org.apache.axis2.AxisFault: Mapping qname not fond
>> for
>> the package: org.codehaus.groovy.runtime</faultstring>
>>         <detail/>
>>      </soapenv:Fault>
>>   </soapenv:Body>
>> </soapenv:Envelope>
>>
>>
>> Platform: JDK1.6, OSX 10.5, Grails 1.0.4
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>   http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
>
> --
> Graeme Rocher
> Head of Grails Development
> SpringSource - Weapons for the War on Java Complexity
> http://www.springsource.com
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>
>

--
View this message in context:
http://www.nabble.com/Axis2-Plugin-having-problems--tp20980640p20980981.html
Sent from the grails - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

RE: Axis2 Plugin having problems?

Gregory Pierce
Tried to do that and received a:

[71603] receivers.RPCMessageReceiver tried to access class User from class TestService$$EnhancerByCGLIB$$7316742d
java.lang.reflect.InvocationTargetException

I'm not really sure what its looking for with that. I'm just returning a fairly stupid Grails object. Not even any OR relationships in it.
Reply | Threaded
Open this post in threaded view
|

RE: Axis2 Plugin having problems?

Gregory Pierce
Does the axis2 plugin work with Groovy objects, or are we required to use Java objects in order for this to work? I'm somewhat confused on why this isn't working out of the box. Seems like a simple requirement to take a List/Array of objects and return them in a SOAP response.



grgeorypierce wrote
Tried to do that and received a:

[71603] receivers.RPCMessageReceiver tried to access class User from class TestService$$EnhancerByCGLIB$$7316742d
java.lang.reflect.InvocationTargetException

I'm not really sure what its looking for with that. I'm just returning a fairly stupid Grails object. Not even any OR relationships in it.
Reply | Threaded
Open this post in threaded view
|

Re: Axis2 Plugin having problems?

teguh
Hi grgeorypierce

yes it's work


the codes bellow works for me:

Book getBookById(int id) {
         return Book.get(id)
    }

Book[] availableBooks() {
        return Book.list()
    }

int[] availableIds() {
        def data = []
        Book.list().each{
            data.add(it.id)
        }
        return data as Integer[]   // << use this, return as array of object
    }



best regards

teguh
Reply | Threaded
Open this post in threaded view
|

Re: Axis2 Plugin having problems?

Gregory Pierce
Any chance you could post that code somewhere as I can't get Axis2 to do anything other than return errors when I'm dealing with groovy object.
Reply | Threaded
Open this post in threaded view
|

Re: Axis2 Plugin having problems?

neoplanet
In reply to this post by teguh
Hello teguh,

Could you please, tell me if you can return in the last method a array of objects not int?
I'm using axis2-0.7.0 and I'm trying return a array of an object and I can't do it sucessfully.

Best regards,
Reply | Threaded
Open this post in threaded view
|

Re: Axis2 Plugin having problems?

SanjayGupta
Does your domain have some relationship with other domains? I remember having some problem with one of the domain and it could have been because of the relationship. I am not 100% sure though since it has been a while. I mostly use java objects as return because I don't want to return all columns from the domain.

-----Original Message-----
From: neoplanet [mailto:[hidden email]]
Sent: Friday, May 06, 2011 4:01 AM
To: [hidden email]
Subject: [grails-user] Re: Axis2 Plugin having problems?

Hello teguh,

Could you please, tell me if you can return in the last method a array of objects not int?
I'm using axis2-0.7.0 and I'm trying return a array of an object and I can't do it sucessfully.

Best regards,


--
View this message in context: http://grails.1312388.n4.nabble.com/Axis2-Plugin-having-problems-tp1364843p3502231.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email