Hello,
You could use the WSDL4J API to change the URI of the SOAP address before you do the invocation, using code like this:
// get the WSDL
javax.wsdl.Definition wsdlDefinition = org.apache.wsif.util.WSIFUtils.readWSDL(....) // use whichever method is convenient for you
// get to the SOAP address
javax.wsdl.Port port = wsdlDefinition.getService(serviceQName).getPort(portName) // replace "serviceQName" and "portName" with appropriate values
List extensibilityElements = port.getExtensibilityElements();
// iterate through the list and grab the SOAP address
Iterator it = extensibilityElements.iterator();
while (it.hasNext()) {
javax.wsdl.extensions.ExtensibilityElement extensibilityElement = (javax.wsdl.extensions.ExtensibilityElement) it.next();
// if this is a SOAP address, change the URI
if (extensibilityElement instanceof javax.wsdl.extensions.soap.SOAPAddress) {
((javax.wsdl.extensions.soap.SOAPAddress) extensibilityElement).setLocationURI(...) // set to whatever you want
break;
}
}
// now do the WSIF stuff
// create a service factory
WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
// parse WSDL
WSIFService service =
factory.getService(
wsdlDefinition,
...) // use whatever method is convenient
// now use the WSIFService object to make invocation via a stub or dynamically, as shown in WSIF samples and test cases
Now WSIF will operate on the WSDL definition you modified, so it will use the new URI. Of course this is all assuming that you want to use a URI different from the one in the WSDL (possibly one that is determined at runtime?); if not it makes more sense to just put it in the WSDL by replacing the existing one, or by adding a new port with a different SOAP address.
Nirmal.
| "ALI,HANEEF (HP-Cupertino,ex1)"
<[EMAIL PROTECTED]>
02/13/2003 09:25 PM
|
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> cc: Subject: How to change the URI of the service |
Hi,
How to change the URI of the service? I don't want to use the URI that is
available in WSDL file.
Haneef
_____
Haneef Ali
Web Services Management Operation
HP OpenView Division
408.447.1183
[EMAIL PROTECTED] < mailto:[EMAIL PROTECTED]>
