builder.setBaseUri(def.getDocumentBaseURI());
// [rfeng]
// AxisService axisService = builder.populateService();
// Allow privileged access to read properties. Requires PropertiesPermission read in
// security policy.
AxisService axisService;
try {
axisService = AccessController.doPrivileged(new PrivilegedExceptionAction<AxisService>() {
public AxisService run() throws AxisFault {
return builder.populateService();
}
});
} catch (PrivilegedActionException e) {
throw (AxisFault)e.getException();
}
String name = URI.create(endpointURL).getPath();
//[nash] HTTP endpoints need a leading slash for WSDL imports to work with ?wsdl
if (endpointURL.startsWith("jms")) {
name = name.startsWith("/") ? name.substring(1) : name;
}
axisService.setName(name);
axisService.setEndpointURL(endpointURL);
axisService.setDocumentation("Tuscany configured AxisService for service: " + endpointURL);
// TODO - again, do we ever have more than one endpoint
// on the service side?
for (Iterator i = axisService.getEndpoints().values().iterator(); i.hasNext();) {
AxisEndpoint ae = (AxisEndpoint)i.next();
if (endpointURL.startsWith("jms")) {
// not in Axis2 1.5.1
// Parameter qcf = new Parameter(JMSConstants.CONFAC_PARAM, null);
// qcf.setValue(DEFAULT_QUEUE_CONNECTION_FACTORY);
// axisService.addParameter(qcf);
break;
}
}
// Add schema information to the AxisService (needed for "?xsd=" support)
addSchemas(wsBinding.getUserSpecifiedWSDLDefinition(), axisService);
// Use the existing WSDL
Parameter wsdlParam = new Parameter("wsdl4jDefinition", null);
wsdlParam.setValue(definition);
axisService.addParameter(wsdlParam);
Parameter userWSDL = new Parameter("useOriginalwsdl", "true");
axisService.addParameter(userWSDL);
// Modify schema imports and includes to add "servicename?xsd=" prefix.
// Axis2 does this for schema extensibility elements, but Tuscany has
// overriden the WSDl4J deserializer to create UnknownExtensibilityElement
// elements in place of these.
modifySchemaImportsAndIncludes(definition, name);
// Axis2 1.3 has a bug with returning incorrect values for the port
// addresses. To work around this, compute the values here.
Parameter modifyAddr = new Parameter("modifyUserWSDLPortAddress", "false");
axisService.addParameter(modifyAddr);
return axisService;
}