3 Replies Latest reply on Dec 21, 2010 2:55 AM by jim.ma

    Service created twice from WSDL?

    lafr

      Using the current JBoss-AS 6.0.SNAPSHOT with Apache CXF 2.3.1 and JBossWS-CXF 3.4.0.CR3 for each WebService call I see a message two "Creating Service" messages from CXF.

      This is probably not necessary / intended.

      Is this a bug? If yes, a defect of apache cxf of of jboss-ws-cxf?

       

      22:23:45,789 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Creating Service {http://production.ws.fn.mbisoftware.biz/}ProductionMasterdataWS from WSDL: http://sb2000:8080/mbi-ws/mbi2e-lafr-sb2000-ipc/production/ProductionMasterdataWS?wsdl

      22:23:45,832 INFO  [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] Creating Service {http://production.ws.fn.mbisoftware.biz/}ProductionMasterdataWS from WSDL: http://sb2000:8080/mbi-ws/mbi2e-lafr-sb2000-ipc/production/ProductionMasterdataWS?wsdl

       

           ...

           ProductionMasterdataService pms = new ProductionMasterdataService();
           ProductionMasterdataWSI wsi = pms.getProductionMasterdataWSPort();
           ServiceGenericIntegerValueResponse response = wsi.getWorkCenter( this.workCenterId );

           ...

       

      @WebServiceClient
      public class ProductionMasterdataService extends Service
      {
          public ProductionMasterdataService( ) throws MalformedURLException, NamingException, MbiException
          {
              super( ServiceLocator.getInstance().buildWsdlUrl( "production", "ProductionMasterdataWS" ),

                        new QName( "http://production.ws.fn.mbisoftware.biz/", "ProductionMasterdataWS" ) );
          }

       

          public ProductionMasterdataWSI getProductionMasterdataWSPort()

          {
              ProductionMasterdataWSI versionWSI = this.getPort( ProductionMasterdataWSI.class );
              return versionWSI;
          }
      }

        • 1. Re: Service created twice from WSDL?
          asoldano

          Could you please share more details on the test?

          I just did a try with the JBWS2955TestCase (see the testsuite) which has a simple @WebServiceClient annotated service class and the ReflectionServiceFactoryBean seems to create the service just once.

          • 2. Re: Service created twice from WSDL?
            lafr
            • 3. Re: Service created twice from WSDL?
              jim.ma

              Service created twice from WSDL happens when the port is get or created without port QName :

               

              ProductionMasterdataWSI versionWSI = this.getPort( ProductionMasterdataWSI.class ); 
              

               

              If there is no  portQName  passed in, CXF ServiceImpl  creates service with WSDL first to get the port QName, then the service is created again with cxf internal Endpoint initialized.The CXF ServiceImpl reponsible to create service and port here needs to be improved to avoid to the same thing twice. I 'll fill a CXF jira issue and look at it later.Before resolve this issue in CXF, you can explicitly pass a port Qname when create or get a port in service to work around.