如何在码头上运行肥皂网服务?

时间:2015-09-04 15:03:49

标签: java web-services soap jetty jax-ws

我很想在我的嵌入式码头服务器上运行soap webservice。

我按照这个德语教程(其中没有工作): http://www.torsten-horn.de/techdocs/jee-jax-ws.htm#Deployment-im-Webserver

相关代码:

Endpoint ep = Endpoint.publish( url, new BuecherServiceImpl() );
int anzahlBuecherResult = TestWsClient.test( "WsMitEndpointIntegrTest", url, 4000000000L, anzahlBuecher, true );


public static int test( String testName, String url, long startIsbn, int anzahlBuecher, boolean trace ) throws Exception
{
  BuecherServiceIntf buecherService;
  if( url.equalsIgnoreCase( "direkt" ) ) {
     buecherService = new BuecherServiceImpl();
  } else {
     System.out.println( testName + ": " + url );
     Service service = null;
     int timeoutSekunden = 20;
     while( service == null ) {
        try {
           //here the Exception occurs, maybe because of a wrong qname
           service = Service.create(
                 new URL( url + "?wsdl" ),
                 new QName( "http://soap.apachecxf/" , "BuecherServiceImplService" ) );
        } catch( WebServiceException ex ) {
           if( timeoutSekunden-- <= 0 ) throw ex;
           try { Thread.sleep( 1000 ); } catch( InterruptedException e ) {/*ok*/}
        }
     }
     buecherService = service.getPort( BuecherServiceIntf.class );
  }

太阳jaxws.xml

<endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime">

<endpoint name="BuecherService" implementation="soap.apachecxf.BuecherServiceImpl" url-pattern="/ws/BuecherService" />

</endpoints>

有人可以在这里给我一些帮助吗?

0 个答案:

没有答案