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 "Yadav, Yogendra (IT)" <Yo...@morganstanley.com> on 2007/08/08 18:59:13 UTC

Does Endpoint API work in 1.3 RC2 release ?

Hi,
I tried the sample jaxws-calculator sample from axis2-1.3 RC2 dist as
AAR and it works. Then tried using Endpoint API, I am having problems.
 
I wrote a main class like this:
import javax.xml.ws.Endpoint;
import org.apache.axis2.jaxws.calculator.CalculatorService;
public class StandaloneServiceStartupUsingEndpointPublish
{
  public static void main( String[] args )
  {
    System.out.println("Starting Server...");
    Endpoint ep = Endpoint.create( new CalculatorService() );
    ep.publish( "http://localhost:9090/CalculatorService" );
  }
}

Problems:
1. Even though I have specified port 9090, the transport is started on
8080.
2. Trying to get wsdl using http://localhost:9090/CalculatorService?wsdl
in browser results this error:
<Exception>
org.apache.axis2.AxisFault: The service cannot be found for the endpoint
reference (EPR) /services/
 at
org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.
java:63)
 at org.apache.axis2.engine.Phase.invoke(Phase.java:308)
 at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
 at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
 at
org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.
java:125)
 at
org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil
.java:119)
 at
org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:229)
 at
org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHtt
pService.java:256)
 at
org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(Axi
sHttpService.java:163)
 at
org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServ
iceProcessor.java:85)
 at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker
.runTask(ThreadPoolExecutor.java:665)
 at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker
.run(ThreadPoolExecutor.java:690)
 at java.lang.Thread.run(Thread.java:595)
</Exception>
 
PS: This works in jaxws-ri.
 
Please help.
thanx
-yogen
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

RE: Does Endpoint API work in 1.3 RC2 release ?

Posted by "Yadav, Yogendra (IT)" <Yo...@morganstanley.com>.
Hello Anyone,
Has someone tried publishing the service using JAXWS Endpoint API in
Axis2 1.3 RC2 ?
 
I think the problem is bcoz of this code in EndpointImpl class:
 
    public void publish(String s) {
        ConfigurationContext ctx =
endpointDesc.getServiceDescription().getAxisConfigContext();
 
        try {
            // For some reason the AxisService has not been added to the
ConfigurationContext
            // at this point, so we need to do it for the service to be
available.
            AxisService svc = endpointDesc.getAxisService();
            ctx.getAxisConfiguration().addService(svc);
        } catch (AxisFault e) {
            throw ExceptionFactory.makeWebServiceException(e);
        }        
 
        // Remove the default "axis2" context root.
        ctx.setContextRoot("/");
                    
        WorkerFactory wf = new HTTPWorkerFactory();
 
        try {
            server = new SimpleHttpServer(ctx, wf, 8080);  //TODO: Add a
configurable port
            server.init();            
            server.start();
        } catch (IOException e) {
            throw ExceptionFactory.makeWebServiceException(e);
        }
 
        published = true;      
    }
 
-yogen
 

________________________________

From: Yadav, Yogendra (IT) 
Sent: Wednesday, August 08, 2007 12:59 PM
To: axis-user
Subject: Does Endpoint API work in 1.3 RC2 release ?


Hi,
I tried the sample jaxws-calculator sample from axis2-1.3 RC2 dist as
AAR and it works. Then tried using Endpoint API, I am having problems.
 
I wrote a main class like this:
import javax.xml.ws.Endpoint;
import org.apache.axis2.jaxws.calculator.CalculatorService;
public class StandaloneServiceStartupUsingEndpointPublish
{
  public static void main( String[] args )
  {
    System.out.println("Starting Server...");
    Endpoint ep = Endpoint.create( new CalculatorService() );
    ep.publish( "http://localhost:9090/CalculatorService" );
  }
}

Problems:
1. Even though I have specified port 9090, the transport is started on
8080.
2. Trying to get wsdl using http://localhost:9090/CalculatorService?wsdl
in browser results this error:
<Exception>
org.apache.axis2.AxisFault: The service cannot be found for the endpoint
reference (EPR) /services/
 at
org.apache.axis2.engine.DispatchPhase.checkPostConditions(DispatchPhase.
java:63)
 at org.apache.axis2.engine.Phase.invoke(Phase.java:308)
 at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:212)
 at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:132)
 at
org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.
java:125)
 at
org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil
.java:119)
 at
org.apache.axis2.transport.http.HTTPWorker.service(HTTPWorker.java:229)
 at
org.apache.axis2.transport.http.server.AxisHttpService.doService(AxisHtt
pService.java:256)
 at
org.apache.axis2.transport.http.server.AxisHttpService.handleRequest(Axi
sHttpService.java:163)
 at
org.apache.axis2.transport.http.server.HttpServiceProcessor.run(HttpServ
iceProcessor.java:85)
 at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker
.runTask(ThreadPoolExecutor.java:665)
 at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker
.run(ThreadPoolExecutor.java:690)
 at java.lang.Thread.run(Thread.java:595)
</Exception>
 
PS: This works in jaxws-ri.
 
Please help.
thanx
-yogen
 
 
 
________________________________


NOTICE: If received in error, please destroy and notify sender. Sender
does not intend to waive confidentiality or privilege. Use of this email
is prohibited when received in error.
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.