________________________________

From: William Shatner [mailto:[email protected]] 
Sent: Monday, July 13, 2009 6:00 PM
To: [email protected]
Subject: UnsupportedOperationException - changing non void method to
void


Hi all...

I've returned to this project and I still have the same issue. If my web
service exposes a public method that returns a string everything is
fine, but if i change this to a void method, regenerate the web service
(using Eclipse) I get the following error when i call this method. If I
change it back to a method that returns something the error disappears.

org.apache.axis2.AxisFault: java.lang.UnsupportedOperationException: An
access occurred that is not valid.
at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java
:512)
at
org.apache.axis2.description.RobustOutOnlyAxisOperation$RobustOutOnlyOpe
rationClient.handleResponse(RobustOutOnlyAxisOperation.java:91)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
ation.java:416)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInA
xisOperation.java:228)
at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:163
)
at
com.youpark.webservice.AccountEventHandlerSoapStub.MessageReceived(Accou
ntEventHandlerSoapStub.java:341)
at
com.youpark.webclient.GenerateMessages.generateMessages(GenerateMessages
.java:163)
at
com.youpark.webclient.CallGeneratedMessages.init(CallGeneratedMessages.j
ava:42)
at
com.youpark.webclient.CallGeneratedMessages.<init>(CallGeneratedMessages
.java:17)
at
com.youpark.webclient.CallGeneratedMessages.main(CallGeneratedMessages.j
ava:51)

I call the web service like this:

POJO class
....

AccountEventHandlerSoapStubstub2  = new
AccountEventHandlerSoapStub(TARGET_EPR);

MessageReceived messageReceived = new MessageReceived();
// 

messageReceived.setMessageID(message[0].getId());
...
messageReceived.setMessageText(message[0].getBody());
messageReceived.setType(message[0].getType().toString());
..//fill in correct data here


try {
//MessageReceivedResponse
responsReceived=stub2.MessageReceived(messageReceived);
stub2.MessageReceived(messageReceived); 

The Generated stub fails/errors on the execute command below:

    //adding SOAP soap_headers
        _serviceClient.addHeadersToEnvelope(env);
               // create message context with that soap envelope

           _messageContext.setEnvelope(env);

           // add the message contxt to the operation client
           _operationClient.addMessageContext(_messageContext);

            _operationClient.execute(true);

The services.xml is auto generated and looks like this:

<service name="AccountEventHandlerSoap" >
<Description>
Please Type your service description here
</Description>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only";
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
<messageReceiver  mep="http://www.w3.org/2004/08/wsdl/in-out";
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</messageReceivers>
<parameter name="ServiceClass"
locked="false">com.youpark.webservice.AccountEventHandlerSoap</parameter
>
</service>

All suggestions appreciated. Amila suggested previously  that the
problem was "The problem is your Inonly  axisoperation contains an InOut
message receiver which is wrong."... but how do I rectify this? I never
followed it up at the time...

Thanks,
Tori

On Fri, Jan 23, 2009 at 3:17 PM, Toriacht<[email protected]>
wrote:
>
> Hi Amila,
>
> Thanks for the reply, I've pasted my short services.xml file below. I
> retrieved this from
>
>
C:\brianworkspacetwo\mywebservice\WebContent\WEB-INF\services\AccountEve
ntHandlerSoap\META-INF
>
> Thanks,
> Tori
>
> <service name="AccountEventHandlerSoap" >
>        <Description>
>                Please Type your service description here
>        </Description>
>        <messageReceivers>
>                <messageReceiver
mep="http://www.w3.org/2004/08/wsdl/in-only";
> class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
>                <messageReceiver
mep="http://www.w3.org/2004/08/wsdl/in-out";
> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>        </messageReceivers>
>        <parameter name="ServiceClass"
>
locked="false">com.youpark.webservice.AccountEventHandlerSoap</parameter
>
> </service>
>
>
>
> Amila Suriarachchi wrote:
>>
>>
>>
>> May be a problem with your services.xml. Can you send that file?
>>
>> The problem is your Inonly  axisoperation contains an InOut message
>> receiver
>> which is wrong.
>>
>> thanks,
>> Amila.
>>
>>>
>>>
>>>    at
>>>
>>>
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessa
geReceiver.java:100)
>>>
>>>    at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
>>>
>>>    at
>>>
>>>
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReques
t(HTTPTransportUtils.java:275)
>>>
>>>    at
>>>
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133)
>>>
>>>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
>>>
>>>    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>>
>>>    at
>>>
>>>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:290)
>>>
>>>    at
>>>
>>>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:206)
>>>
>>>    at
>>>
>>>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:233)
>>>
>>>    at
>>>
>>>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:191)
>>>
>>>    at
>>>
>>>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:128)
>>>
>>>    at
>>>
>>>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:102)
>>>
>>>    at
>>>
>>>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:109)
>>>
>>>    at
>>>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:2
86)
>>>
>>>    at
>>>
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:84
5)
>>>
>>>    at
>>>
>>>
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Http11Protocol.java:583)
>>>
>>>    at
>>>
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>>>
>>>    at java.lang.Thread.run(Unknown Source)
>>> --
>>> View this message in context:
>>>
http://www.nabble.com/AxisServlet%3A172-error.-tp21622535p21622535.html
>>> Sent from the Axis - User mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>> --
>> Amila Suriarachchi
>> WSO2 Inc.
>> blog: http://amilachinthaka.blogspot.com/
>>
>>
>
> --
> View this message in context:
http://www.nabble.com/AxisServlet%3A172-error.-tp21622535p21625125.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>


************************************************************
This communication, including attachments, is for the exclusive use of 
addressee and may contain proprietary, confidential and/or privileged 
information.  If you are not the intended recipient, any use, copying, 
disclosure, dissemination or distribution is strictly prohibited.  If you are 
not the intended recipient, please notify the sender immediately by return 
e-mail, delete this communication and destroy all copies.
************************************************************

Reply via email to