Title: Find Some sample examples for parsing of wsdl url using wsdl4j
Tags: parsing;wsdl4j
Question: Please somebody help me to find some sample examples for parsing for wsdl url using wsdl4j API.
Thanks


Here is another answer: Try like this;
public Definition readWSDLFile() throws  WSDLException {
WSDLReader reader = getWsdlFactoryInstance().newWSDLReader();
// switch off the verbose mode
reader.setFeature(JAVAX_WSDL_VERBOSE_MODE, false);
reader.setFeature("javax.wsdl.importDocuments", true);
Definition wsdlDefinition;
if (log.isDebugEnabled()) {
log.debug("Reading  the WSDL. Base uri is " + baseURI);
}
wsdlDefinition = reader.readWSDL(baseURI);
return wsdlDefinition;
Using the Definition you can access the operation, service objects.. to access a service address location;
private void setServiceDefinition(Definition definition) throws Exception {
Map serviceMap = definition.getAllServices();
Iterator serviceItr = serviceMap.entrySet().iterator();
URL addressURI = null;
try {
while (serviceItr.hasNext()) {
Map.Entry svcEntry = (Map.Entry) serviceItr.next();
Service svc = (Service) svcEntry.getValue();
Map portMap = svc.getPorts();
Iterator portItr = portMap.entrySet().iterator();
while (portItr.hasNext()) {
Map.Entry portEntry = (Map.Entry) portItr.next();
Port port = (Port) portEntry.getValue();
ExtensibilityElement extensibilityElement = (ExtensibilityElement) port.getExtensibilityElements()
.get(0);
addressURI = new URL(getAddressUrl(extensibilityElement));
}
}
Here is a sample i have written, May be useful to you.
Comment for this answer: Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:02/20/13', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<parsing><wsdl4j>', 'Title': 'Find Some sample examples for parsing of wsdl url using wsdl4j', 'ViewCount': 4698, 'id': 14974054, 'user_AboutMe': None, 'user_AccountId': 290309.0, 'user_DisplayName': 'user591790', 'user_Reputation': 645.0, 'user_Views': 181.0, 'user_id': 591790.0}}