Are you trying to access the version service with a ServiceClient?

If so following code snippet will let you do it:

       OMFactory fac = OMAbstractFactory.getOMFactory();
       OMNamespace omNs =
fac.createOMNamespace("http://axisversion.sample/xsd";, "ns1");
       OMElement payload = fac.createOMElement("getVersion", omNs);
       OMElement value = fac.createOMElement("myValue", omNs);
       payload.addChild(value);

       ServiceClient client = new ServiceClient();
       client.getOptions().setTo(new
EndpointReference("http://localhost:8080/axis2/services/version";));

       System.out.println(client.sendReceive(payload));

The happyaxis.jsp constructs the payload (contents of the soap Body)
as shown above.

Also I just tried changing the URL to
http://localhost:8080/axis2/services/version/getVersion and it worked
!

Thanks,
Ruchith

On 8/31/06, Jaimin <[EMAIL PROTECTED]> wrote:


Hi Ruchith,

Thanks for your support.  The address/EPR is same as you suggest.

>   In Axis2 we do allow one to use a URL to point upto the operation as
well. Therefore
>
http://localhost:8080/axis2/services/version/getVersion
should work !

Yet it gives error message "requested resource not found".

Oddly enough, happyaxis.jsp is able to call the operation successfully, but
it uses different API (OMElement types, etc.).

Regards,
Jaimin




-----Original Message-----
From: Ruchith Fernando [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 31, 2006 12:17 PM
To: [email protected];
[EMAIL PROTECTED]
Subject: Re: [Axis2] making it work


On 8/31/06, Jaimin <[EMAIL PROTECTED]>
wrote:
>
>
> Hi Ruchith,
>
> I tried as you suggested below, but the problem continues.
>
> The service is "version", not "getVersion".
> The operation in that service I want to invoke is "getVersion"

In Axis2 we do allow one to use a URL to point upto the operation as
well. Therefore
http://localhost:8080/axis2/services/version/getVersion
should work !

> The syntactic convention to invoke an operation via an URL, which works
well
> for all cases and which I follow, is
>
>
<EPR>"?method="<operationName>"&"<parameterName>=<parameterValue>"&"...
>
> The following works to obtain wsdl of "version" works.  But the latter to
> invoke "getVersion" gives me error.
>     localhost:8080/axis2/services/version?wsdl
>
>
localhost:8080/axis2/services/version?method=getVersion
> The same EPR for axis1.x (replacing "axis2" with "axis") does not give me
> error.

As you can see in the wsdl of the version service the valid address is
http://localhost:8080/axis2/services/version

I think the above case worked because Axis2 ignored the
"?method=getVersion" part.

Thanks,
Ruchith

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.11.7/434 - Release Date: 8/30/2006





--
www.ruchith.org

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to