/** * Populates and returns an AxisService from a WSDL. * @param wsdlContent The WSDL content * @return AxisService which represents the given WSDL * @throws DataServiceFault */ private static AxisService getAxisServiceFromWSDL(byte[] wsdlContent) throws DataServiceFault { try { AxisService axisService; ByteArrayInputStream byteIn = new ByteArrayInputStream(wsdlContent); if (isWSDL20(wsdlContent)) { axisService = new WSDL20ToAxisServiceBuilder(byteIn, null, null).populateService(); } else { // Must be WSDL11 axisService = new WSDL11ToAxisServiceBuilder(byteIn, null, null).populateService(); } return axisService; } catch (AxisFault e) { String message = "Error in getting AxisService from WSDL"; throw new DataServiceFault(e, message); } }
/** * returns a axisService given a input Stream of WSDL2.0 document. * * @param description * WSDL description * @param wsdlServiceName * @param endPoint * @param options * @return * @throws AxisFault */ public static AxisService createClientSideAxisService(Description description, QName wsdlServiceName, String endPoint, Options options) throws AxisFault { WSDL20ToAxisServiceBuilder serviceBuilder = new WSDL20ToAxisServiceBuilder(description, wsdlServiceName, endPoint); serviceBuilder.setServerSide(false); AxisService axisService = serviceBuilder.populateService(); AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoint(axisService .getEndpointName()); if (axisEndpoint != null) { options.setTo(new EndpointReference(axisEndpoint.getEndpointURL())); options.setSoapVersionURI((String) axisEndpoint.getBinding().getProperty( WSDL2Constants.ATTR_WSOAP_VERSION)); } return axisService; } private void printDescriptionObject(Description definition,
/** * returns a axisService given a input Stream of WSDL2.0 document. * * @param description * WSDL description * @param wsdlServiceName * @param endPoint * @param options * @return * @throws AxisFault */ public static AxisService createClientSideAxisService(Description description, QName wsdlServiceName, String endPoint, Options options) throws AxisFault { WSDL20ToAxisServiceBuilder serviceBuilder = new WSDL20ToAxisServiceBuilder(description, wsdlServiceName, endPoint); serviceBuilder.setServerSide(false); AxisService axisService = serviceBuilder.populateService(); AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoint(axisService .getEndpointName()); if (axisEndpoint != null) { options.setTo(new EndpointReference(axisEndpoint.getEndpointURL())); options.setSoapVersionURI((String) axisEndpoint.getBinding().getProperty( WSDL2Constants.ATTR_WSOAP_VERSION)); } return axisService; } private void printDescriptionObject(Description definition,
isAllPorts()); builder.setCodegen(true); addAxisService(builder.populateService()); } else { builder = new WSDL20ToAllAxisServicesBuilder(wsdlUri, getPortName());