Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336771

Summary: JAX-WS Service Provider From WSDL / Test with Web Services Error when WSDL has more than one Operation
Product: [WebTools] WTP Webservices Reporter: Robert Lario <eclipse>
Component: jst.wsAssignee: Mark Hutchinson <mahutch>
Status: RESOLVED FIXED QA Contact: Keith Chong <keith.chong.ca>
Severity: major    
Priority: P3 CC: zsolt.beothy-elo
Version: unspecified   
Target Milestone: 3.2.4   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 339270    
Attachments:
Description Flags
wsdl with more than one operation
none
fix none

Description Robert Lario CLA 2011-02-09 17:44:40 EST
Build Identifier: 20100917-0705

If JAX-WS Service Provider From WSDL  is used with a WSDL (RPC/Literal) that has more than one operation I get an error when I use the "Web Services>Test with Web Services"

There error is :HTTP ERROR 500
Problem accessing /wse/wsexplorer/wsexplorer.jsp. Reason: 

    INTERNAL_SERVER_ERROR

Caused by:
java.lang.NullPointerException
	at org.eclipse.wst.ws.internal.explorer.platform.wsdl.datamodel.WSDLOperationElement.gatherSoapInformation(WSDLOperationElement.java:87)
	at org.eclipse.wst.ws.internal.explorer.platform.wsdl.datamodel.WSDLOperationElement.setOperation(WSDLOperationElement.java:175)
	at org.eclipse.wst.ws.internal.explorer.platform.wsdl.datamodel.WSDLOperationElement.<init>(WSDLOperationElement.java:131)
	at org.eclipse.wst.ws.internal.explorer.platform.wsdl.datamodel.WSDLBindingElement.buildModel(WSDLBindingElement.java:204)
	at org.eclipse.wst.ws.internal.explorer.platform.wsdl.datamodel.WSDLServiceElement.buildModel(WSDLServiceElement.java:109)
	at org.eclipse.wst.ws.internal.explorer.platform.wsdl.datamodel.WSDLElement.buildModel(WSDLElement.java:423)
	at org.eclipse.wst.ws.internal.explorer.platform.wsdl.actions.OpenWSDLAction.run(OpenWSDLAction.java:74)
	at org.eclipse.wst.ws.internal.explorer.platform.wsdl.perspective.WSDLPerspective.preloadWSDL(WSDLPerspective.java:104)
	at org.eclipse.wst.ws.internal.explorer.platform.perspective.LaunchOptionsManager.loadOptions(LaunchOptionsManager.java:93)
	at org.eclipse.wst.ws.internal.explorer.platform.perspective.LaunchOptionsManager.manageSession(LaunchOptionsManager.java:54)
	at org.eclipse.wst.ws.internal.explorer.platform.perspective.LaunchOptionsManager.manage(LaunchOptionsManager.java:45)
	at org.apache.jsp.wsexplorer.wsexplorer_jsp._jspService(wsexplorer_jsp.java:148)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.jsp.jasper.JspServlet.service(JspServlet.java:112)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:76)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:318)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)




Reproducible: Always

Steps to Reproduce:
1.Create WSDL with Two operations
2.Create Project with JAX-WS Service Provider From WSDL
3.Run as OSGi Framework
4.Right click wsdl. Choose Web Services>Test with Web Services
5. Error
6. Remove one operation from and repeat steps 1 - 4. works great.
7. add back an operation and repeat steps 1-4; error
Comment 1 Zsolt Beothy-Elo CLA 2011-02-09 17:58:02 EST
Don't see in the stacktrace where Swordfish is involved. Therefore reassigning it to WTP Webservices. Hope it's the correct component.
Comment 2 Keith Chong CLA 2011-02-24 16:37:01 EST
Mark can you have a look at this.
Comment 3 Mark Hutchinson CLA 2011-02-25 12:10:23 EST
Created attachment 189833 [details]
wsdl with more than one operation

I can reproduce this problem easily using this WSDL
Comment 4 Mark Hutchinson CLA 2011-02-25 12:12:44 EST
Thanks for the bug report.  That's a nasty problem.  Which version of WTP are you seeing this in?  3.2.3? I can reproduce it easily in 3.3. I'll have a look as soon as I can.
Comment 5 Mark Hutchinson CLA 2011-03-01 13:32:23 EST
After further investigation, this NPE exceptions only appears to happen on WSDLs where operations defined in the PortType are not also defined in the Binding.  In the graphical WSDL editor the binding can be easily updated by running the "generate binding content" action on the binding node. 

You'll see in the attached WSDL the port type looks like this:
 <wsdl:portType name="test">
    <wsdl:operation name="Operation1">
      <wsdl:input message="tns:Operation1Request"/>
      <wsdl:output message="tns:Operation1Response"/>
    </wsdl:operation>
    <wsdl:operation name="Operation2">
    	<wsdl:input message="tns:Operation2Request"></wsdl:input>
    	<wsdl:output message="tns:Operation2Response"></wsdl:output>
    </wsdl:operation>
  </wsdl:portType>
  
  but the binding only has
    <wsdl:binding name="testSOAP" type="tns:test">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="Operation1">
      <soap:operation soapAction="http://www.example.org/test/Operation1"/>
      <wsdl:input>
        <soap:body namespace="http://www.example.org/test/" use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body namespace="http://www.example.org/test/" use="literal"/>
      </wsdl:output>
    </wsdl:operation>

Regardless, the Web Services explorer should still tolerate this and not display any error.
Comment 6 Mark Hutchinson CLA 2011-03-08 13:47:02 EST
Created attachment 190679 [details]
fix

The fix is to only process operations that are in the binding.
Comment 7 Mark Hutchinson CLA 2011-03-08 13:58:18 EST
Checked into R3_2_maintenance for WTP 3.2.4
Comment 8 Keith Chong CLA 2011-03-08 15:29:07 EST
Released for 3.2.4
Comment 9 Mark Hutchinson CLA 2011-03-11 11:25:36 EST
I've verified this fix in today's smoke test on M-3.2.4-20110310145050