You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Xi.Yue Chen.Wu" <wx...@yahoo.com> on 2004/08/12 15:30:31 UTC
A question about an Axis client talk to a Perl/SOAP::Lite WS server. Help please!
Hi, All.
I wrote a simple WS server in Perl(SOAP::Lite 0.55),
which serves its purpose(echoing whatever string it
receives) fine if the client is also in
Perl/SOAP::Lite or Apache-Soap-2.3.1. However, if the
client is written
in Axis1.1, the client can not get the service.
Here is the detail:
The WS server is deployed in the static mode, like
this:
--------------------8<-----------------------
#! /usr/local/bin/perl -w
use SOAP::Transport::HTTP;
use lib ("/nas/aidddev/test/testSoap/");
use EchoYa qw(echoYa);
$SIG{PIPE} = $SIG{INT} = 'IGNORE';
$daemon = SOAP::Transport::HTTP::Daemon
-> new (LocalPort => 8003)
-> dispatch_to('EchoYa');
$daemon->handle;
--------------------8<-----------------------
The EchoYa.pm is like this:
--------------------8<-----------------------
package EchoYa;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw( echoYa );
sub echoYa {
print "enter echoYa\n";
my $self = shift;
my $ya = shift;
return "I got $ya!";
}
1;
--------------------8<-----------------------
The client is:
--------------------8<-----------------------
1. package samples.userguide.example1;
2. import org.apache.axis.client.Call;
3. import org.apache.axis.client.Service;
4. import javax.xml.namespace.QName;
5. public class TestClient {
6. public static void main(String [] args) {
7. String ret = "1";
8. try {
9. String endpoint =
"http://foobar:8003/EchoYa";
10. Service service = new Service();
11. Call call = (Call)
service.createCall();
12. call.setTargetEndpointAddress( new
java.net.URL(endpoint) );
13. call.setOperationName("echoYa");
14. call.setUseSOAPAction(true);
15. call.setSOAPActionURI("echoYa");
16. ret = (String) call.invoke( new Object[]
{ "aMsssg" } );
17. System.out.println("Sent aMsssg , got
'" + ret + "'");
18. } catch (Exception e) {
19. System.err.println(e.toString());
20. }
21. }
22. }
--------------------8<-----------------------
The error message I got is:
SOAPAction shall match 'uri#method' if present (got
'echoYa', expected '#echoYa'
Then, I altered the code of the client a little bit by
commenting out line 14 and 15. (which means, not
calling the setSOAPActionURI() method).
--------------------8<-----------------------
1. package samples.userguide.example1;
2. import org.apache.axis.client.Call;
3. import org.apache.axis.client.Service;
4. import javax.xml.namespace.QName;
5. public class TestClient {
6. public static void main(String [] args) {
7. String ret = "1";
8. try {
9. String endpoint =
"http://foobar:8003/EchoYa";
10. Service service = new Service();
11. Call call = (Call)
service.createCall();
12. call.setTargetEndpointAddress( new
java.net.URL(endpoint) );
13. call.setOperationName("echoYa");
14. //call.setUseSOAPAction(true);
15. //call.setSOAPActionURI("echoYa");
16. ret = (String) call.invoke( new Object[]
{ "aMsssg" } );
17. System.out.println("Sent aMsssg , got
'" + ret + "'");
18. } catch (Exception e) {
19. System.err.println(e.toString());
20. }
21. }
22. }
--------------------8<-----------------------
Then I got complain like this:
Denied access to method (echoYa) in class (main) at
/host/dev/lib/site_perl/5.6.1/SOAP/Lite.pm line 2130.
Did anyone have a similiar difficulty before.
I bet I must have missed something. Can anyone help?
Thanks in advance,
Donald
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
RE: A question about an Axis client talk to a Perl/SOAP::Lite WS server. Help please!
Posted by Donald Chen <wx...@yahoo.com>.
Anne,
Issac,
Thanks for the WSDL explanation. I was not quite clear about WSDL stuff.
It turns out that after a bit tweaks on the way to invoke the service on the client, it works.
(Frankly, I am still do not know why it works). Here are the version which works:
-------------------------------------8<-----------------------------
1. package samples.userguide.example1;
2. import org.apache.axis.client.Call;
3. import org.apache.axis.client.Service;
4. import javax.xml.namespace.QName;
5. public class TestClient {
6. public static void main(String [] args) {
7. String ret = "1";
8. try {
9. String endpoint = "http://locahost:8003/echoYaDaemon";
10.
11. Service service = new Service();
12. Call call = (Call) service.createCall();
13.
14. call.setTargetEndpointAddress( new java.net.URL(endpoint) );
15. call.setOperationName(new QName("urn:EchoYa", "echoYa"));
16. call.setUseSOAPAction(true);
17. call.setSOAPActionURI("urn:EchoYa#echoYa");
18.
19. ret = (String) call.invoke( new Object[] { args[0] } );
20.
21. System.out.println("Sent " + args[0] + ", got '" + ret + "'");
22. } catch (Exception e) {
23. System.err.println(e.toString());
24. }
25. }
26. }
-------------------------------------8<-----------------------------
As you can see, line 15 and 16 are the ones been altered.
Thanks again,
Donald
--- Anne Thomas Manes <an...@manes.net> wrote:
> It would help to have a WSDL -- because the WSDL will tell you what
> SOAPAction it's expecting. But you don't need to have one.
>
> By default, SOAP::Lite uses a SOAPAction URI with the format [uri]#[method],
> which is why I suggested what I did.
>
> Try these two options:
>
> call.setSOAPActionURI("#echoYa");
>
> and
>
> call.setSOAPActionURI("");
>
> Good luck,
> Anne
>
>
> -----Original Message-----
> From: Donald Chen [mailto:wxyc@yahoo.com]
> Sent: Thursday, August 12, 2004 1:52 PM
> To: axis-user@ws.apache.org
> Subject: RE: A question about an Axis client talk to a Perl/SOAP::Lite WS
> server. Help please!
>
> Anne,
>
> I tried with:
>
> call.setSOAPActionURI("http://foobar:8003/EchoYa#echoYa");
>
> It still does not work, the error msg remains similar. Is that because I
> did not have
> a WSDL for the WS server?
>
> Thanks,
>
> Donald
>
> --- Anne Thomas Manes <an...@manes.net> wrote:
>
> > SOAP::Lite is rejecting your request because you have not specified the
> > correct SOAPAction value. SOAPAction is supposed to be a URI. Look at the
> > WSDL document to determine the correct value for SOAPAction value. It's
> > specified in the <soap:operation> element in the <binding>.
> >
> > Then change line 15 so that you specify the correct value. Perhaps
> something
> > like:
> >
> > 15. call.setSOAPActionURI("http://foobar:8003/EchoYa#echoYa");
> >
> > Regards,
> > Anne
> >
> > -----Original Message-----
> > From: Xi.Yue Chen.Wu [mailto:wxyc@yahoo.com]
> > Sent: Thursday, August 12, 2004 9:31 AM
> > To: axis-user@ws.apache.org
> > Subject: A question about an Axis client talk to a Perl/SOAP::Lite WS
> > server. Help please!
> >
> > Hi, All.
> >
> > I wrote a simple WS server in Perl(SOAP::Lite 0.55),
> > which serves its purpose(echoing whatever string it
> > receives) fine if the client is also in
> > Perl/SOAP::Lite or Apache-Soap-2.3.1. However, if the
> > client is written
> > in Axis1.1, the client can not get the service.
> >
> > Here is the detail:
> >
> > The WS server is deployed in the static mode, like
> > this:
> >
> > --------------------8<-----------------------
> > #! /usr/local/bin/perl -w
> > use SOAP::Transport::HTTP;
> > use lib ("/nas/aidddev/test/testSoap/");
> > use EchoYa qw(echoYa);
> >
> > $SIG{PIPE} = $SIG{INT} = 'IGNORE';
> >
> > $daemon = SOAP::Transport::HTTP::Daemon
> > -> new (LocalPort => 8003)
> > -> dispatch_to('EchoYa');
> > $daemon->handle;
> > --------------------8<-----------------------
> >
> > The EchoYa.pm is like this:
> > --------------------8<-----------------------
> > package EchoYa;
> >
> > require Exporter;
> > @ISA = qw(Exporter);
> > @EXPORT = qw( echoYa );
> >
> > sub echoYa {
> > print "enter echoYa\n";
> > my $self = shift;
> > my $ya = shift;
> > return "I got $ya!";
> > }
> > 1;
> > --------------------8<-----------------------
> >
> > The client is:
> > --------------------8<-----------------------
> > 1. package samples.userguide.example1;
> >
> > 2. import org.apache.axis.client.Call;
> > 3. import org.apache.axis.client.Service;
> > 4. import javax.xml.namespace.QName;
> >
> > 5. public class TestClient {
> > 6. public static void main(String [] args) {
> > 7. String ret = "1";
> > 8. try {
> > 9. String endpoint =
> > "http://foobar:8003/EchoYa";
> >
> > 10. Service service = new Service();
> > 11. Call call = (Call)
> > service.createCall();
> >
> > 12. call.setTargetEndpointAddress( new
> > java.net.URL(endpoint) );
> > 13. call.setOperationName("echoYa");
> > 14. call.setUseSOAPAction(true);
> > 15. call.setSOAPActionURI("echoYa");
> >
> > 16. ret = (String) call.invoke( new Object[]
> > { "aMsssg" } );
> >
> > 17. System.out.println("Sent aMsssg , got
> > '" + ret + "'");
> > 18. } catch (Exception e) {
> > 19. System.err.println(e.toString());
> > 20. }
> > 21. }
> > 22. }
> > --------------------8<-----------------------
> > The error message I got is:
> > SOAPAction shall match 'uri#method' if present (got
> > 'echoYa', expected '#echoYa'
> >
> > Then, I altered the code of the client a little bit by
> > commenting out line 14 and 15. (which means, not
> > calling the setSOAPActionURI() method).
> > --------------------8<-----------------------
> > 1. package samples.userguide.example1;
> >
> > 2. import org.apache.axis.client.Call;
> > 3. import org.apache.axis.client.Service;
> > 4. import javax.xml.namespace.QName;
> >
> > 5. public class TestClient {
> > 6. public static void main(String [] args) {
> > 7. String ret = "1";
> > 8. try {
> > 9. String endpoint =
> > "http://foobar:8003/EchoYa";
> >
> > 10. Service service = new Service();
> > 11. Call call = (Call)
> > service.createCall();
> >
> > 12. call.setTargetEndpointAddress( new
> > java.net.URL(endpoint) );
> > 13. call.setOperationName("echoYa");
> > 14. //call.setUseSOAPAction(true);
> > 15. //call.setSOAPActionURI("echoYa");
> >
> > 16. ret = (String) call.invoke( new Object[]
> > { "aMsssg" } );
> >
> > 17. System.out.println("Sent aMsssg , got
> > '" + ret + "'");
> > 18. } catch (Exception e) {
> > 19. System.err.println(e.toString());
> > 20. }
> > 21. }
> > 22. }
> > --------------------8<-----------------------
> > Then I got complain like this:
> >
> > Denied access to method (echoYa) in class (main) at
> > /host/dev/lib/site_perl/5.6.1/SOAP/Lite.pm line 2130.
> >
> > Did anyone have a similiar difficulty before.
> > I bet I must have missed something. Can anyone help?
> >
> > Thanks in advance,
> >
> > Donald
> >
> >
> >
> >
> >
>
=== message truncated ===
__________________________________
Do you Yahoo!?
Y! Messenger - Communicate in real time. Download now.
http://messenger.yahoo.com
RE: A question about an Axis client talk to a Perl/SOAP::Lite WS server. Help please!
Posted by Anne Thomas Manes <an...@manes.net>.
It would help to have a WSDL -- because the WSDL will tell you what
SOAPAction it's expecting. But you don't need to have one.
By default, SOAP::Lite uses a SOAPAction URI with the format [uri]#[method],
which is why I suggested what I did.
Try these two options:
call.setSOAPActionURI("#echoYa");
and
call.setSOAPActionURI("");
Good luck,
Anne
-----Original Message-----
From: Donald Chen [mailto:wxyc@yahoo.com]
Sent: Thursday, August 12, 2004 1:52 PM
To: axis-user@ws.apache.org
Subject: RE: A question about an Axis client talk to a Perl/SOAP::Lite WS
server. Help please!
Anne,
I tried with:
call.setSOAPActionURI("http://foobar:8003/EchoYa#echoYa");
It still does not work, the error msg remains similar. Is that because I
did not have
a WSDL for the WS server?
Thanks,
Donald
--- Anne Thomas Manes <an...@manes.net> wrote:
> SOAP::Lite is rejecting your request because you have not specified the
> correct SOAPAction value. SOAPAction is supposed to be a URI. Look at the
> WSDL document to determine the correct value for SOAPAction value. It's
> specified in the <soap:operation> element in the <binding>.
>
> Then change line 15 so that you specify the correct value. Perhaps
something
> like:
>
> 15. call.setSOAPActionURI("http://foobar:8003/EchoYa#echoYa");
>
> Regards,
> Anne
>
> -----Original Message-----
> From: Xi.Yue Chen.Wu [mailto:wxyc@yahoo.com]
> Sent: Thursday, August 12, 2004 9:31 AM
> To: axis-user@ws.apache.org
> Subject: A question about an Axis client talk to a Perl/SOAP::Lite WS
> server. Help please!
>
> Hi, All.
>
> I wrote a simple WS server in Perl(SOAP::Lite 0.55),
> which serves its purpose(echoing whatever string it
> receives) fine if the client is also in
> Perl/SOAP::Lite or Apache-Soap-2.3.1. However, if the
> client is written
> in Axis1.1, the client can not get the service.
>
> Here is the detail:
>
> The WS server is deployed in the static mode, like
> this:
>
> --------------------8<-----------------------
> #! /usr/local/bin/perl -w
> use SOAP::Transport::HTTP;
> use lib ("/nas/aidddev/test/testSoap/");
> use EchoYa qw(echoYa);
>
> $SIG{PIPE} = $SIG{INT} = 'IGNORE';
>
> $daemon = SOAP::Transport::HTTP::Daemon
> -> new (LocalPort => 8003)
> -> dispatch_to('EchoYa');
> $daemon->handle;
> --------------------8<-----------------------
>
> The EchoYa.pm is like this:
> --------------------8<-----------------------
> package EchoYa;
>
> require Exporter;
> @ISA = qw(Exporter);
> @EXPORT = qw( echoYa );
>
> sub echoYa {
> print "enter echoYa\n";
> my $self = shift;
> my $ya = shift;
> return "I got $ya!";
> }
> 1;
> --------------------8<-----------------------
>
> The client is:
> --------------------8<-----------------------
> 1. package samples.userguide.example1;
>
> 2. import org.apache.axis.client.Call;
> 3. import org.apache.axis.client.Service;
> 4. import javax.xml.namespace.QName;
>
> 5. public class TestClient {
> 6. public static void main(String [] args) {
> 7. String ret = "1";
> 8. try {
> 9. String endpoint =
> "http://foobar:8003/EchoYa";
>
> 10. Service service = new Service();
> 11. Call call = (Call)
> service.createCall();
>
> 12. call.setTargetEndpointAddress( new
> java.net.URL(endpoint) );
> 13. call.setOperationName("echoYa");
> 14. call.setUseSOAPAction(true);
> 15. call.setSOAPActionURI("echoYa");
>
> 16. ret = (String) call.invoke( new Object[]
> { "aMsssg" } );
>
> 17. System.out.println("Sent aMsssg , got
> '" + ret + "'");
> 18. } catch (Exception e) {
> 19. System.err.println(e.toString());
> 20. }
> 21. }
> 22. }
> --------------------8<-----------------------
> The error message I got is:
> SOAPAction shall match 'uri#method' if present (got
> 'echoYa', expected '#echoYa'
>
> Then, I altered the code of the client a little bit by
> commenting out line 14 and 15. (which means, not
> calling the setSOAPActionURI() method).
> --------------------8<-----------------------
> 1. package samples.userguide.example1;
>
> 2. import org.apache.axis.client.Call;
> 3. import org.apache.axis.client.Service;
> 4. import javax.xml.namespace.QName;
>
> 5. public class TestClient {
> 6. public static void main(String [] args) {
> 7. String ret = "1";
> 8. try {
> 9. String endpoint =
> "http://foobar:8003/EchoYa";
>
> 10. Service service = new Service();
> 11. Call call = (Call)
> service.createCall();
>
> 12. call.setTargetEndpointAddress( new
> java.net.URL(endpoint) );
> 13. call.setOperationName("echoYa");
> 14. //call.setUseSOAPAction(true);
> 15. //call.setSOAPActionURI("echoYa");
>
> 16. ret = (String) call.invoke( new Object[]
> { "aMsssg" } );
>
> 17. System.out.println("Sent aMsssg , got
> '" + ret + "'");
> 18. } catch (Exception e) {
> 19. System.err.println(e.toString());
> 20. }
> 21. }
> 22. }
> --------------------8<-----------------------
> Then I got complain like this:
>
> Denied access to method (echoYa) in class (main) at
> /host/dev/lib/site_perl/5.6.1/SOAP/Lite.pm line 2130.
>
> Did anyone have a similiar difficulty before.
> I bet I must have missed something. Can anyone help?
>
> Thanks in advance,
>
> Donald
>
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail
>
>
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
RE: A question about an Axis client talk to a Perl/SOAP::Lite WS server. Help please!
Posted by Donald Chen <wx...@yahoo.com>.
Anne,
I tried with:
call.setSOAPActionURI("http://foobar:8003/EchoYa#echoYa");
It still does not work, the error msg remains similar. Is that because I did not have
a WSDL for the WS server?
Thanks,
Donald
--- Anne Thomas Manes <an...@manes.net> wrote:
> SOAP::Lite is rejecting your request because you have not specified the
> correct SOAPAction value. SOAPAction is supposed to be a URI. Look at the
> WSDL document to determine the correct value for SOAPAction value. It's
> specified in the <soap:operation> element in the <binding>.
>
> Then change line 15 so that you specify the correct value. Perhaps something
> like:
>
> 15. call.setSOAPActionURI("http://foobar:8003/EchoYa#echoYa");
>
> Regards,
> Anne
>
> -----Original Message-----
> From: Xi.Yue Chen.Wu [mailto:wxyc@yahoo.com]
> Sent: Thursday, August 12, 2004 9:31 AM
> To: axis-user@ws.apache.org
> Subject: A question about an Axis client talk to a Perl/SOAP::Lite WS
> server. Help please!
>
> Hi, All.
>
> I wrote a simple WS server in Perl(SOAP::Lite 0.55),
> which serves its purpose(echoing whatever string it
> receives) fine if the client is also in
> Perl/SOAP::Lite or Apache-Soap-2.3.1. However, if the
> client is written
> in Axis1.1, the client can not get the service.
>
> Here is the detail:
>
> The WS server is deployed in the static mode, like
> this:
>
> --------------------8<-----------------------
> #! /usr/local/bin/perl -w
> use SOAP::Transport::HTTP;
> use lib ("/nas/aidddev/test/testSoap/");
> use EchoYa qw(echoYa);
>
> $SIG{PIPE} = $SIG{INT} = 'IGNORE';
>
> $daemon = SOAP::Transport::HTTP::Daemon
> -> new (LocalPort => 8003)
> -> dispatch_to('EchoYa');
> $daemon->handle;
> --------------------8<-----------------------
>
> The EchoYa.pm is like this:
> --------------------8<-----------------------
> package EchoYa;
>
> require Exporter;
> @ISA = qw(Exporter);
> @EXPORT = qw( echoYa );
>
> sub echoYa {
> print "enter echoYa\n";
> my $self = shift;
> my $ya = shift;
> return "I got $ya!";
> }
> 1;
> --------------------8<-----------------------
>
> The client is:
> --------------------8<-----------------------
> 1. package samples.userguide.example1;
>
> 2. import org.apache.axis.client.Call;
> 3. import org.apache.axis.client.Service;
> 4. import javax.xml.namespace.QName;
>
> 5. public class TestClient {
> 6. public static void main(String [] args) {
> 7. String ret = "1";
> 8. try {
> 9. String endpoint =
> "http://foobar:8003/EchoYa";
>
> 10. Service service = new Service();
> 11. Call call = (Call)
> service.createCall();
>
> 12. call.setTargetEndpointAddress( new
> java.net.URL(endpoint) );
> 13. call.setOperationName("echoYa");
> 14. call.setUseSOAPAction(true);
> 15. call.setSOAPActionURI("echoYa");
>
> 16. ret = (String) call.invoke( new Object[]
> { "aMsssg" } );
>
> 17. System.out.println("Sent aMsssg , got
> '" + ret + "'");
> 18. } catch (Exception e) {
> 19. System.err.println(e.toString());
> 20. }
> 21. }
> 22. }
> --------------------8<-----------------------
> The error message I got is:
> SOAPAction shall match 'uri#method' if present (got
> 'echoYa', expected '#echoYa'
>
> Then, I altered the code of the client a little bit by
> commenting out line 14 and 15. (which means, not
> calling the setSOAPActionURI() method).
> --------------------8<-----------------------
> 1. package samples.userguide.example1;
>
> 2. import org.apache.axis.client.Call;
> 3. import org.apache.axis.client.Service;
> 4. import javax.xml.namespace.QName;
>
> 5. public class TestClient {
> 6. public static void main(String [] args) {
> 7. String ret = "1";
> 8. try {
> 9. String endpoint =
> "http://foobar:8003/EchoYa";
>
> 10. Service service = new Service();
> 11. Call call = (Call)
> service.createCall();
>
> 12. call.setTargetEndpointAddress( new
> java.net.URL(endpoint) );
> 13. call.setOperationName("echoYa");
> 14. //call.setUseSOAPAction(true);
> 15. //call.setSOAPActionURI("echoYa");
>
> 16. ret = (String) call.invoke( new Object[]
> { "aMsssg" } );
>
> 17. System.out.println("Sent aMsssg , got
> '" + ret + "'");
> 18. } catch (Exception e) {
> 19. System.err.println(e.toString());
> 20. }
> 21. }
> 22. }
> --------------------8<-----------------------
> Then I got complain like this:
>
> Denied access to method (echoYa) in class (main) at
> /host/dev/lib/site_perl/5.6.1/SOAP/Lite.pm line 2130.
>
> Did anyone have a similiar difficulty before.
> I bet I must have missed something. Can anyone help?
>
> Thanks in advance,
>
> Donald
>
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail
>
>
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
RE: A question about an Axis client talk to a Perl/SOAP::Lite WS server. Help please!
Posted by Anne Thomas Manes <an...@manes.net>.
SOAP::Lite is rejecting your request because you have not specified the
correct SOAPAction value. SOAPAction is supposed to be a URI. Look at the
WSDL document to determine the correct value for SOAPAction value. It's
specified in the <soap:operation> element in the <binding>.
Then change line 15 so that you specify the correct value. Perhaps something
like:
15. call.setSOAPActionURI("http://foobar:8003/EchoYa#echoYa");
Regards,
Anne
-----Original Message-----
From: Xi.Yue Chen.Wu [mailto:wxyc@yahoo.com]
Sent: Thursday, August 12, 2004 9:31 AM
To: axis-user@ws.apache.org
Subject: A question about an Axis client talk to a Perl/SOAP::Lite WS
server. Help please!
Hi, All.
I wrote a simple WS server in Perl(SOAP::Lite 0.55),
which serves its purpose(echoing whatever string it
receives) fine if the client is also in
Perl/SOAP::Lite or Apache-Soap-2.3.1. However, if the
client is written
in Axis1.1, the client can not get the service.
Here is the detail:
The WS server is deployed in the static mode, like
this:
--------------------8<-----------------------
#! /usr/local/bin/perl -w
use SOAP::Transport::HTTP;
use lib ("/nas/aidddev/test/testSoap/");
use EchoYa qw(echoYa);
$SIG{PIPE} = $SIG{INT} = 'IGNORE';
$daemon = SOAP::Transport::HTTP::Daemon
-> new (LocalPort => 8003)
-> dispatch_to('EchoYa');
$daemon->handle;
--------------------8<-----------------------
The EchoYa.pm is like this:
--------------------8<-----------------------
package EchoYa;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw( echoYa );
sub echoYa {
print "enter echoYa\n";
my $self = shift;
my $ya = shift;
return "I got $ya!";
}
1;
--------------------8<-----------------------
The client is:
--------------------8<-----------------------
1. package samples.userguide.example1;
2. import org.apache.axis.client.Call;
3. import org.apache.axis.client.Service;
4. import javax.xml.namespace.QName;
5. public class TestClient {
6. public static void main(String [] args) {
7. String ret = "1";
8. try {
9. String endpoint =
"http://foobar:8003/EchoYa";
10. Service service = new Service();
11. Call call = (Call)
service.createCall();
12. call.setTargetEndpointAddress( new
java.net.URL(endpoint) );
13. call.setOperationName("echoYa");
14. call.setUseSOAPAction(true);
15. call.setSOAPActionURI("echoYa");
16. ret = (String) call.invoke( new Object[]
{ "aMsssg" } );
17. System.out.println("Sent aMsssg , got
'" + ret + "'");
18. } catch (Exception e) {
19. System.err.println(e.toString());
20. }
21. }
22. }
--------------------8<-----------------------
The error message I got is:
SOAPAction shall match 'uri#method' if present (got
'echoYa', expected '#echoYa'
Then, I altered the code of the client a little bit by
commenting out line 14 and 15. (which means, not
calling the setSOAPActionURI() method).
--------------------8<-----------------------
1. package samples.userguide.example1;
2. import org.apache.axis.client.Call;
3. import org.apache.axis.client.Service;
4. import javax.xml.namespace.QName;
5. public class TestClient {
6. public static void main(String [] args) {
7. String ret = "1";
8. try {
9. String endpoint =
"http://foobar:8003/EchoYa";
10. Service service = new Service();
11. Call call = (Call)
service.createCall();
12. call.setTargetEndpointAddress( new
java.net.URL(endpoint) );
13. call.setOperationName("echoYa");
14. //call.setUseSOAPAction(true);
15. //call.setSOAPActionURI("echoYa");
16. ret = (String) call.invoke( new Object[]
{ "aMsssg" } );
17. System.out.println("Sent aMsssg , got
'" + ret + "'");
18. } catch (Exception e) {
19. System.err.println(e.toString());
20. }
21. }
22. }
--------------------8<-----------------------
Then I got complain like this:
Denied access to method (echoYa) in class (main) at
/host/dev/lib/site_perl/5.6.1/SOAP/Lite.pm line 2130.
Did anyone have a similiar difficulty before.
I bet I must have missed something. Can anyone help?
Thanks in advance,
Donald
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail