javaee / metro-wsit

https://javaee.github.io/metro-wsit/
Other
9 stars 24 forks source link

Service.getPort(MemberSubmissionEndpointReference) throws WSE(XMLStreamException) #111

Closed glassfishrobot closed 17 years ago

glassfishrobot commented 18 years ago

Error occured reading the metadata of a 2004 member submission endpointreference.

Given following xml element (that is a 2004 Member Submission Addressing Element), WSEndpointRefernece.parseMetadata() is walking off the end of the document, calling next when xmlstreamreader is on END_DOCUMENT.

[https://scarry-nt.east.sun.com:2372/WsatService/Registration/Coordinator/](https://scarry-nt.east.sun.com:2372/WsatService/Registration/Coordinator/)
11d5b393-e1ba-4911-b8b4-4ae59e1c0308

Here is stack trace of problem:

javax.xml.ws.WebServiceException: javax.xml.stream.XMLStreamException: at com.sun.xml.ws.api.addressing.WSEndpointReference$Metadata.(WSEndpointReference.java:803) at com.sun.xml.ws.api.addressing.WSEndpointReference$Metadata.(WSEndpointReference.java:781) at com.sun.xml.ws.api.addressing.WSEndpointReference.getMetaData(WSEndpointReference.java:773) at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:300) at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:292) at javax.xml.ws.Service.getPort(Service.java:285)

Here is code in question and comments from debug session:

WSEndpointReference.parseMetaData() .... do { //If the current element is metadata enclosure, look inside if (xsr.getLocalName().equals(version.eprType.metadataElement)) { String localName; String ns; XMLStreamBuffer mark; while ((mark = xsr.nextTagAndMark()) != null) { localName = xsr.getLocalName(); ns = xsr.getNamespaceURI(); if (localName.equals(version.eprType.serviceName))

{ String portStr = xsr.getAttributeValue(null, version.eprType.portName); serviceName = getElementTextAsQName(xsr); if (serviceName != null) portName = new QName(serviceName.getNamespaceURI(), portStr); }

else if (localName.equals(version.eprType.portTypeName))

{ portTypeName = getElementTextAsQName(xsr); }

else if (ns.equals(WSDLConstants.NS_WSDL) && localName.equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart()))

{ wsdlSource = new XMLStreamBufferSource(mark); }

else

{ XMLStreamReaderUtil.skipElement(xsr); }

} } else

{ //Skip is it is not root element if (!xsr.getLocalName().equals(rootElement)) XMLStreamReaderUtil.skipElement(xsr); }

} while (xsr.nextTag() == XMLStreamReader.START_ELEMENT);

Comments: ALL children elements of a 2004 EndpointReference are checked for metadata since there was not a wsa:metaData tag. The inner whle look with nextTagAndMark() iterates over children elements "address" and "ReferenceParameters". Then that look exist. The outer do/while calls nextTag() and that throws XMLStreamException since the END_DOCUMENT tag had already been reached.

Environment

Operating System: All Platform: All

Affected Versions

[current]

glassfishrobot commented 18 years ago

Reported by jfialli@java.net

glassfishrobot commented 18 years ago

vivekp@java.net said: Most probably its fixed, assigning to rama to further comment on it.

glassfishrobot commented 18 years ago

ramapulavarthi@java.net said: Fixed

glassfishrobot commented 17 years ago

mmatula@java.net said: This issue was fixed before we created 1.0 branch, so the fix is in 1.0 -> setting target milestone to say so.

glassfishrobot commented 18 years ago

Was assigned to ramapulavarthi@java.net

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA WSIT-111

glassfishrobot commented 17 years ago

Marked as fixed on Tuesday, November 13th 2007, 11:46:28 pm