ode-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohamed Sirajudeen <moham...@bmassociates.com>
Subject Re: invoking Axis2 (AXIOM) web service
Date Sun, 22 Mar 2009 17:48:36 GMT

Hi Thilan,
I do have requirement to expose POJO objects through web services. In my
POJO class, i have a property of type ArrayList and i have a getter method
for that property. When i create a webservice for this requirement, in the
generated WDSL file, i am getting xs:anyType as the type for that property.
With this type, i am unable to access my webservice through client side
code. Can you please help me with some sample POJO based webservices.

Thanks,
Sirajudeen


Thilina Gunarathne wrote:
> 
> Hi,
> Did you deploy the Axiom based web service using RPCMessageReceiver..
> Normally axiom based web services are deployed using
> RawXMLMessageReceivers.
> The generated WSDL might be wrong, as deploying axiom based services with
> RPCMessageReceiver is a very rare case..
> 
> The error seems to be with the missing the element named logResponse. You
> may want to add an outer element named "logResponse" & a child to it named
> "return" with appropriate namespaces..
> 
> 
> I have successfully used many pojo based axis2 web services deployed using
> RPCMessageReceiver with ODE. Using them will ease your life a lot.. Try
> deploying the following using RPCMR...
> 
> public class LoggerService {
> public String log() {
>                System.out.println("LoggerService.log()");
>                boolean success = true;
>               return Boolean.toString(success));
> }
> }
> 
> thanks,
> Thilina
> 
> 
> On Jan 29, 2008 8:32 AM, Łukasz Budnik <lukasz.budnik@gmail.com> wrote:
> 
>> Hi All!
>>
>> I have a problem when invoking simple Axis2 web service.
>> My service looks somthing like this:
>>
>> package org.xh.nuntius.sandbox.tomcat.ws.axiom;
>> public class LoggerService {
>> public OMElement log(OMElement log) {
>>                System.out.println("LoggerService.log()");
>>                boolean success = true;
>>                OMFactory omFactory = OMAbstractFactory.getOMFactory();
>>                OMElement result = omFactory.createOMElement(new
>> QName("result"));
>>                result.setText(Boolean.toString(success));
>>                return result;
>> }
>> }
>>
>> its name space is http://axiom.ws.tomcat.sandbox.nuntius.xh.org.
>>
>> I can deploy it, I can invoke it with generated by Eclipse WS Client app,
>> etc.
>>
>> I have added this web service to my BPEL:
>>
>> <bpws:invoke inputVariable="LoggerServiceRequest" name="Log"
>>                        operation="log"
>> outputVariable="LoggerServiceResponse"
>>                        partnerLink="LoggerService"
>> portType="ns1:LoggerServicePortType" />
>>
>> my process is successfully deployed, but when invoking it I get:
>>
>> LoggerService.log()
>> DEBUG - GeronimoLog.debug(66) | Found a header in incoming message,
>> checking if
>> there are endpoints there.
>> DEBUG - GeronimoLog.debug(66) | Got service response: <?xml version='1.0'
>> encodi
>> ng='utf-8'?><soapenv:Envelope xmlns:soapenv="
>> http://schemas.xmlsoap.org/soap/env
>> elope/" xmlns:wsa="http://www.w3.org/2005/08/addressing
>> "><soapenv:Header><wsa:Ac
>>
>> tion>urn:logResponse</wsa:Action><wsa:RelatesTo>uuid:hqejbhcnphr2xx6ccsfh3h</wsa
>>
>> :RelatesTo></soapenv:Header><soapenv:Body><return>true</return></soapenv:Body></
>> soapenv:Envelope>
>> WARN - GeronimoLog.warn(96) | Message format error, failing.
>> org.apache.ode.axis2.OdeFault: Unexpected element in SOAP body: message
>> result e
>> lement
>> {http://axiom.ws.tomcat.sandbox.nuntius.xh.org}logResponse<http://axiom.ws.tomcat.sandbox.nuntius.xh.org%7DlogResponse>
>> .
>>        at
>> org.apache.ode.axis2.util.SoapMessageConverter.extractSoapBodyParts(S
>> oapMessageConverter.java:408)
>>        at
>> org.apache.ode.axis2.util.SoapMessageConverter.parseSoapResponse
>> (Soap
>> MessageConverter.java:334)
>>        at org.apache.ode.axis2.ExternalService.reply(ExternalService.java
>> :313)
>>        at org.apache.ode.axis2.ExternalService.access$100(
>> ExternalService.java:
>> 60)
>>        at org.apache.ode.axis2.ExternalService$1$1.call(
>> ExternalService.java:15
>> 7)
>>        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java
>> :303)
>>        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>>        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
>> (ThreadPoolExec
>> utor.java:885)
>>        at java.util.concurrent.ThreadPoolExecutor$Worker.run
>> (ThreadPoolExecutor
>> .java:907)
>>        at java.lang.Thread.run(Thread.java:619)
>>
>> it says that the <return>true</return> element is unexpected in SOAP
>> Body...
>>
>> the WSDL of my web service is generated automatically by Axis2
>> (http://localhost:8080/axis2/services/LoggerService?wsdl) and the
>> response element looks like this:
>>
>> <xs:element name="logResponse">
>>        <xs:complexType>
>>        <xs:sequence>
>> <xs:element minOccurs="0" name="return" nillable="true"
>> type="xs:anyType"/>
>> </xs:sequence>
>> </xs:complexType>
>> </xs:element>
>>
>> can somebody show how to invoke Axis2 AXIOM Web Service in Ode?
>>
>> I would be grateful for any hints!
>>
>> best regards
>> Łukasz
>>
> 
> 
> 
> -- 
> Thilina Gunarathne  - http://thilinag.blogspot.com
> 
> 

-- 
View this message in context: http://www.nabble.com/invoking-Axis2-%28AXIOM%29-web-service-tp15159485p22648567.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Mime
View raw message