[jbosstools-issues] [JBoss JIRA] (JBIDE-13527) [tester] freeze parsing wsdl

Brian Fitzpatrick (JIRA) jira-events at lists.jboss.org
Thu Jun 6 10:28:54 EDT 2013


    [ https://issues.jboss.org/browse/JBIDE-13527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12779813#comment-12779813 ] 

Brian Fitzpatrick commented on JBIDE-13527:
-------------------------------------------

Ok, so the SOAP message is generated fine apparently. The issue seems to be with how I'm getting the namespace URL from the WSDL. 

Basically what I do is grab the javx.wsdl.Definition and work my way through to find the service and port I'm looking for (in this case RegistrationServiceImpService and RegistrationServiceImplPort), then grab the binding associated with the port, the port type associated with the binding, and the namespace of the port type. (You can see my code below.)

The namespace associated with the port type in this case is the incorrect ns (xmlns:ns1="http://types.complex.jaxws.ws.test.jboss.org/"), which is not the tns of the wsdl itself (xmlns:tns="http://complex.jaxws.ws.test.jboss.org"). 

Which namespace URI should I be grabbing to execute the test against? I need the ns url to create the java.xml.ws.Service I'm using to generate the SOAPMessage...

{code}
	public static String[] getNSServiceNameAndMessageNameArray (Definition wsdlDefinition, String serviceName, String portName, String bindingName, String opName ) {
		Map<?, ?> services = wsdlDefinition.getServices();
		Set<?> serviceKeys = services.keySet();
		for( Iterator<?> it = serviceKeys.iterator(); it.hasNext(); ) {
			QName serviceKey = (QName) it.next();
			if (serviceName != null && serviceKey.getLocalPart().contentEquals(serviceName)) {
				Service service = (Service) services.get( serviceKey );
				Map<?, ?> ports = service.getPorts();
				Set<?> portKeys = ports.keySet();
				for( Iterator<?> it2 = portKeys.iterator(); it2.hasNext(); ) {
					String portKey = (String) it2.next();
					if (portName != null && portKey.contentEquals(portName)) {
						Port port = (Port) ports.get( portKey );
						Binding wsdlBinding = port.getBinding();
						PortType portType = wsdlBinding.getPortType();
						String ns = portType.getQName().getNamespaceURI();
						List<?> operations = portType.getOperations();
						for (Iterator<?> it3 = operations.iterator(); it3.hasNext();){
							Operation operation = (Operation) it3.next();
							if (opName != null && operation.getName().contentEquals(opName)) {
								return new String[] {ns, serviceName, portName};
							}
						}
					}
				}
			}
		}
		return null;
	}

{code}
                
> [tester] freeze parsing wsdl
> ----------------------------
>
>                 Key: JBIDE-13527
>                 URL: https://issues.jboss.org/browse/JBIDE-13527
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: Webservices
>    Affects Versions: 3.3.2.Final
>            Reporter: Alessio Soldano
>            Assignee: Brian Fitzpatrick
>              Labels: new_and_noteworthy
>             Fix For: 4.1.0.Beta1
>
>         Attachments: jaxws-complex.war, threaddump.txt
>
>
> JBT freezes when the ws tester is used to consume the wsdl contract for the jaxws-complex.war test deployment of JBossWS testsuite.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list