Take a look at this thread: http://java2.5341.com/msg/86471.html
On 9/3/05, #CHEN XINJUN# <[EMAIL PROTECTED]> wrote:
Hi Rogério,
Thank you for your response. Aspired by your previous emails, I tried to set style to "RPC" and it really works. I had never doubted that this setting would cause the problem, as specified in Globus website, GT4 programmers should set style="document" and use="literal" for interoperability reason.
I did the following testing:
1. Modified the deployment descriptor server-deploy.wsdd in $GLOBUS_LOCATION/etc/service-name directory, set style="rpc".
2. Restart the globus container.
3. Run the stubless client. It worked fine!
4. Run the stub-based client. It failed!
5. Modified the deployment descriptor server-deploy.wsdd in $GLOBUS_LOCATION/etc/service-name directory, set style="document".
6. Restart the globus container.
7. Run the stubless client. It failed!
8. Run the stub-based client. it worked fine!
9. In order to serve both kinds of clients, I tried to modify the style inside the stubless client codes using the following:
MessageContext ctx = MessageContext.getCurrentContext();
ctx.getService().setStyle(org.apache.axis.enum.Style.RPC);
ctx.getService().setUse(org.apache.axis.enum.Use.LITERAL);
Object ret = call.invoke(new Object[]{"anyMonitorArg"});
This time I could not even compile. The error is due to introduction of "enum" keywork in JDK 1.5.
core/clients/organizer/Client2.java:68: as of release 1.5, 'enum' is a keyword, and may not be u sed as an identifier
(try -source 1.4 or lower to use 'enum' as an identifier) ctx.getService().setStyle(org.apache.axis.enum.Style.RPC);
However I still think there should be someway to set the style dynamically. My bad luck is just because of the "enum" keyword in JDK1.5.
I am very confused now. I am not sure whether I should report this incompatibility to Globus community or to Axis community.
Regards,
Xinjun
-----Original Message-----
From: Rogério Luz [mailto: [EMAIL PROTECTED]]
Sent: Sat 2005-9-3 3:03
To: [email protected]
Subject: Re: Return type for complex types
Hi Xinjun
You are not the only one new to axis :-)
From the 4 Service Styles I ever read about in Axis docs (RPC, Document,
Wrapped, and Message) I implemented only the RPC style.
I didn't get any problem (yet) using RPC Service. Actually I have clients in
Java and .NET using this service, sending/receiving complex types and
primitives.
For the above scenario I would suggest RPC, but as you could see, the
flavours are there to satisfy all needs (tastes).
On 9/2/05, #CHEN XINJUN# <[EMAIL PROTECTED]> wrote:
>
> Hi Rogério,
>
> I am fairly new to Axis. Could you tell me what if I use RPCHandler?
> Mine service deployment descriptor is like
>
> <deployment name="defaultServerConfig"
> xmlns="http://xml.apache.org/axis/wsdd/"
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
>
> <service name="codsig/organizer" provider="Handler" use="literal"
> style="document">
> <parameter name="className" value=" core.services.organizer.impl.Organizer
> "/>
> <wsdlFile>share/schema/codsig/organizer/Organizer_service.wsdl</wsdlFile>
> <parameter name="allowedMethods" value="*"/>
> <parameter name="handlerClass" value="
> org.globus.axis.providers.RPCProvider"/>
> <parameter name="scope" value="Application"/>
> <parameter name="providers" value="GetRPProvider"/>
> <parameter name="loadOnStartup" value="true"/>
> </service>
>
> </deployment>
>
>
> As you see, if you use doc/lit style, how to return complex types? Any
> changes? In fact I even cannot pass input parameter. And this problem stuck
> me for more than 2 weeks already.
>
> Could you help?
>
> Regards,
> Xinjun
>
>
>
> -----Original Message-----
> From: Rogério Luz [mailto:[EMAIL PROTECTED]]
> Sent: Wed 2005-8-31 23:07
> To: [email protected]
> Subject: Re: Return type for complex types
>
> Hi Uppili
>
> Try to create a wsdd like this:
>
>
>
> <deployment xmlns=" http://xml.apache.org/axis/wsdd/" xmlns:java="
> http://xml.apache.org/axis/wsdd/providers/java" <
> http://xml.apache.org/axis/wsdd/providers/java"> >
> <service name="YourWebServiceName" provider="java:RPC">
> <parameter name="className" value="your.package.ClassName "/>
> <parameter name="allowedMethods" value="*"/>
> <beanMapping qname="myNS:YourBean" xmlns:myNS="urn:ClassName"
> languageSpecificType="java: your.package.YourBean"/>
> </service>
> </deployment>
>
>
>
> Deploy it then try this in your client code:
>
>
>
> QName qnYourBeanName = new QName("urn:ClassName", "YourBean");
> QName qnYourBeanArr = new QName("urn:ClassName", "ArrayOf_ClassName");
> call.registerTypeMapping(YourBean.class, qnYourBeanName ,
> new org.apache.axis.encoding.ser.BeanSerializerFactory (YourBean.class,
> qnYourBeanName ),
> new org.apache.axis.encoding.ser.BeanDeserializerFactory(YourBean.class,
> qnYourBeanName ));
>
> call.registerTypeMapping(YourBean[].class, qnYourBeanNameArr ,
> new org.apache.axis.encoding.ser.ArraySerializerFactory(),
> new org.apache.axis.encoding.ser.ArrayDeserializerFactory());
>
> YourBean[] yba = (YourBean[]) call.invoke( new Object[] {});
>
>
> This should work.
> Any problem let me know.
>
> Best Regards,
>
> Rogério Luz
>
>
> On 8/30/05, Uppili Srinivasan < [EMAIL PROTECTED]> wrote:
>
> Hi everyone,
>
>
>
> I searched the recent archives for an answer to the problem I am having
> but could not find one. Any help would be greatly appreciated.=20
>
>
>
> I have a wrapped service which returns TestObject[] where TestObject is
> a bean with a just a String property.
>
>
>
> The WSDD entry for that is
>
>
>
> <service name=3D"Test" style=3D"wrapped">
>
>
>
> <parameter name=3D"className" =
>
> value=3D"com.questerra.webservices.Test "/>
>
>
>
> <parameter name=3D"allowedMethods" value=3D"*"/>
>
>
>
> <beanMapping qname=3D"myNS:TestObject"
>
> xmlns:myNS=3D" http://webservices.questerra.com"
>
> languageSpecificType=3D"java:com.questerra.webservices.TestObject"/>
>
>
>
> </service>
>
>
>
>
>
> I don't have any problems in calling the service but am having problems
> in parsing the response. If the service returns only one object in the
> array and
>
>
>
> if I do the following in my client, I don't get any exceptions
>
>
>
> QName qnArr =3D new QName("
> http://webservices.questerra.com <http://webservices.questerra.com/> ",
> "doTestResponse" );
>
> call.setOperationStyle("wrapped");
>
> call.registerTypeMapping (TestObject[].class, qnArr,
>
> new
> org.apache.axis.encoding.ser.ArraySerializerFactory(),
>
> new
> org.apache.axis.encoding.ser.ArrayDeserializerFactory());
>
> call.setOperationName ( "doTest" );
>
> call.setReturnType(qnArr);
>
>
>
>
>
> But if the service returns more than one object, I am getting an AXIS
> fault as follows:
>
>
>
> faultCode:
>
> { http://schemas.xmlsoap.org/soap/envelope/}Server.userException
> < http://schemas.xmlsoap.org/soap/envelope/%7dServer.userException <
> http://schemas.xmlsoap.org/soap/envelope/%7dServer.userException > >
>
>
>
> faultSubcode:
>
>
>
> faultString: java.lang.ArrayStoreException
>
>
>
> faultActor:
>
>
>
> faultNode:
>
>
>
> faultDetail:
>
>
>
>
>
> { http://xml.apache.org/axis/}stackTrace:java.lang.ArrayStoreException
> < http://xml.apache.org/axis/%7dstackTrace:java.lang.ArrayStoreException <
> http://xml.apache.org/axis/%7dstackTrace:java.lang.ArrayStoreException> >
>
>
>
>
> at
>
> org.apache.axis.utils.JavaUtils.convert(JavaUtils.java:472)
>
>
>
> at org.apache.axis.client.Call.invoke (Call.java:2580)
>
>
>
> at org.apache.axis.client.Call.invoke(Call.java:2347)
>
>
>
> at org.apache.axis.client.Call.invoke (Call.java:1804)
>
>
>
>
>
> Thanks much in advance for any help in resolving this issue[Uppili
> Srinivasan] .
>
>
>
> Uppili
>
>
>
>
>
>
>
>
>
>
>
--
[]´s
Rogério Luz
--
[]´s
Rogério Luz
