You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Teruhiko Kurosaka <Ku...@basistech.com> on 2007/11/29 00:02:50 UTC

perl (SOAPLite) interoperability with CXF

Hi,
I'm trying to write a perl client that can talk to the server
found in samples/hello_world_RPCLit of CXF 2.0.1.

The perl code I tried is as simple as this:

use SOAP::Lite;
print "Connecting to Hello Service...\n";
$srvc = SOAP::Lite
    -> proxy('http://localhost:9000/SoapContext/SoapPort')
    -> uri('http://apache.org/hello_world_rpclit');
print $srvc -> sayHi() -> result, "\n";
print $srvc -> greetMe("Mr. Perl") -> result, "\n";


sayHi() is executed as expected and returns "Bonjour".
On the console where the CXF server code is run,
     [java] Executing operation sayHi
is printed.

But greetMe() behaves like a no-op.  Nothing happens.
Even no error messages.  Nothing is printed on the CXF server
console, so Java's String greetMe(String) must have not 
been executed.

Anybody has any idea?

T. "Kuro" Kurosaka

RE: perl (SOAPLite) interoperability with CXF

Posted by Teruhiko Kurosaka <Ku...@basistech.com>.
Thank you, Dan, 
I've verified this is a bug in SOAPLite.
I changed the prefix soap to wsdlsoap, and feed that WSDL
to the perl client, and this simpler version of the client worked!

use SOAP::Lite;
$srvc = SOAP::Lite 
    ->service("file:./hello_world-wsdl.xml")
    ->on_action (sub { return '' } );
print $srvc->greetMe("SOAPLIte"), "\n";

-kuro

Re: perl (SOAPLite) interoperability with CXF

Posted by Daniel Kulp <dk...@apache.org>.
Definitely issue with SOAPLite.   A quick google and a look at the 
www.soaplite.com shows:

"As a result, SOAP::Lite has a number of known interoperability issues 
with more modern implementations of SOAP servers and clients."

Dan


On Friday 30 November 2007, Teruhiko Kurosaka wrote:
> With help from Benson, I now have a working perl client that
> talks to the hello_world_RPCLit server:
> ####################################
> use SOAP::Lite;
> $nmsp = 'http://apache.org/hello_world_rpclit';
> $srvc = SOAP::Lite-> uri($nmsp
>     ->proxy("http://xpen-kuro:9000/SoapContext/SoapPort")
>     ->on_action (sub { return '' } );
> my $method = SOAP::Data->name('ns1:greetMe')
>   ->attr({'xmlns:ns1' => $nmsp});
> my @params = (SOAP::Data->name(in=>"Mr. Perl"));
> print $srvc->call($method=>@params)->result;
> ####################################
>
> This code also works with hello_world_code_first server
> with mionor modifications.
>
>
> This looks too complicated to accomplish a simple
> task, and I tried to write a simpler perl client that reads WSDL.
> This is what I came up with:
> ####################################
> use SOAP::Lite;
> $nmsp = 'http://apache.org/hello_world_rpclit';
> $srvc = SOAP::Lite #-> uri($nmsp)
>     ->service("http://xpen-kuro:9000/SoapContext/SoapPort?wsdl")
>     ->on_action (sub { return '' } );
> print $srvc->greetMe("Ms. Perl"), "\n";
> ####################################
>
> This one ends up with a fault message from the hello_world_RPCLit
> server:
> <soap:Envelope
> 	xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>  <soap:Body>
>   <soap:Fault>
>    <faultcode>soap:VersionMismatch</faultcode>
>    <faultstring>
>     "http://schemas.xmlsoap.org/wsdl/soap/" is not a valid SOAP
> version. </faultstring>
>   </soap:Fault>
>  </soap:Body>
> </soap:Envelope>
>
> The quoted URI is used in the request message's soap:Envelope
> element as in:
> <soap:Envelope
>        xmlns:ns3="http://schemas.xmlsoap.org/soap/http"
>        xmlns:ns1="http://apache.org/hello_world_rpclit"
>        xmlns:ns2="http://apache.org/hello_world_rpclit/types"
>        soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>        ...>
>
> Surely, the namespace prefix definition should have been:
> 	xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> since it is used to qualify the Envelope and Body elements.
>
>
> I am guessing that SOAP::Lite took the wrong definition
> from the WSDL file (samples/hello_world_RCPLit/wsdl/helloWorld.wsdl).
> It looks SOAP::Lite is mixing up the soap prefex used to interpret the
> WSDL file with the prefix it should use to generate the request
> message. Can I conclude SOAP::Lite is the guilty party, not CXF?
>
> -kuro
>
> > -----Original Message-----
> > From: James Mao [mailto:james.mao@iona.com]
> > Sent: Thursday, November 29, 2007 8:42 PM
> > To: cxf-user@incubator.apache.org
> > Subject: Re: perl (SOAPLite) interoperability with CXF
> >
> > Log the outgoing message, and the incoming message, and see
> > if there's
> > anything different with the cxf client/server
> >
> > Regards,
> > James
> >
> > > Hi,
> > > I'm trying to write a perl client that can talk to the server
> > > found in samples/hello_world_RPCLit of CXF 2.0.1.
> > >
> > > The perl code I tried is as simple as this:
> > >
> > > use SOAP::Lite;
> > > print "Connecting to Hello Service...\n";
> > > $srvc = SOAP::Lite
> > >     -> proxy('http://localhost:9000/SoapContext/SoapPort')
> > >     -> uri('http://apache.org/hello_world_rpclit');
> > > print $srvc -> sayHi() -> result, "\n";
> > > print $srvc -> greetMe("Mr. Perl") -> result, "\n";
> > >
> > >
> > > sayHi() is executed as expected and returns "Bonjour".
> > > On the console where the CXF server code is run,
> > >      [java] Executing operation sayHi
> > > is printed.
> > >
> > > But greetMe() behaves like a no-op.  Nothing happens.
> > > Even no error messages.  Nothing is printed on the CXF server
> > > console, so Java's String greetMe(String) must have not
> > > been executed.
> > >
> > > Anybody has any idea?
> > >
> > > T. "Kuro" Kurosaka



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: perl (SOAPLite) interoperability with CXF

Posted by tog <gu...@gmail.com>.
Cool, I will try that one.
Guillaume

On Dec 1, 2007 11:30 AM, Daniel Kulp <dk...@apache.org> wrote:
>
> > This is 100% trunk. I've been leaving muddy footprints all over the
> > trunk for this. Perhaps you could talk Dan into a 2.1 snapshot?
>
> Did one this morning.   I'm a step ahead of you.   :-)
>
> Dan
>
>
>
> On Friday 30 November 2007, Benson Margulies wrote:
> > The handler for ?js URLs is only in the server side, and the
> > generation code runs, for this purpose, on the server. With the
> > expectation of a client being a browser.
> >
> > The generation code itself, however, is a more complex story.
> >
> > CXF builds up a set of objects called the service model whenever it
> > parses a WSDL or constructs a service from some other set of
> > information, like JAXWS+JAXB or Aegis. While I suspect that CXF
> > generally runs the service-model-building code
> > (ReflectionServiceFactoryBean, WSDLServiceBuilder, ...) on the server
> > side, I don't see why it couldn't run on the client side. After all,
> > the proxy factory has to have some of the same data.
> >
> > In theory, as you say, we could return ANYTHING. Returning Javascript
> > is useful because browsers eat Javascript right there, on the spot.
> > So, a web page could do:
> >
> > <script type='text/javascript' src='http://bloop/service?jsutil'/>
> > <script type='text/javascript' src='http://bloop/service?js'/>
> >
> > and then, later, use the object thus obtained to talk to the server.
> >
> > The original idea for this was a separate generator program that read
> > WSDL and wrote Javascript.
> >
> > I'm currently teasing my co-worker Kuro as to whether he wants to try
> > to bang out a perl variation on the theme.
> >
> > Note that we plan to hang some sort of wstojs command onto the front
> > of this for people who prefer their Javascript to sit still in files
> > where they can read it.
> >
> > This is 100% trunk. I've been leaving muddy footprints all over the
> > trunk for this. Perhaps you could talk Dan into a 2.1 snapshot?
> >
> > > -----Original Message-----
> > > From: tog [mailto:guillaume.alleon@gmail.com]
> > > Sent: Friday, November 30, 2007 10:07 PM
> > > To: cxf-user@incubator.apache.org
> > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > >
> > > Well cool we can set up a new french mailing list :-)
> > >
> > > Bravo pour le francais  ...
> > >
> > > Is this something that is generated by the cxf client part
> > > (processing the wsdl) or which is returned by the server ?
> > > Is this really in trunk or can I get an idea looking at 2.0.3 ?
> > >
> > > Then, it definitely makes sense for all languages ? isn't it
> > > ? We could imagine that http://host:port/service?java returns
> > > java code ( may be it is already the case ;-))
> > >
> > > Cheers
> > > Guillaume
> > >
> > >
> > > On Dec 1, 2007 10:51 AM, Benson Margulies
> > >
> > > <bi...@basistech.com> wrote:
> > > > Guillaume,
> > > >
> > > > Je ne suis pas sur que je comprend. Mais, peut-etre un
> > >
> > > reponse utile:
> > > > In the current trunk of CXF, if you send the server a URL like:
> > > >
> > > > http://host:port/service?jsutil
> > > >
> > > > and then
> > > >
> > > > http://host:port/service?js
> > > >
> > > > you will get back in return javascript code that will talk to the
> > > > service. The first returns generic JavaScript, and the
> > >
> > > second specific
> > >
> > > > code to talk to the particular service. I have tested it
> > >
> > > for a number
> > >
> > > > of Doc/Lit services.
> > > >
> > > > See rt/javascript in the source tree.
> > > >
> > > > I don't know \anything/ about groovy, so I can't address whether
> > > > groovy could use it.
> > > >
> > > > --benson
> > > >
> > > > > -----Original Message-----
> > > > > From: tog [mailto:guillaume.alleon@gmail.com]
> > > > > Sent: Friday, November 30, 2007 9:46 PM
> > > > > To: cxf-user@incubator.apache.org
> > > > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > > > >
> > > > > Benson,
> > > > >
> > > > > A naive question: what is doing the javascript generator ?
> > > > > Would that make sense for groovy ?
> > > > >
> > > > > Cheers
> > > > > Guillaume
> > > > >
> > > > > On Dec 1, 2007 8:40 AM, Benson Margulies <bi...@basistech.com>
> > > > >
> > > > > wrote:
> > > > > > Kuro,
> > > > > >
> > > > > > You could build a perl generator for CXF like the
> > > > >
> > > > > Javascript generator
> > > > >
> > > > > > I've nearly finished.
> > > > > >
> > > > > > --benson
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Teruhiko Kurosaka [mailto:Kuro@basistech.com]
> > > > > > > Sent: Friday, November 30, 2007 7:10 PM
> > > > > > > To: cxf-user@incubator.apache.org
> > > > > > >
> > > > > > > Subject: RE: perl (SOAPLite) interoperability with CXF
> > > > > > >
> > > > > > > With help from Benson, I now have a working perl client
> > > > >
> > > > > that talks
> > > > >
> > > > > > > to the hello_world_RPCLit server:
> > > > > > > ####################################
> > > > > > > use SOAP::Lite;
> > > > > > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > > > > > $srvc = SOAP::Lite-> uri($nmsp)
> > > > > > >     ->proxy("http://xpen-kuro:9000/SoapContext/SoapPort")
> > > > > > >     ->on_action (sub { return '' } ); my $method =
> > > > > > > SOAP::Data->name('ns1:greetMe')
> > > > > > >   ->attr({'xmlns:ns1' => $nmsp}); my @params =
> > > > > > > (SOAP::Data->name(in=>"Mr. Perl")); print
> > > > > > > $srvc->call($method=>@params)->result;
> > > > > > > ####################################
> > > > > > >
> > > > > > > This code also works with hello_world_code_first server
> > > > >
> > > > > with mionor
> > > > >
> > > > > > > modifications.
> > > > > > >
> > > > > > >
> > > > > > > This looks too complicated to accomplish a simple task,
> > > > >
> > > > > and I tried
> > > > >
> > > > > > > to write a simpler perl client that reads WSDL.
> > > > > > > This is what I came up with:
> > > > > > > ####################################
> > > > > > > use SOAP::Lite;
> > > > > > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > > > > > $srvc = SOAP::Lite #-> uri($nmsp)
> > >
> > > ->service("http://xpen-kuro:9000/SoapContext/SoapPort?wsdl")
> > >
> > > > > > >     ->on_action (sub { return '' } ); print
> > >
> > > $srvc->greetMe("Ms.
> > >
> > > > > > > Perl"), "\n"; ####################################
> > > > > > >
> > > > > > > This one ends up with a fault message from the
> > > > > > > hello_world_RPCLit
> > > > > > > server:
> > > > > > > <soap:Envelope
> > > > > > >
> > > > > > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > > > > > > <soap:Body>
> > > > > > >   <soap:Fault>
> > > > > > >    <faultcode>soap:VersionMismatch</faultcode>
> > > > > > >    <faultstring>
> > > > > > >     "http://schemas.xmlsoap.org/wsdl/soap/" is not a
> > >
> > > valid SOAP
> > >
> > > > > > > version.
> > > > > > >    </faultstring>
> > > > > > >   </soap:Fault>
> > > > > > >  </soap:Body>
> > > > > > > </soap:Envelope>
> > > > > > >
> > > > > > > The quoted URI is used in the request message's
> > > > > > > soap:Envelope element as in:
> > > > > > > <soap:Envelope
> > > > > > >        xmlns:ns3="http://schemas.xmlsoap.org/soap/http"
> > > > > > >        xmlns:ns1="http://apache.org/hello_world_rpclit"
> > > > > > >
> > > > > > > xmlns:ns2="http://apache.org/hello_world_rpclit/types"
> > > > >
> > > > > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > > >
> > > > > > >        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > > > > >        ...>
> > > > > > >
> > > > > > > Surely, the namespace prefix definition should have been:
> > > > > > >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> > > > > > > since it is used to qualify the Envelope and Body elements.
> > > > > > >
> > > > > > >
> > > > > > > I am guessing that SOAP::Lite took the wrong
> > >
> > > definition from the
> > >
> > > > > > > WSDL file (samples/hello_world_RCPLit/wsdl/helloWorld.wsdl).
> > > > > > > It looks SOAP::Lite is mixing up the soap prefex used to
> > > > >
> > > > > interpret
> > > > >
> > > > > > > the WSDL file with the prefix it should use to generate
> > > > >
> > > > > the request
> > > > >
> > > > > > > message.
> > > > > > > Can I conclude SOAP::Lite is the guilty party, not CXF?
> > > > > > >
> > > > > > > -kuro
> > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: James Mao [mailto:james.mao@iona.com]
> > > > > > > > Sent: Thursday, November 29, 2007 8:42 PM
> > > > > > > > To: cxf-user@incubator.apache.org
> > > > > > > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > > > > > > >
> > > > > > > > Log the outgoing message, and the incoming message, and
> > > > > > > > see
> > > > > > >
> > > > > > > if there's
> > > > > > >
> > > > > > > > anything different with the cxf client/server
> > > > > > > >
> > > > > > > > Regards,
> > > > > > > > James
> > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > > I'm trying to write a perl client that can talk to the
> > > > > > >
> > > > > > > server found
> > > > > > >
> > > > > > > > > in samples/hello_world_RPCLit of CXF 2.0.1.
> > > > > > > > >
> > > > > > > > > The perl code I tried is as simple as this:
> > > > > > > > >
> > > > > > > > > use SOAP::Lite;
> > > > > > > > > print "Connecting to Hello Service...\n"; $srvc =
> > >
> > > SOAP::Lite
> > >
> > > > > > > > >     ->
> > > > > > > > > proxy('http://localhost:9000/SoapContext/SoapPort') ->
> > > > > > > > > uri('http://apache.org/hello_world_rpclit'); print $srvc
> > > > > > > > > -> sayHi() -> result, "\n"; print $srvc ->
> > > > > > >
> > > > > > > greetMe("Mr.
> > > > > > >
> > > > > > > > > Perl") -> result, "\n";
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > sayHi() is executed as expected and returns "Bonjour".
> > > > > > > > > On the console where the CXF server code is run,
> > > > > > > > >      [java] Executing operation sayHi is printed.
> > > > > > > > >
> > > > > > > > > But greetMe() behaves like a no-op.  Nothing happens.
> > > > > > > > > Even no error messages.  Nothing is printed on the CXF
> > > > > > > > > server console, so Java's String greetMe(String)
> > >
> > > must have
> > >
> > > > > > > > > not been executed.
> > > > > > > > >
> > > > > > > > > Anybody has any idea?
> > > > > > > > >
> > > > > > > > > T. "Kuro" Kurosaka
> > > > >
> > > > > --
> > > > >
> > > > > Best Regards
> > > > > Guillaume
> > > > > http://cheztog.blogspot.com
> > >
> > > --
> > >
> > > Best Regards
> > > Guillaume
> > > http://cheztog.blogspot.com
>
>
>
>
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog
>



-- 

Best Regards
Guillaume
http://cheztog.blogspot.com

Re: perl (SOAPLite) interoperability with CXF

Posted by Daniel Kulp <dk...@apache.org>.
> This is 100% trunk. I've been leaving muddy footprints all over the
> trunk for this. Perhaps you could talk Dan into a 2.1 snapshot?

Did one this morning.   I'm a step ahead of you.   :-)

Dan


On Friday 30 November 2007, Benson Margulies wrote:
> The handler for ?js URLs is only in the server side, and the
> generation code runs, for this purpose, on the server. With the
> expectation of a client being a browser.
>
> The generation code itself, however, is a more complex story.
>
> CXF builds up a set of objects called the service model whenever it
> parses a WSDL or constructs a service from some other set of
> information, like JAXWS+JAXB or Aegis. While I suspect that CXF
> generally runs the service-model-building code
> (ReflectionServiceFactoryBean, WSDLServiceBuilder, ...) on the server
> side, I don't see why it couldn't run on the client side. After all,
> the proxy factory has to have some of the same data.
>
> In theory, as you say, we could return ANYTHING. Returning Javascript
> is useful because browsers eat Javascript right there, on the spot.
> So, a web page could do:
>
> <script type='text/javascript' src='http://bloop/service?jsutil'/>
> <script type='text/javascript' src='http://bloop/service?js'/>
>
> and then, later, use the object thus obtained to talk to the server.
>
> The original idea for this was a separate generator program that read
> WSDL and wrote Javascript.
>
> I'm currently teasing my co-worker Kuro as to whether he wants to try
> to bang out a perl variation on the theme.
>
> Note that we plan to hang some sort of wstojs command onto the front
> of this for people who prefer their Javascript to sit still in files
> where they can read it.
>
> This is 100% trunk. I've been leaving muddy footprints all over the
> trunk for this. Perhaps you could talk Dan into a 2.1 snapshot?
>
> > -----Original Message-----
> > From: tog [mailto:guillaume.alleon@gmail.com]
> > Sent: Friday, November 30, 2007 10:07 PM
> > To: cxf-user@incubator.apache.org
> > Subject: Re: perl (SOAPLite) interoperability with CXF
> >
> > Well cool we can set up a new french mailing list :-)
> >
> > Bravo pour le francais  ...
> >
> > Is this something that is generated by the cxf client part
> > (processing the wsdl) or which is returned by the server ?
> > Is this really in trunk or can I get an idea looking at 2.0.3 ?
> >
> > Then, it definitely makes sense for all languages ? isn't it
> > ? We could imagine that http://host:port/service?java returns
> > java code ( may be it is already the case ;-))
> >
> > Cheers
> > Guillaume
> >
> >
> > On Dec 1, 2007 10:51 AM, Benson Margulies
> >
> > <bi...@basistech.com> wrote:
> > > Guillaume,
> > >
> > > Je ne suis pas sur que je comprend. Mais, peut-etre un
> >
> > reponse utile:
> > > In the current trunk of CXF, if you send the server a URL like:
> > >
> > > http://host:port/service?jsutil
> > >
> > > and then
> > >
> > > http://host:port/service?js
> > >
> > > you will get back in return javascript code that will talk to the
> > > service. The first returns generic JavaScript, and the
> >
> > second specific
> >
> > > code to talk to the particular service. I have tested it
> >
> > for a number
> >
> > > of Doc/Lit services.
> > >
> > > See rt/javascript in the source tree.
> > >
> > > I don't know \anything/ about groovy, so I can't address whether
> > > groovy could use it.
> > >
> > > --benson
> > >
> > > > -----Original Message-----
> > > > From: tog [mailto:guillaume.alleon@gmail.com]
> > > > Sent: Friday, November 30, 2007 9:46 PM
> > > > To: cxf-user@incubator.apache.org
> > > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > > >
> > > > Benson,
> > > >
> > > > A naive question: what is doing the javascript generator ?
> > > > Would that make sense for groovy ?
> > > >
> > > > Cheers
> > > > Guillaume
> > > >
> > > > On Dec 1, 2007 8:40 AM, Benson Margulies <bi...@basistech.com>
> > > >
> > > > wrote:
> > > > > Kuro,
> > > > >
> > > > > You could build a perl generator for CXF like the
> > > >
> > > > Javascript generator
> > > >
> > > > > I've nearly finished.
> > > > >
> > > > > --benson
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Teruhiko Kurosaka [mailto:Kuro@basistech.com]
> > > > > > Sent: Friday, November 30, 2007 7:10 PM
> > > > > > To: cxf-user@incubator.apache.org
> > > > > >
> > > > > > Subject: RE: perl (SOAPLite) interoperability with CXF
> > > > > >
> > > > > > With help from Benson, I now have a working perl client
> > > >
> > > > that talks
> > > >
> > > > > > to the hello_world_RPCLit server:
> > > > > > ####################################
> > > > > > use SOAP::Lite;
> > > > > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > > > > $srvc = SOAP::Lite-> uri($nmsp)
> > > > > >     ->proxy("http://xpen-kuro:9000/SoapContext/SoapPort")
> > > > > >     ->on_action (sub { return '' } ); my $method =
> > > > > > SOAP::Data->name('ns1:greetMe')
> > > > > >   ->attr({'xmlns:ns1' => $nmsp}); my @params =
> > > > > > (SOAP::Data->name(in=>"Mr. Perl")); print
> > > > > > $srvc->call($method=>@params)->result;
> > > > > > ####################################
> > > > > >
> > > > > > This code also works with hello_world_code_first server
> > > >
> > > > with mionor
> > > >
> > > > > > modifications.
> > > > > >
> > > > > >
> > > > > > This looks too complicated to accomplish a simple task,
> > > >
> > > > and I tried
> > > >
> > > > > > to write a simpler perl client that reads WSDL.
> > > > > > This is what I came up with:
> > > > > > ####################################
> > > > > > use SOAP::Lite;
> > > > > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > > > > $srvc = SOAP::Lite #-> uri($nmsp)
> >
> > ->service("http://xpen-kuro:9000/SoapContext/SoapPort?wsdl")
> >
> > > > > >     ->on_action (sub { return '' } ); print
> >
> > $srvc->greetMe("Ms.
> >
> > > > > > Perl"), "\n"; ####################################
> > > > > >
> > > > > > This one ends up with a fault message from the
> > > > > > hello_world_RPCLit
> > > > > > server:
> > > > > > <soap:Envelope
> > > > > >      
> > > > > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > > > > > <soap:Body>
> > > > > >   <soap:Fault>
> > > > > >    <faultcode>soap:VersionMismatch</faultcode>
> > > > > >    <faultstring>
> > > > > >     "http://schemas.xmlsoap.org/wsdl/soap/" is not a
> >
> > valid SOAP
> >
> > > > > > version.
> > > > > >    </faultstring>
> > > > > >   </soap:Fault>
> > > > > >  </soap:Body>
> > > > > > </soap:Envelope>
> > > > > >
> > > > > > The quoted URI is used in the request message's
> > > > > > soap:Envelope element as in:
> > > > > > <soap:Envelope
> > > > > >        xmlns:ns3="http://schemas.xmlsoap.org/soap/http"
> > > > > >        xmlns:ns1="http://apache.org/hello_world_rpclit"
> > > > > >       
> > > > > > xmlns:ns2="http://apache.org/hello_world_rpclit/types"
> > > >
> > > > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > >
> > > > > >        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > > > >        ...>
> > > > > >
> > > > > > Surely, the namespace prefix definition should have been:
> > > > > >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> > > > > > since it is used to qualify the Envelope and Body elements.
> > > > > >
> > > > > >
> > > > > > I am guessing that SOAP::Lite took the wrong
> >
> > definition from the
> >
> > > > > > WSDL file (samples/hello_world_RCPLit/wsdl/helloWorld.wsdl).
> > > > > > It looks SOAP::Lite is mixing up the soap prefex used to
> > > >
> > > > interpret
> > > >
> > > > > > the WSDL file with the prefix it should use to generate
> > > >
> > > > the request
> > > >
> > > > > > message.
> > > > > > Can I conclude SOAP::Lite is the guilty party, not CXF?
> > > > > >
> > > > > > -kuro
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: James Mao [mailto:james.mao@iona.com]
> > > > > > > Sent: Thursday, November 29, 2007 8:42 PM
> > > > > > > To: cxf-user@incubator.apache.org
> > > > > > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > > > > > >
> > > > > > > Log the outgoing message, and the incoming message, and
> > > > > > > see
> > > > > >
> > > > > > if there's
> > > > > >
> > > > > > > anything different with the cxf client/server
> > > > > > >
> > > > > > > Regards,
> > > > > > > James
> > > > > > >
> > > > > > > > Hi,
> > > > > > > > I'm trying to write a perl client that can talk to the
> > > > > >
> > > > > > server found
> > > > > >
> > > > > > > > in samples/hello_world_RPCLit of CXF 2.0.1.
> > > > > > > >
> > > > > > > > The perl code I tried is as simple as this:
> > > > > > > >
> > > > > > > > use SOAP::Lite;
> > > > > > > > print "Connecting to Hello Service...\n"; $srvc =
> >
> > SOAP::Lite
> >
> > > > > > > >     ->
> > > > > > > > proxy('http://localhost:9000/SoapContext/SoapPort') ->
> > > > > > > > uri('http://apache.org/hello_world_rpclit'); print $srvc
> > > > > > > > -> sayHi() -> result, "\n"; print $srvc ->
> > > > > >
> > > > > > greetMe("Mr.
> > > > > >
> > > > > > > > Perl") -> result, "\n";
> > > > > > > >
> > > > > > > >
> > > > > > > > sayHi() is executed as expected and returns "Bonjour".
> > > > > > > > On the console where the CXF server code is run,
> > > > > > > >      [java] Executing operation sayHi is printed.
> > > > > > > >
> > > > > > > > But greetMe() behaves like a no-op.  Nothing happens.
> > > > > > > > Even no error messages.  Nothing is printed on the CXF
> > > > > > > > server console, so Java's String greetMe(String)
> >
> > must have
> >
> > > > > > > > not been executed.
> > > > > > > >
> > > > > > > > Anybody has any idea?
> > > > > > > >
> > > > > > > > T. "Kuro" Kurosaka
> > > >
> > > > --
> > > >
> > > > Best Regards
> > > > Guillaume
> > > > http://cheztog.blogspot.com
> >
> > --
> >
> > Best Regards
> > Guillaume
> > http://cheztog.blogspot.com



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

RE: perl (SOAPLite) interoperability with CXF

Posted by Benson Margulies <bi...@basistech.com>.
Well, generating complex objects in JS doesn't strike me as all that
different from Java. After some time spent fixing bugs in Aegis, I had
some gut sense of how to map an Xml Schema complex type to a Java class,
and, to achieve Javascript, I just took out all the type safety. It
initializes with the Xml Schema default values, or, if there aren't any,
with undefined.

Keep in mind that we've been using the initial version of this idea in
production at Basis for a couple of years before we decided to donate it
to CXF, so we had some confidence.

Re: perl (SOAPLite) interoperability with CXF

Posted by tog <gu...@gmail.com>.
Merci,

Yes that makes a lot of sense for javascript since it is swallowed by
the browser. For the other languages, I am a bit suspicious.

When Java & Groovy are concerned, the dynamic client helps a lot to
generate the complex type. Sure I could (for Groovy see
http://groovy.codehaus.org/GroovyWS) automatically generate code that
would use  those complex types but does that make sense ? How would
you initialize those complex type ?

Any thoughts ? How are you initializing complex types in
http://bloop/service?js ?

Cheers
Guillaume

On Dec 1, 2007 11:21 AM, Benson Margulies <bi...@basistech.com> wrote:
> The handler for ?js URLs is only in the server side, and the generation
> code runs, for this purpose, on the server. With the expectation of a
> client being a browser.
>
> The generation code itself, however, is a more complex story.
>
> CXF builds up a set of objects called the service model whenever it
> parses a WSDL or constructs a service from some other set of
> information, like JAXWS+JAXB or Aegis. While I suspect that CXF
> generally runs the service-model-building code
> (ReflectionServiceFactoryBean, WSDLServiceBuilder, ...) on the server
> side, I don't see why it couldn't run on the client side. After all, the
> proxy factory has to have some of the same data.
>
> In theory, as you say, we could return ANYTHING. Returning Javascript is
> useful because browsers eat Javascript right there, on the spot. So, a
> web page could do:
>
> <script type='text/javascript' src='http://bloop/service?jsutil'/>
> <script type='text/javascript' src='http://bloop/service?js'/>
>
> and then, later, use the object thus obtained to talk to the server.
>
> The original idea for this was a separate generator program that read
> WSDL and wrote Javascript.
>
> I'm currently teasing my co-worker Kuro as to whether he wants to try to
> bang out a perl variation on the theme.
>
> Note that we plan to hang some sort of wstojs command onto the front of
> this for people who prefer their Javascript to sit still in files where
> they can read it.
>
> This is 100% trunk. I've been leaving muddy footprints all over the
> trunk for this. Perhaps you could talk Dan into a 2.1 snapshot?
>
>
> > -----Original Message-----
> > From: tog [mailto:guillaume.alleon@gmail.com]
>
> > Sent: Friday, November 30, 2007 10:07 PM
> > To: cxf-user@incubator.apache.org
> > Subject: Re: perl (SOAPLite) interoperability with CXF
> >
> > Well cool we can set up a new french mailing list :-)
> >
> > Bravo pour le francais  ...
> >
> > Is this something that is generated by the cxf client part
> > (processing the wsdl) or which is returned by the server ?
> > Is this really in trunk or can I get an idea looking at 2.0.3 ?
> >
> > Then, it definitely makes sense for all languages ? isn't it
> > ? We could imagine that http://host:port/service?java returns
> > java code ( may be it is already the case ;-))
> >
> > Cheers
> > Guillaume
> >
> >
> > On Dec 1, 2007 10:51 AM, Benson Margulies
> > <bi...@basistech.com> wrote:
> > > Guillaume,
> > >
> > > Je ne suis pas sur que je comprend. Mais, peut-etre un
> > reponse utile:
> > >
> > > In the current trunk of CXF, if you send the server a URL like:
> > >
> > > http://host:port/service?jsutil
> > >
> > > and then
> > >
> > > http://host:port/service?js
> > >
> > > you will get back in return javascript code that will talk to the
> > > service. The first returns generic JavaScript, and the
> > second specific
> > > code to talk to the particular service. I have tested it
> > for a number
> > > of Doc/Lit services.
> > >
> > > See rt/javascript in the source tree.
> > >
> > > I don't know \anything/ about groovy, so I can't address whether
> > > groovy could use it.
> > >
> > > --benson
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: tog [mailto:guillaume.alleon@gmail.com]
> > > > Sent: Friday, November 30, 2007 9:46 PM
> > > > To: cxf-user@incubator.apache.org
> > > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > > >
> > > > Benson,
> > > >
> > > > A naive question: what is doing the javascript generator ?
> > > > Would that make sense for groovy ?
> > > >
> > > > Cheers
> > > > Guillaume
> > > >
> > > > On Dec 1, 2007 8:40 AM, Benson Margulies <bi...@basistech.com>
> > > > wrote:
> > > > > Kuro,
> > > > >
> > > > > You could build a perl generator for CXF like the
> > > > Javascript generator
> > > > > I've nearly finished.
> > > > >
> > > > > --benson
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Teruhiko Kurosaka [mailto:Kuro@basistech.com]
> > > > > > Sent: Friday, November 30, 2007 7:10 PM
> > > > > > To: cxf-user@incubator.apache.org
> > > > >
> > > > > > Subject: RE: perl (SOAPLite) interoperability with CXF
> > > > > >
> > > > > > With help from Benson, I now have a working perl client
> > > > that talks
> > > > > > to the hello_world_RPCLit server:
> > > > > > ####################################
> > > > > > use SOAP::Lite;
> > > > > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > > > > $srvc = SOAP::Lite-> uri($nmsp)
> > > > > >     ->proxy("http://xpen-kuro:9000/SoapContext/SoapPort")
> > > > > >     ->on_action (sub { return '' } ); my $method =
> > > > > > SOAP::Data->name('ns1:greetMe')
> > > > > >   ->attr({'xmlns:ns1' => $nmsp}); my @params =
> > > > > > (SOAP::Data->name(in=>"Mr. Perl")); print
> > > > > > $srvc->call($method=>@params)->result;
> > > > > > ####################################
> > > > > >
> > > > > > This code also works with hello_world_code_first server
> > > > with mionor
> > > > > > modifications.
> > > > > >
> > > > > >
> > > > > > This looks too complicated to accomplish a simple task,
> > > > and I tried
> > > > > > to write a simpler perl client that reads WSDL.
> > > > > > This is what I came up with:
> > > > > > ####################################
> > > > > > use SOAP::Lite;
> > > > > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > > > > $srvc = SOAP::Lite #-> uri($nmsp)
> > > > > >
> > ->service("http://xpen-kuro:9000/SoapContext/SoapPort?wsdl")
> > > > > >     ->on_action (sub { return '' } ); print
> > $srvc->greetMe("Ms.
> > > > > > Perl"), "\n"; ####################################
> > > > > >
> > > > > > This one ends up with a fault message from the
> > > > > > hello_world_RPCLit
> > > > > > server:
> > > > > > <soap:Envelope
> > > > > >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > > > > >  <soap:Body>
> > > > > >   <soap:Fault>
> > > > > >    <faultcode>soap:VersionMismatch</faultcode>
> > > > > >    <faultstring>
> > > > > >     "http://schemas.xmlsoap.org/wsdl/soap/" is not a
> > valid SOAP
> > > > > > version.
> > > > > >    </faultstring>
> > > > > >   </soap:Fault>
> > > > > >  </soap:Body>
> > > > > > </soap:Envelope>
> > > > > >
> > > > > > The quoted URI is used in the request message's soap:Envelope
> > > > > > element as in:
> > > > > > <soap:Envelope
> > > > > >        xmlns:ns3="http://schemas.xmlsoap.org/soap/http"
> > > > > >        xmlns:ns1="http://apache.org/hello_world_rpclit"
> > > > > >        xmlns:ns2="http://apache.org/hello_world_rpclit/types"
> > > > > >
> > > > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > > > >        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > > > >        ...>
> > > > > >
> > > > > > Surely, the namespace prefix definition should have been:
> > > > > >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> > > > > > since it is used to qualify the Envelope and Body elements.
> > > > > >
> > > > > >
> > > > > > I am guessing that SOAP::Lite took the wrong
> > definition from the
> > > > > > WSDL file (samples/hello_world_RCPLit/wsdl/helloWorld.wsdl).
> > > > > > It looks SOAP::Lite is mixing up the soap prefex used to
> > > > interpret
> > > > > > the WSDL file with the prefix it should use to generate
> > > > the request
> > > > > > message.
> > > > > > Can I conclude SOAP::Lite is the guilty party, not CXF?
> > > > > >
> > > > > > -kuro
> > > > > >
> > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: James Mao [mailto:james.mao@iona.com]
> > > > > > > Sent: Thursday, November 29, 2007 8:42 PM
> > > > > > > To: cxf-user@incubator.apache.org
> > > > > > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > > > > > >
> > > > > > > Log the outgoing message, and the incoming message, and see
> > > > > > if there's
> > > > > > > anything different with the cxf client/server
> > > > > > >
> > > > > > > Regards,
> > > > > > > James
> > > > > > > > Hi,
> > > > > > > > I'm trying to write a perl client that can talk to the
> > > > > > server found
> > > > > > > > in samples/hello_world_RPCLit of CXF 2.0.1.
> > > > > > > >
> > > > > > > > The perl code I tried is as simple as this:
> > > > > > > >
> > > > > > > > use SOAP::Lite;
> > > > > > > > print "Connecting to Hello Service...\n"; $srvc =
> > SOAP::Lite
> > > > > > > >     -> proxy('http://localhost:9000/SoapContext/SoapPort')
> > > > > > > >     -> uri('http://apache.org/hello_world_rpclit');
> > > > > > > > print $srvc -> sayHi() -> result, "\n"; print $srvc ->
> > > > > > greetMe("Mr.
> > > > > > > > Perl") -> result, "\n";
> > > > > > > >
> > > > > > > >
> > > > > > > > sayHi() is executed as expected and returns "Bonjour".
> > > > > > > > On the console where the CXF server code is run,
> > > > > > > >      [java] Executing operation sayHi is printed.
> > > > > > > >
> > > > > > > > But greetMe() behaves like a no-op.  Nothing happens.
> > > > > > > > Even no error messages.  Nothing is printed on the CXF
> > > > > > > > server console, so Java's String greetMe(String)
> > must have
> > > > > > > > not been executed.
> > > > > > > >
> > > > > > > > Anybody has any idea?
> > > > > > > >
> > > > > > > > T. "Kuro" Kurosaka
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > Best Regards
> > > > Guillaume
> > > > http://cheztog.blogspot.com
> > > >
> > >
> >
> >
> >
> > --
> >
> > Best Regards
> > Guillaume
> > http://cheztog.blogspot.com
> >
>



-- 

Best Regards
Guillaume
http://cheztog.blogspot.com

RE: perl (SOAPLite) interoperability with CXF

Posted by Benson Margulies <bi...@basistech.com>.
The handler for ?js URLs is only in the server side, and the generation
code runs, for this purpose, on the server. With the expectation of a
client being a browser.

The generation code itself, however, is a more complex story. 

CXF builds up a set of objects called the service model whenever it
parses a WSDL or constructs a service from some other set of
information, like JAXWS+JAXB or Aegis. While I suspect that CXF
generally runs the service-model-building code
(ReflectionServiceFactoryBean, WSDLServiceBuilder, ...) on the server
side, I don't see why it couldn't run on the client side. After all, the
proxy factory has to have some of the same data.

In theory, as you say, we could return ANYTHING. Returning Javascript is
useful because browsers eat Javascript right there, on the spot. So, a
web page could do:

<script type='text/javascript' src='http://bloop/service?jsutil'/>
<script type='text/javascript' src='http://bloop/service?js'/>

and then, later, use the object thus obtained to talk to the server.

The original idea for this was a separate generator program that read
WSDL and wrote Javascript.

I'm currently teasing my co-worker Kuro as to whether he wants to try to
bang out a perl variation on the theme.

Note that we plan to hang some sort of wstojs command onto the front of
this for people who prefer their Javascript to sit still in files where
they can read it.

This is 100% trunk. I've been leaving muddy footprints all over the
trunk for this. Perhaps you could talk Dan into a 2.1 snapshot?


> -----Original Message-----
> From: tog [mailto:guillaume.alleon@gmail.com] 
> Sent: Friday, November 30, 2007 10:07 PM
> To: cxf-user@incubator.apache.org
> Subject: Re: perl (SOAPLite) interoperability with CXF
> 
> Well cool we can set up a new french mailing list :-)
> 
> Bravo pour le francais  ...
> 
> Is this something that is generated by the cxf client part 
> (processing the wsdl) or which is returned by the server ?
> Is this really in trunk or can I get an idea looking at 2.0.3 ?
> 
> Then, it definitely makes sense for all languages ? isn't it 
> ? We could imagine that http://host:port/service?java returns 
> java code ( may be it is already the case ;-))
> 
> Cheers
> Guillaume
> 
> 
> On Dec 1, 2007 10:51 AM, Benson Margulies 
> <bi...@basistech.com> wrote:
> > Guillaume,
> >
> > Je ne suis pas sur que je comprend. Mais, peut-etre un 
> reponse utile:
> >
> > In the current trunk of CXF, if you send the server a URL like:
> >
> > http://host:port/service?jsutil
> >
> > and then
> >
> > http://host:port/service?js
> >
> > you will get back in return javascript code that will talk to the 
> > service. The first returns generic JavaScript, and the 
> second specific 
> > code to talk to the particular service. I have tested it 
> for a number 
> > of Doc/Lit services.
> >
> > See rt/javascript in the source tree.
> >
> > I don't know \anything/ about groovy, so I can't address whether 
> > groovy could use it.
> >
> > --benson
> >
> >
> >
> > > -----Original Message-----
> > > From: tog [mailto:guillaume.alleon@gmail.com]
> > > Sent: Friday, November 30, 2007 9:46 PM
> > > To: cxf-user@incubator.apache.org
> > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > >
> > > Benson,
> > >
> > > A naive question: what is doing the javascript generator ?
> > > Would that make sense for groovy ?
> > >
> > > Cheers
> > > Guillaume
> > >
> > > On Dec 1, 2007 8:40 AM, Benson Margulies <bi...@basistech.com> 
> > > wrote:
> > > > Kuro,
> > > >
> > > > You could build a perl generator for CXF like the
> > > Javascript generator
> > > > I've nearly finished.
> > > >
> > > > --benson
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Teruhiko Kurosaka [mailto:Kuro@basistech.com]
> > > > > Sent: Friday, November 30, 2007 7:10 PM
> > > > > To: cxf-user@incubator.apache.org
> > > >
> > > > > Subject: RE: perl (SOAPLite) interoperability with CXF
> > > > >
> > > > > With help from Benson, I now have a working perl client
> > > that talks
> > > > > to the hello_world_RPCLit server:
> > > > > ####################################
> > > > > use SOAP::Lite;
> > > > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > > > $srvc = SOAP::Lite-> uri($nmsp)
> > > > >     ->proxy("http://xpen-kuro:9000/SoapContext/SoapPort")
> > > > >     ->on_action (sub { return '' } ); my $method =
> > > > > SOAP::Data->name('ns1:greetMe')
> > > > >   ->attr({'xmlns:ns1' => $nmsp}); my @params = 
> > > > > (SOAP::Data->name(in=>"Mr. Perl")); print 
> > > > > $srvc->call($method=>@params)->result;
> > > > > ####################################
> > > > >
> > > > > This code also works with hello_world_code_first server
> > > with mionor
> > > > > modifications.
> > > > >
> > > > >
> > > > > This looks too complicated to accomplish a simple task,
> > > and I tried
> > > > > to write a simpler perl client that reads WSDL.
> > > > > This is what I came up with:
> > > > > ####################################
> > > > > use SOAP::Lite;
> > > > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > > > $srvc = SOAP::Lite #-> uri($nmsp)
> > > > >     
> ->service("http://xpen-kuro:9000/SoapContext/SoapPort?wsdl")
> > > > >     ->on_action (sub { return '' } ); print 
> $srvc->greetMe("Ms.
> > > > > Perl"), "\n"; ####################################
> > > > >
> > > > > This one ends up with a fault message from the 
> > > > > hello_world_RPCLit
> > > > > server:
> > > > > <soap:Envelope
> > > > >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > > > >  <soap:Body>
> > > > >   <soap:Fault>
> > > > >    <faultcode>soap:VersionMismatch</faultcode>
> > > > >    <faultstring>
> > > > >     "http://schemas.xmlsoap.org/wsdl/soap/" is not a 
> valid SOAP 
> > > > > version.
> > > > >    </faultstring>
> > > > >   </soap:Fault>
> > > > >  </soap:Body>
> > > > > </soap:Envelope>
> > > > >
> > > > > The quoted URI is used in the request message's soap:Envelope 
> > > > > element as in:
> > > > > <soap:Envelope
> > > > >        xmlns:ns3="http://schemas.xmlsoap.org/soap/http"
> > > > >        xmlns:ns1="http://apache.org/hello_world_rpclit"
> > > > >        xmlns:ns2="http://apache.org/hello_world_rpclit/types"
> > > > >
> > > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > > >        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > > >        ...>
> > > > >
> > > > > Surely, the namespace prefix definition should have been:
> > > > >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> > > > > since it is used to qualify the Envelope and Body elements.
> > > > >
> > > > >
> > > > > I am guessing that SOAP::Lite took the wrong 
> definition from the 
> > > > > WSDL file (samples/hello_world_RCPLit/wsdl/helloWorld.wsdl).
> > > > > It looks SOAP::Lite is mixing up the soap prefex used to
> > > interpret
> > > > > the WSDL file with the prefix it should use to generate
> > > the request
> > > > > message.
> > > > > Can I conclude SOAP::Lite is the guilty party, not CXF?
> > > > >
> > > > > -kuro
> > > > >
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: James Mao [mailto:james.mao@iona.com]
> > > > > > Sent: Thursday, November 29, 2007 8:42 PM
> > > > > > To: cxf-user@incubator.apache.org
> > > > > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > > > > >
> > > > > > Log the outgoing message, and the incoming message, and see
> > > > > if there's
> > > > > > anything different with the cxf client/server
> > > > > >
> > > > > > Regards,
> > > > > > James
> > > > > > > Hi,
> > > > > > > I'm trying to write a perl client that can talk to the
> > > > > server found
> > > > > > > in samples/hello_world_RPCLit of CXF 2.0.1.
> > > > > > >
> > > > > > > The perl code I tried is as simple as this:
> > > > > > >
> > > > > > > use SOAP::Lite;
> > > > > > > print "Connecting to Hello Service...\n"; $srvc = 
> SOAP::Lite
> > > > > > >     -> proxy('http://localhost:9000/SoapContext/SoapPort')
> > > > > > >     -> uri('http://apache.org/hello_world_rpclit');
> > > > > > > print $srvc -> sayHi() -> result, "\n"; print $srvc ->
> > > > > greetMe("Mr.
> > > > > > > Perl") -> result, "\n";
> > > > > > >
> > > > > > >
> > > > > > > sayHi() is executed as expected and returns "Bonjour".
> > > > > > > On the console where the CXF server code is run,
> > > > > > >      [java] Executing operation sayHi is printed.
> > > > > > >
> > > > > > > But greetMe() behaves like a no-op.  Nothing happens.
> > > > > > > Even no error messages.  Nothing is printed on the CXF 
> > > > > > > server console, so Java's String greetMe(String) 
> must have 
> > > > > > > not been executed.
> > > > > > >
> > > > > > > Anybody has any idea?
> > > > > > >
> > > > > > > T. "Kuro" Kurosaka
> > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > > --
> > >
> > > Best Regards
> > > Guillaume
> > > http://cheztog.blogspot.com
> > >
> >
> 
> 
> 
> -- 
> 
> Best Regards
> Guillaume
> http://cheztog.blogspot.com
> 

Re: perl (SOAPLite) interoperability with CXF

Posted by tog <gu...@gmail.com>.
Well cool we can set up a new french mailing list :-)

Bravo pour le francais  ...

Is this something that is generated by the cxf client part (processing
the wsdl) or which is returned by the server ?
Is this really in trunk or can I get an idea looking at 2.0.3 ?

Then, it definitely makes sense for all languages ? isn't it ? We
could imagine that
http://host:port/service?java returns java code ( may be it is already
the case ;-))

Cheers
Guillaume


On Dec 1, 2007 10:51 AM, Benson Margulies <bi...@basistech.com> wrote:
> Guillaume,
>
> Je ne suis pas sur que je comprend. Mais, peut-etre un reponse utile:
>
> In the current trunk of CXF, if you send the server a URL like:
>
> http://host:port/service?jsutil
>
> and then
>
> http://host:port/service?js
>
> you will get back in return javascript code that will talk to the
> service. The first returns generic JavaScript, and the second specific
> code to talk to the particular service. I have tested it for a number of
> Doc/Lit services.
>
> See rt/javascript in the source tree.
>
> I don't know \anything/ about groovy, so I can't address whether groovy
> could use it.
>
> --benson
>
>
>
> > -----Original Message-----
> > From: tog [mailto:guillaume.alleon@gmail.com]
> > Sent: Friday, November 30, 2007 9:46 PM
> > To: cxf-user@incubator.apache.org
> > Subject: Re: perl (SOAPLite) interoperability with CXF
> >
> > Benson,
> >
> > A naive question: what is doing the javascript generator ?
> > Would that make sense for groovy ?
> >
> > Cheers
> > Guillaume
> >
> > On Dec 1, 2007 8:40 AM, Benson Margulies
> > <bi...@basistech.com> wrote:
> > > Kuro,
> > >
> > > You could build a perl generator for CXF like the
> > Javascript generator
> > > I've nearly finished.
> > >
> > > --benson
> > >
> > >
> > > > -----Original Message-----
> > > > From: Teruhiko Kurosaka [mailto:Kuro@basistech.com]
> > > > Sent: Friday, November 30, 2007 7:10 PM
> > > > To: cxf-user@incubator.apache.org
> > >
> > > > Subject: RE: perl (SOAPLite) interoperability with CXF
> > > >
> > > > With help from Benson, I now have a working perl client
> > that talks
> > > > to the hello_world_RPCLit server:
> > > > ####################################
> > > > use SOAP::Lite;
> > > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > > $srvc = SOAP::Lite-> uri($nmsp)
> > > >     ->proxy("http://xpen-kuro:9000/SoapContext/SoapPort")
> > > >     ->on_action (sub { return '' } ); my $method =
> > > > SOAP::Data->name('ns1:greetMe')
> > > >   ->attr({'xmlns:ns1' => $nmsp});
> > > > my @params = (SOAP::Data->name(in=>"Mr. Perl")); print
> > > > $srvc->call($method=>@params)->result;
> > > > ####################################
> > > >
> > > > This code also works with hello_world_code_first server
> > with mionor
> > > > modifications.
> > > >
> > > >
> > > > This looks too complicated to accomplish a simple task,
> > and I tried
> > > > to write a simpler perl client that reads WSDL.
> > > > This is what I came up with:
> > > > ####################################
> > > > use SOAP::Lite;
> > > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > > $srvc = SOAP::Lite #-> uri($nmsp)
> > > >     ->service("http://xpen-kuro:9000/SoapContext/SoapPort?wsdl")
> > > >     ->on_action (sub { return '' } ); print $srvc->greetMe("Ms.
> > > > Perl"), "\n"; ####################################
> > > >
> > > > This one ends up with a fault message from the hello_world_RPCLit
> > > > server:
> > > > <soap:Envelope
> > > >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > > >  <soap:Body>
> > > >   <soap:Fault>
> > > >    <faultcode>soap:VersionMismatch</faultcode>
> > > >    <faultstring>
> > > >     "http://schemas.xmlsoap.org/wsdl/soap/" is not a valid SOAP
> > > > version.
> > > >    </faultstring>
> > > >   </soap:Fault>
> > > >  </soap:Body>
> > > > </soap:Envelope>
> > > >
> > > > The quoted URI is used in the request message's soap:Envelope
> > > > element as in:
> > > > <soap:Envelope
> > > >        xmlns:ns3="http://schemas.xmlsoap.org/soap/http"
> > > >        xmlns:ns1="http://apache.org/hello_world_rpclit"
> > > >        xmlns:ns2="http://apache.org/hello_world_rpclit/types"
> > > >
> > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > > >        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > >        ...>
> > > >
> > > > Surely, the namespace prefix definition should have been:
> > > >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> > > > since it is used to qualify the Envelope and Body elements.
> > > >
> > > >
> > > > I am guessing that SOAP::Lite took the wrong definition from the
> > > > WSDL file (samples/hello_world_RCPLit/wsdl/helloWorld.wsdl).
> > > > It looks SOAP::Lite is mixing up the soap prefex used to
> > interpret
> > > > the WSDL file with the prefix it should use to generate
> > the request
> > > > message.
> > > > Can I conclude SOAP::Lite is the guilty party, not CXF?
> > > >
> > > > -kuro
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: James Mao [mailto:james.mao@iona.com]
> > > > > Sent: Thursday, November 29, 2007 8:42 PM
> > > > > To: cxf-user@incubator.apache.org
> > > > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > > > >
> > > > > Log the outgoing message, and the incoming message, and see
> > > > if there's
> > > > > anything different with the cxf client/server
> > > > >
> > > > > Regards,
> > > > > James
> > > > > > Hi,
> > > > > > I'm trying to write a perl client that can talk to the
> > > > server found
> > > > > > in samples/hello_world_RPCLit of CXF 2.0.1.
> > > > > >
> > > > > > The perl code I tried is as simple as this:
> > > > > >
> > > > > > use SOAP::Lite;
> > > > > > print "Connecting to Hello Service...\n"; $srvc = SOAP::Lite
> > > > > >     -> proxy('http://localhost:9000/SoapContext/SoapPort')
> > > > > >     -> uri('http://apache.org/hello_world_rpclit');
> > > > > > print $srvc -> sayHi() -> result, "\n"; print $srvc ->
> > > > greetMe("Mr.
> > > > > > Perl") -> result, "\n";
> > > > > >
> > > > > >
> > > > > > sayHi() is executed as expected and returns "Bonjour".
> > > > > > On the console where the CXF server code is run,
> > > > > >      [java] Executing operation sayHi is printed.
> > > > > >
> > > > > > But greetMe() behaves like a no-op.  Nothing happens.
> > > > > > Even no error messages.  Nothing is printed on the CXF server
> > > > > > console, so Java's String greetMe(String) must have not been
> > > > > > executed.
> > > > > >
> > > > > > Anybody has any idea?
> > > > > >
> > > > > > T. "Kuro" Kurosaka
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> >
> > --
> >
> > Best Regards
> > Guillaume
> > http://cheztog.blogspot.com
> >
>



-- 

Best Regards
Guillaume
http://cheztog.blogspot.com

RE: perl (SOAPLite) interoperability with CXF

Posted by Benson Margulies <bi...@basistech.com>.
Guillaume,

Je ne suis pas sur que je comprend. Mais, peut-etre un reponse utile:

In the current trunk of CXF, if you send the server a URL like:

http://host:port/service?jsutil

and then

http://host:port/service?js

you will get back in return javascript code that will talk to the
service. The first returns generic JavaScript, and the second specific
code to talk to the particular service. I have tested it for a number of
Doc/Lit services.

See rt/javascript in the source tree.

I don't know \anything/ about groovy, so I can't address whether groovy
could use it.

--benson


> -----Original Message-----
> From: tog [mailto:guillaume.alleon@gmail.com] 
> Sent: Friday, November 30, 2007 9:46 PM
> To: cxf-user@incubator.apache.org
> Subject: Re: perl (SOAPLite) interoperability with CXF
> 
> Benson,
> 
> A naive question: what is doing the javascript generator ? 
> Would that make sense for groovy ?
> 
> Cheers
> Guillaume
> 
> On Dec 1, 2007 8:40 AM, Benson Margulies 
> <bi...@basistech.com> wrote:
> > Kuro,
> >
> > You could build a perl generator for CXF like the 
> Javascript generator 
> > I've nearly finished.
> >
> > --benson
> >
> >
> > > -----Original Message-----
> > > From: Teruhiko Kurosaka [mailto:Kuro@basistech.com]
> > > Sent: Friday, November 30, 2007 7:10 PM
> > > To: cxf-user@incubator.apache.org
> >
> > > Subject: RE: perl (SOAPLite) interoperability with CXF
> > >
> > > With help from Benson, I now have a working perl client 
> that talks 
> > > to the hello_world_RPCLit server:
> > > ####################################
> > > use SOAP::Lite;
> > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > $srvc = SOAP::Lite-> uri($nmsp)
> > >     ->proxy("http://xpen-kuro:9000/SoapContext/SoapPort")
> > >     ->on_action (sub { return '' } ); my $method = 
> > > SOAP::Data->name('ns1:greetMe')
> > >   ->attr({'xmlns:ns1' => $nmsp});
> > > my @params = (SOAP::Data->name(in=>"Mr. Perl")); print 
> > > $srvc->call($method=>@params)->result;
> > > ####################################
> > >
> > > This code also works with hello_world_code_first server 
> with mionor 
> > > modifications.
> > >
> > >
> > > This looks too complicated to accomplish a simple task, 
> and I tried 
> > > to write a simpler perl client that reads WSDL.
> > > This is what I came up with:
> > > ####################################
> > > use SOAP::Lite;
> > > $nmsp = 'http://apache.org/hello_world_rpclit';
> > > $srvc = SOAP::Lite #-> uri($nmsp)
> > >     ->service("http://xpen-kuro:9000/SoapContext/SoapPort?wsdl")
> > >     ->on_action (sub { return '' } ); print $srvc->greetMe("Ms. 
> > > Perl"), "\n"; ####################################
> > >
> > > This one ends up with a fault message from the hello_world_RPCLit
> > > server:
> > > <soap:Envelope
> > >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> > >  <soap:Body>
> > >   <soap:Fault>
> > >    <faultcode>soap:VersionMismatch</faultcode>
> > >    <faultstring>
> > >     "http://schemas.xmlsoap.org/wsdl/soap/" is not a valid SOAP 
> > > version.
> > >    </faultstring>
> > >   </soap:Fault>
> > >  </soap:Body>
> > > </soap:Envelope>
> > >
> > > The quoted URI is used in the request message's soap:Envelope 
> > > element as in:
> > > <soap:Envelope
> > >        xmlns:ns3="http://schemas.xmlsoap.org/soap/http"
> > >        xmlns:ns1="http://apache.org/hello_world_rpclit"
> > >        xmlns:ns2="http://apache.org/hello_world_rpclit/types"
> > >        
> soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> > >        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > >        ...>
> > >
> > > Surely, the namespace prefix definition should have been:
> > >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> > > since it is used to qualify the Envelope and Body elements.
> > >
> > >
> > > I am guessing that SOAP::Lite took the wrong definition from the 
> > > WSDL file (samples/hello_world_RCPLit/wsdl/helloWorld.wsdl).
> > > It looks SOAP::Lite is mixing up the soap prefex used to 
> interpret 
> > > the WSDL file with the prefix it should use to generate 
> the request 
> > > message.
> > > Can I conclude SOAP::Lite is the guilty party, not CXF?
> > >
> > > -kuro
> > >
> > >
> > > > -----Original Message-----
> > > > From: James Mao [mailto:james.mao@iona.com]
> > > > Sent: Thursday, November 29, 2007 8:42 PM
> > > > To: cxf-user@incubator.apache.org
> > > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > > >
> > > > Log the outgoing message, and the incoming message, and see
> > > if there's
> > > > anything different with the cxf client/server
> > > >
> > > > Regards,
> > > > James
> > > > > Hi,
> > > > > I'm trying to write a perl client that can talk to the
> > > server found
> > > > > in samples/hello_world_RPCLit of CXF 2.0.1.
> > > > >
> > > > > The perl code I tried is as simple as this:
> > > > >
> > > > > use SOAP::Lite;
> > > > > print "Connecting to Hello Service...\n"; $srvc = SOAP::Lite
> > > > >     -> proxy('http://localhost:9000/SoapContext/SoapPort')
> > > > >     -> uri('http://apache.org/hello_world_rpclit');
> > > > > print $srvc -> sayHi() -> result, "\n"; print $srvc ->
> > > greetMe("Mr.
> > > > > Perl") -> result, "\n";
> > > > >
> > > > >
> > > > > sayHi() is executed as expected and returns "Bonjour".
> > > > > On the console where the CXF server code is run,
> > > > >      [java] Executing operation sayHi is printed.
> > > > >
> > > > > But greetMe() behaves like a no-op.  Nothing happens.
> > > > > Even no error messages.  Nothing is printed on the CXF server 
> > > > > console, so Java's String greetMe(String) must have not been 
> > > > > executed.
> > > > >
> > > > > Anybody has any idea?
> > > > >
> > > > > T. "Kuro" Kurosaka
> > > > >
> > > > >
> > > >
> > >
> >
> 
> 
> 
> -- 
> 
> Best Regards
> Guillaume
> http://cheztog.blogspot.com
> 

Re: perl (SOAPLite) interoperability with CXF

Posted by tog <gu...@gmail.com>.
Benson,

A naive question: what is doing the javascript generator ? Would that
make sense for groovy ?

Cheers
Guillaume

On Dec 1, 2007 8:40 AM, Benson Margulies <bi...@basistech.com> wrote:
> Kuro,
>
> You could build a perl generator for CXF like the Javascript generator
> I've nearly finished.
>
> --benson
>
>
> > -----Original Message-----
> > From: Teruhiko Kurosaka [mailto:Kuro@basistech.com]
> > Sent: Friday, November 30, 2007 7:10 PM
> > To: cxf-user@incubator.apache.org
>
> > Subject: RE: perl (SOAPLite) interoperability with CXF
> >
> > With help from Benson, I now have a working perl client that
> > talks to the hello_world_RPCLit server:
> > ####################################
> > use SOAP::Lite;
> > $nmsp = 'http://apache.org/hello_world_rpclit';
> > $srvc = SOAP::Lite-> uri($nmsp)
> >     ->proxy("http://xpen-kuro:9000/SoapContext/SoapPort")
> >     ->on_action (sub { return '' } );
> > my $method = SOAP::Data->name('ns1:greetMe')
> >   ->attr({'xmlns:ns1' => $nmsp});
> > my @params = (SOAP::Data->name(in=>"Mr. Perl")); print
> > $srvc->call($method=>@params)->result;
> > ####################################
> >
> > This code also works with hello_world_code_first server with
> > mionor modifications.
> >
> >
> > This looks too complicated to accomplish a simple task, and I
> > tried to write a simpler perl client that reads WSDL.
> > This is what I came up with:
> > ####################################
> > use SOAP::Lite;
> > $nmsp = 'http://apache.org/hello_world_rpclit';
> > $srvc = SOAP::Lite #-> uri($nmsp)
> >     ->service("http://xpen-kuro:9000/SoapContext/SoapPort?wsdl")
> >     ->on_action (sub { return '' } );
> > print $srvc->greetMe("Ms. Perl"), "\n";
> > ####################################
> >
> > This one ends up with a fault message from the hello_world_RPCLit
> > server:
> > <soap:Envelope
> >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> >  <soap:Body>
> >   <soap:Fault>
> >    <faultcode>soap:VersionMismatch</faultcode>
> >    <faultstring>
> >     "http://schemas.xmlsoap.org/wsdl/soap/" is not a valid
> > SOAP version.
> >    </faultstring>
> >   </soap:Fault>
> >  </soap:Body>
> > </soap:Envelope>
> >
> > The quoted URI is used in the request message's soap:Envelope
> > element as in:
> > <soap:Envelope
> >        xmlns:ns3="http://schemas.xmlsoap.org/soap/http"
> >        xmlns:ns1="http://apache.org/hello_world_rpclit"
> >        xmlns:ns2="http://apache.org/hello_world_rpclit/types"
> >        soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> >        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> >        ...>
> >
> > Surely, the namespace prefix definition should have been:
> >       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> > since it is used to qualify the Envelope and Body elements.
> >
> >
> > I am guessing that SOAP::Lite took the wrong definition from
> > the WSDL file (samples/hello_world_RCPLit/wsdl/helloWorld.wsdl).
> > It looks SOAP::Lite is mixing up the soap prefex used to
> > interpret the WSDL file with the prefix it should use to
> > generate the request message.
> > Can I conclude SOAP::Lite is the guilty party, not CXF?
> >
> > -kuro
> >
> >
> > > -----Original Message-----
> > > From: James Mao [mailto:james.mao@iona.com]
> > > Sent: Thursday, November 29, 2007 8:42 PM
> > > To: cxf-user@incubator.apache.org
> > > Subject: Re: perl (SOAPLite) interoperability with CXF
> > >
> > > Log the outgoing message, and the incoming message, and see
> > if there's
> > > anything different with the cxf client/server
> > >
> > > Regards,
> > > James
> > > > Hi,
> > > > I'm trying to write a perl client that can talk to the
> > server found
> > > > in samples/hello_world_RPCLit of CXF 2.0.1.
> > > >
> > > > The perl code I tried is as simple as this:
> > > >
> > > > use SOAP::Lite;
> > > > print "Connecting to Hello Service...\n"; $srvc = SOAP::Lite
> > > >     -> proxy('http://localhost:9000/SoapContext/SoapPort')
> > > >     -> uri('http://apache.org/hello_world_rpclit');
> > > > print $srvc -> sayHi() -> result, "\n"; print $srvc ->
> > greetMe("Mr.
> > > > Perl") -> result, "\n";
> > > >
> > > >
> > > > sayHi() is executed as expected and returns "Bonjour".
> > > > On the console where the CXF server code is run,
> > > >      [java] Executing operation sayHi is printed.
> > > >
> > > > But greetMe() behaves like a no-op.  Nothing happens.
> > > > Even no error messages.  Nothing is printed on the CXF server
> > > > console, so Java's String greetMe(String) must have not been
> > > > executed.
> > > >
> > > > Anybody has any idea?
> > > >
> > > > T. "Kuro" Kurosaka
> > > >
> > > >
> > >
> >
>



-- 

Best Regards
Guillaume
http://cheztog.blogspot.com

RE: perl (SOAPLite) interoperability with CXF

Posted by Benson Margulies <bi...@basistech.com>.
Kuro,

You could build a perl generator for CXF like the Javascript generator
I've nearly finished.

--benson
 

> -----Original Message-----
> From: Teruhiko Kurosaka [mailto:Kuro@basistech.com] 
> Sent: Friday, November 30, 2007 7:10 PM
> To: cxf-user@incubator.apache.org
> Subject: RE: perl (SOAPLite) interoperability with CXF
> 
> With help from Benson, I now have a working perl client that 
> talks to the hello_world_RPCLit server:
> ####################################
> use SOAP::Lite;
> $nmsp = 'http://apache.org/hello_world_rpclit';
> $srvc = SOAP::Lite-> uri($nmsp)
>     ->proxy("http://xpen-kuro:9000/SoapContext/SoapPort")
>     ->on_action (sub { return '' } );
> my $method = SOAP::Data->name('ns1:greetMe')
>   ->attr({'xmlns:ns1' => $nmsp});
> my @params = (SOAP::Data->name(in=>"Mr. Perl")); print 
> $srvc->call($method=>@params)->result;
> ####################################
> 
> This code also works with hello_world_code_first server with 
> mionor modifications.
> 
> 
> This looks too complicated to accomplish a simple task, and I 
> tried to write a simpler perl client that reads WSDL.  
> This is what I came up with:
> ####################################
> use SOAP::Lite;
> $nmsp = 'http://apache.org/hello_world_rpclit';
> $srvc = SOAP::Lite #-> uri($nmsp)
>     ->service("http://xpen-kuro:9000/SoapContext/SoapPort?wsdl")
>     ->on_action (sub { return '' } );
> print $srvc->greetMe("Ms. Perl"), "\n";
> ####################################
> 
> This one ends up with a fault message from the hello_world_RPCLit
> server:
> <soap:Envelope 
> 	xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>  <soap:Body>
>   <soap:Fault>
>    <faultcode>soap:VersionMismatch</faultcode>
>    <faultstring>
>     "http://schemas.xmlsoap.org/wsdl/soap/" is not a valid 
> SOAP version.
>    </faultstring>
>   </soap:Fault>
>  </soap:Body>
> </soap:Envelope>
> 
> The quoted URI is used in the request message's soap:Envelope 
> element as in:
> <soap:Envelope 
>        xmlns:ns3="http://schemas.xmlsoap.org/soap/http" 
>        xmlns:ns1="http://apache.org/hello_world_rpclit" 
>        xmlns:ns2="http://apache.org/hello_world_rpclit/types" 
>        soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
>        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>        ...>
> 
> Surely, the namespace prefix definition should have been:
> 	xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> since it is used to qualify the Envelope and Body elements.
> 
> 
> I am guessing that SOAP::Lite took the wrong definition from 
> the WSDL file (samples/hello_world_RCPLit/wsdl/helloWorld.wsdl).
> It looks SOAP::Lite is mixing up the soap prefex used to 
> interpret the WSDL file with the prefix it should use to 
> generate the request message.
> Can I conclude SOAP::Lite is the guilty party, not CXF?
> 
> -kuro
>  
> 
> > -----Original Message-----
> > From: James Mao [mailto:james.mao@iona.com]
> > Sent: Thursday, November 29, 2007 8:42 PM
> > To: cxf-user@incubator.apache.org
> > Subject: Re: perl (SOAPLite) interoperability with CXF
> > 
> > Log the outgoing message, and the incoming message, and see 
> if there's 
> > anything different with the cxf client/server
> > 
> > Regards,
> > James
> > > Hi,
> > > I'm trying to write a perl client that can talk to the 
> server found 
> > > in samples/hello_world_RPCLit of CXF 2.0.1.
> > >
> > > The perl code I tried is as simple as this:
> > >
> > > use SOAP::Lite;
> > > print "Connecting to Hello Service...\n"; $srvc = SOAP::Lite
> > >     -> proxy('http://localhost:9000/SoapContext/SoapPort')
> > >     -> uri('http://apache.org/hello_world_rpclit');
> > > print $srvc -> sayHi() -> result, "\n"; print $srvc -> 
> greetMe("Mr. 
> > > Perl") -> result, "\n";
> > >
> > >
> > > sayHi() is executed as expected and returns "Bonjour".
> > > On the console where the CXF server code is run,
> > >      [java] Executing operation sayHi is printed.
> > >
> > > But greetMe() behaves like a no-op.  Nothing happens.
> > > Even no error messages.  Nothing is printed on the CXF server 
> > > console, so Java's String greetMe(String) must have not been 
> > > executed.
> > >
> > > Anybody has any idea?
> > >
> > > T. "Kuro" Kurosaka
> > >
> > >   
> > 
> 

RE: perl (SOAPLite) interoperability with CXF

Posted by Teruhiko Kurosaka <Ku...@basistech.com>.
With help from Benson, I now have a working perl client that
talks to the hello_world_RPCLit server:
####################################
use SOAP::Lite;
$nmsp = 'http://apache.org/hello_world_rpclit';
$srvc = SOAP::Lite-> uri($nmsp)
    ->proxy("http://xpen-kuro:9000/SoapContext/SoapPort")
    ->on_action (sub { return '' } );
my $method = SOAP::Data->name('ns1:greetMe')
  ->attr({'xmlns:ns1' => $nmsp});
my @params = (SOAP::Data->name(in=>"Mr. Perl"));
print $srvc->call($method=>@params)->result;
####################################

This code also works with hello_world_code_first server
with mionor modifications.


This looks too complicated to accomplish a simple
task, and I tried to write a simpler perl client that reads WSDL.  
This is what I came up with:
####################################
use SOAP::Lite;
$nmsp = 'http://apache.org/hello_world_rpclit';
$srvc = SOAP::Lite #-> uri($nmsp)
    ->service("http://xpen-kuro:9000/SoapContext/SoapPort?wsdl")
    ->on_action (sub { return '' } );
print $srvc->greetMe("Ms. Perl"), "\n";
####################################

This one ends up with a fault message from the hello_world_RPCLit
server:
<soap:Envelope 
	xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
  <soap:Fault>
   <faultcode>soap:VersionMismatch</faultcode>
   <faultstring>
    "http://schemas.xmlsoap.org/wsdl/soap/" is not a valid SOAP version.
   </faultstring>
  </soap:Fault>
 </soap:Body>
</soap:Envelope>

The quoted URI is used in the request message's soap:Envelope
element as in:
<soap:Envelope 
       xmlns:ns3="http://schemas.xmlsoap.org/soap/http" 
       xmlns:ns1="http://apache.org/hello_world_rpclit" 
       xmlns:ns2="http://apache.org/hello_world_rpclit/types" 
       soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
       ...>

Surely, the namespace prefix definition should have been:
	xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
since it is used to qualify the Envelope and Body elements.


I am guessing that SOAP::Lite took the wrong definition 
from the WSDL file (samples/hello_world_RCPLit/wsdl/helloWorld.wsdl).
It looks SOAP::Lite is mixing up the soap prefex used to interpret the 
WSDL file with the prefix it should use to generate the request message.
Can I conclude SOAP::Lite is the guilty party, not CXF?

-kuro
 

> -----Original Message-----
> From: James Mao [mailto:james.mao@iona.com] 
> Sent: Thursday, November 29, 2007 8:42 PM
> To: cxf-user@incubator.apache.org
> Subject: Re: perl (SOAPLite) interoperability with CXF
> 
> Log the outgoing message, and the incoming message, and see 
> if there's 
> anything different with the cxf client/server
> 
> Regards,
> James
> > Hi,
> > I'm trying to write a perl client that can talk to the server
> > found in samples/hello_world_RPCLit of CXF 2.0.1.
> >
> > The perl code I tried is as simple as this:
> >
> > use SOAP::Lite;
> > print "Connecting to Hello Service...\n";
> > $srvc = SOAP::Lite
> >     -> proxy('http://localhost:9000/SoapContext/SoapPort')
> >     -> uri('http://apache.org/hello_world_rpclit');
> > print $srvc -> sayHi() -> result, "\n";
> > print $srvc -> greetMe("Mr. Perl") -> result, "\n";
> >
> >
> > sayHi() is executed as expected and returns "Bonjour".
> > On the console where the CXF server code is run,
> >      [java] Executing operation sayHi
> > is printed.
> >
> > But greetMe() behaves like a no-op.  Nothing happens.
> > Even no error messages.  Nothing is printed on the CXF server
> > console, so Java's String greetMe(String) must have not 
> > been executed.
> >
> > Anybody has any idea?
> >
> > T. "Kuro" Kurosaka
> >
> >   
> 

Re: perl (SOAPLite) interoperability with CXF

Posted by James Mao <ja...@iona.com>.
Log the outgoing message, and the incoming message, and see if there's 
anything different with the cxf client/server

Regards,
James
> Hi,
> I'm trying to write a perl client that can talk to the server
> found in samples/hello_world_RPCLit of CXF 2.0.1.
>
> The perl code I tried is as simple as this:
>
> use SOAP::Lite;
> print "Connecting to Hello Service...\n";
> $srvc = SOAP::Lite
>     -> proxy('http://localhost:9000/SoapContext/SoapPort')
>     -> uri('http://apache.org/hello_world_rpclit');
> print $srvc -> sayHi() -> result, "\n";
> print $srvc -> greetMe("Mr. Perl") -> result, "\n";
>
>
> sayHi() is executed as expected and returns "Bonjour".
> On the console where the CXF server code is run,
>      [java] Executing operation sayHi
> is printed.
>
> But greetMe() behaves like a no-op.  Nothing happens.
> Even no error messages.  Nothing is printed on the CXF server
> console, so Java's String greetMe(String) must have not 
> been executed.
>
> Anybody has any idea?
>
> T. "Kuro" Kurosaka
>
>   

RE: perl (SOAPLite) interoperability with CXF

Posted by Benson Margulies <bi...@basistech.com>.
Kuro,

I suggest avoiding RPC. Can the perl thing deal with Doc/literal/bare?

--benson 

> -----Original Message-----
> From: Teruhiko Kurosaka [mailto:Kuro@basistech.com] 
> Sent: Wednesday, November 28, 2007 6:03 PM
> To: cxf-user@incubator.apache.org
> Subject: perl (SOAPLite) interoperability with CXF
> 
> Hi,
> I'm trying to write a perl client that can talk to the server 
> found in samples/hello_world_RPCLit of CXF 2.0.1.
> 
> The perl code I tried is as simple as this:
> 
> use SOAP::Lite;
> print "Connecting to Hello Service...\n"; $srvc = SOAP::Lite
>     -> proxy('http://localhost:9000/SoapContext/SoapPort')
>     -> uri('http://apache.org/hello_world_rpclit');
> print $srvc -> sayHi() -> result, "\n";
> print $srvc -> greetMe("Mr. Perl") -> result, "\n";
> 
> 
> sayHi() is executed as expected and returns "Bonjour".
> On the console where the CXF server code is run,
>      [java] Executing operation sayHi
> is printed.
> 
> But greetMe() behaves like a no-op.  Nothing happens.
> Even no error messages.  Nothing is printed on the CXF server 
> console, so Java's String greetMe(String) must have not been executed.
> 
> Anybody has any idea?
> 
> T. "Kuro" Kurosaka
>