public javax.xml.rpc.Call createCall(QName portName)
throws ServiceException {
javax.wsdl.QName qn = new javax.wsdl.QName( portName.getNamespaceURI(),
portName.getLocalPart() );
if ( wsdlDefinition == null )
throw new ServiceException( JavaUtils.getMessage("wsdlMissing00") );
Port port = wsdlService.getPort( portName.getLocalPart() );
if ( port == null )
throw new ServiceException( JavaUtils.getMessage("noPort00", "" + portName) );
Binding binding = port.getBinding();
PortType portType = binding.getPortType();
if ( portType == null )
throw new ServiceException( JavaUtils.getMessage("noPortType00", "" + portName) );
Call call = (org.apache.axis.client.Call)createCall();
call.setPortTypeName( portName );
// Get the URL
////////////////////////////////////////////////////////////////////
List list = port.getExtensibilityElements();
for ( int i = 0 ; list != null && i < list.size() ; i++ ) {
Object obj = list.get(i);
if ( obj instanceof SOAPAddress ) {
try {
SOAPAddress addr = (SOAPAddress) obj ;
URL url = new URL(addr.getLocationURI());
call.setTargetEndpointAddress(url);
}
catch(Exception exp) {
throw new ServiceException(
JavaUtils.getMessage("cantSetURI00", "" + exp) );
}
}
}