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 Reza Shafii <re...@hotmail.com> on 2008/02/02 04:36:13 UTC
Deploying a dynamic service using AxisServlet
Hi All,
I am trying to dynamically add a new services to the AxisEngine underlying an AxisSrvlet which I have deployed on an embedded Jetty server. The code
is as follows:
// Create a new service
SOAPService axisService = new SOAPService();
JavaServiceDesc serviceDesc = new JavaServiceDesc();
serviceDesc.setEndpointURL(servUrl);
serviceDesc.setName(servName);
serviceDesc.loadServiceDescByIntrospection(test.implementations.SampleServi=
ce.class);
axisService.setServiceDescription(serviceDesc);
// Dynamically deploy the service on a SimpleProvider engine
axisEngineConfiguration = new SimpleProvider();
axisEngineConfiguration.deployService(servName, axisService);
// Deploy an AxisServlet on Jetty
jettyServer = new Server(SERVER_PORT);
Context root = new Context(jettyServer, SERVER_ROOT, Context.SESSIONS);
AxisServlet axisServlet = new AxisServlet();
root.addServlet(new ServletHolder(axisServlet);, URL_PATTERN);
jettyServer.start();
// Configure the servlet's engine with the SimplePrivider configuration whe=
re the service is deployed
AxisServer tmpAxisServer = new AxisServer(axisEngineConfiguration);
axisServlet.getEngine().getConfig().configureEngine(tmpAxisServer);
However I get the following exception at the last line:
at sun.misc.MetaIndex.mayContain(Unknown Source)
at sun.misc.URLClassPath$JarLoader.getResource(Unknown Source)
at sun.misc.URLClassPath.getResource(Unknown Source)
at sun.misc.URLClassPath.getResource(Unknown Source)
at java.lang.ClassLoader.getBootstrapResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResourceAsStream(Unknown Source)
at org.apache.axis.utils.ClassUtils.getResourceAsStream(ClassUtils.java=
:227)
at org.apache.axis.configuration.FileProvider.configureEngine(FileProvi=
der.java:170)
at sample.tests.TestOne.registerBindingUrisForServices()
Any help would be much appreciated.
Regards,
_________________________________________________________________
Re: HTTP POST
Posted by Demetris G <de...@ece.neu.edu>.
I see. Well this is good info and I appreciate the response Anne.
Regards
Anne Thomas Manes wrote:
> Axis generates rpc/encoded by default with HTTP POST. It does not
> support HTTP GET.
> Axis2 generates multiple bindings by default:
> - SOAP 1.1 doc/literal using HTTP POST
> - SOAP 1.2 doc/literal using HTTP POST
> - "REST" with URL Encoding using HTTP GET if the method signature fits
> the HTTP GET conventions (e.g., no complex types for input parameters)
>
> (I put REST in quotes because there's no guarantee that these GET
> operations are "safe", and Axis2 really doesn't do anything to exploit
> "hypermedia as the engine of state". A better term really is POX.)
>
> Anne
>
> On Feb 2, 2008 12:10 AM, Demetris G <de...@ece.neu.edu> wrote:
>
>> Hi all,
>>
>> is the default transport for Axis stubs (1.x and 2) RCP/Encoded over
>> HTTP POST
>> or GET?
>>
>> Thanks
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: HTTP POST
Posted by Anne Thomas Manes <at...@gmail.com>.
Axis generates rpc/encoded by default with HTTP POST. It does not
support HTTP GET.
Axis2 generates multiple bindings by default:
- SOAP 1.1 doc/literal using HTTP POST
- SOAP 1.2 doc/literal using HTTP POST
- "REST" with URL Encoding using HTTP GET if the method signature fits
the HTTP GET conventions (e.g., no complex types for input parameters)
(I put REST in quotes because there's no guarantee that these GET
operations are "safe", and Axis2 really doesn't do anything to exploit
"hypermedia as the engine of state". A better term really is POX.)
Anne
On Feb 2, 2008 12:10 AM, Demetris G <de...@ece.neu.edu> wrote:
>
> Hi all,
>
> is the default transport for Axis stubs (1.x and 2) RCP/Encoded over
> HTTP POST
> or GET?
>
> Thanks
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
HTTP POST
Posted by Demetris G <de...@ece.neu.edu>.
Hi all,
is the default transport for Axis stubs (1.x and 2) RCP/Encoded over
HTTP POST
or GET?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: Deploying a dynamic service using AxisServlet
Posted by Reza Shafii <re...@hotmail.com>.
Btw, the exception is an NPE.
Reza
From: rezaloo@hotmail.com
To: axis-user@ws.apache.org
Subject: Deploying a dynamic service using AxisServlet
Date: Fri, 1 Feb 2008 22:36:13 -0500
Hi All,
I am trying to dynamically add a new services to the AxisEngine underlying an AxisSrvlet which I have deployed on an embedded Jetty server. The code
is as follows:
// Create a new service
SOAPService axisService = new SOAPService();
JavaServiceDesc serviceDesc = new JavaServiceDesc();
serviceDesc.setEndpointURL(servUrl);
serviceDesc.setName(servName);
serviceDesc.loadServiceDescByIntrospection(test.implementations.SampleServi=
ce.class);
axisService.setServiceDescription(serviceDesc);
// Dynamically deploy the service on a SimpleProvider engine
axisEngineConfiguration = new SimpleProvider();
axisEngineConfiguration.deployService(servName, axisService);
// Deploy an AxisServlet on Jetty
jettyServer = new Server(SERVER_PORT);
Context root = new Context(jettyServer, SERVER_ROOT, Context.SESSIONS);
AxisServlet axisServlet = new AxisServlet();
root.addServlet(new ServletHolder(axisServlet);, URL_PATTERN);
jettyServer.start();
// Configure the servlet's engine with the SimplePrivider configuration whe=
re the service is deployed
AxisServer tmpAxisServer = new AxisServer(axisEngineConfiguration);
axisServlet.getEngine().getConfig().configureEngine(tmpAxisServer);
However I get the following exception at the last line:
at sun.misc.MetaIndex.mayContain(Unknown Source)
at sun.misc.URLClassPath$JarLoader.getResource(Unknown Source)
at sun.misc.URLClassPath.getResource(Unknown Source)
at sun.misc.URLClassPath.getResource(Unknown Source)
at java.lang.ClassLoader.getBootstrapResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResource(Unknown Source)
at java.lang.ClassLoader.getResourceAsStream(Unknown Source)
at org.apache.axis.utils.ClassUtils.getResourceAsStream(ClassUtils.java=
:227)
at org.apache.axis.configuration.FileProvider.configureEngine(FileProvi=
der.java:170)
at sample.tests.TestOne.registerBindingUrisForServices()
Any help would be much appreciated.
Regards,
_________________________________________________________________