cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benson Margulies" <bim2...@basistech.com>
Subject RE: perl (SOAPLite) interoperability with CXF
Date Sat, 01 Dec 2007 03:21:43 GMT
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 
> <bim2007@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 <bim2007@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
> 

Mime
View raw message