Troubleshoot WSDL2Java and Java2WSDL
- The .Net client does not reflect a Web service method with Vector-type parameters The following exception displays when running the .NET client for a Web service:
System.InvalidOperationException: Method AnnuityInteropService.wsListAnnuityByHolder can not be reflected.
System.InvalidOperationException: There was an error reflecting wsListAnnuityByHolderResult.
System.InvalidOperationException: The Form property might not be unqualified when an explicit namespace property is available.The problem is exposed when the server-side method returns a Vector and the style of the WSDL file is document/literal and the Form is unqualified. The unqualified Form is always generated for the document/literal style because elementFormDefault="unqualified" by default.
- A problem exists in the .NET framework that can generate a Web service proxy class that is not valid when your Web service methods contain certain arrays as parameters. The framework adds an XmlArrayAttribute attribute to the parameter, and the attribute constructor contains an "Form=Unqualified" and a namespace definition. While the attribute is valid, it is not valid to combine these two aspects of the attribute, causing the System.InvalidOperationException exception.
To avoid this problem, do not use Vector parameters in a Web service method that is deployed into WAS. Vector parameters in a Web service method do not work with a .Net client or a Java collection type.
- Error with the Endpoint Enabler tool on a Hyper Threading-enabled machine
When you run the Endpoint Enabler tool on a Hyper Threading-enabled machine, an error is reported in the Tasks view against the Enterprise Application project. The Enterprise Application project cannot be deleted until you restart the workbench.
This problem can occur if a race condition exists between the automatic build and the EJB project validator.
To resolve the problem, turn off the workbench automatic build before running the Endpoint Enabler tool, and turn it back on afterwards.
- Multiprotocol port component restrictions with JSR109 V1.0 and 1.1
Java Specification Requests (JSR) 109 specification validation errors occur when deploying an enterprise archive (EAR) file that contains a WSDL file with http, jms and ejb bindings generated by the Java2WSDL command-line tool.
The JSR 109 specification requires each port component defined in the webservices.xml deployment descriptor file to refer to unique <servlet-class> elements in web.xml file for a JavaBeans implementation, or a unique <session> element in ejb-jar.xml file for an EJB implementation. The servlet and session EJB are located in the webservices.xml file represented by <servlet-link> or <ejb-link> element.
The WSDL2Java command-line tool maps the ports found in a WSDL file to port components that are in the generated webservices.xml file. If a single Web service has multiple bindings, in addition to a port for each of these bindings, the webservices.xml file contains multiple port components that should all point to the same EJB module(<session>) or JavaBeans (<servlet-class>) implementation. Because of the JSR 109 restrictions, the webservices.xml file is not valid and errors can occur during the deployment process. The following example displays the error:
Error in <module> : CHKW6030E: Implementation class <class> referred to by port components<port1> and <port2>. (JSR109 1.0: 7.1.2).Here is the error with sample data:
Error in WebSvcsInSession20EJB.jar : CHKW6030E: Implementation class WSMultiProtocol referred to by port components WSMultiProtocolJMS and WSMultiProtocolEJB.(JSR109 1.0: 7.1.2).You can work around the restriction by creating multiple <session> EJB definitions within the ejb-jar.xml file that all point to the same implementation class, home interface and remote interface. You can still use the same classes, but the ejb-jar.xml file <session> definitions that reference the classes and the interfaces must be duplicated. The following is an example of the webservices.xml file. Look for the classes and interfaces:
<webservices> <webservice-description> <webservice-description-name>WSMultiProtocolService</webservice-description-name> <wsdl-file>META-INF/wsdl/WSMultiProtocol.wsdl</wsdl-file> <jaxrpc-mapping file>META-INF/WSMultiProtocol_mapping.xml</jaxrpc-mapping file> <port-component> <port-component-name>WSMultiProtocolEjb</port-component-name> <wsdl-port> <namespaceURI>http://ejb.pli.tc.wssvt.ibm.com</namespaceURI> <localpart>WSMultiProtocolEjb</localpart> </wsdl-port> <service-endpoint-interface>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol </service-endpoint-interface> <service-impl-bean> <ejb-link>WSMultiProtocol</ejb-link> </service-impl-bean> </port-component> <port-component> <port-component-name>WSMultiProtocolJMS</port-component-name> <wsdl-port> <namespaceURI>http://ejb.pli.tc.wssvt.ibm.com</namespaceURI> <localpart>WSMultiProtocolJMS</localpart> </wsdlport> <service-endpoint-interface>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol </service-endpoint-interface> <service-impl-bean> <ejb-link>WSMultiProtocol_2</ejb-link> </service-impl_bean> </port-component> <port-component> <port-component-name>WSMultiProtocolJMS</port-component-name> <wsdl-port> <namespaceURI>http://ejb.pli.tc.wssvt.ibm.com</namespaceURI> <localpart>WSMultiProtocolJMS</localpart> </wsdlport> <service-endpoint-interface>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol </service-endpoint-interface> <service-impl-bean> <ejb-link>WSMultiProtocol_3</ejb-link> </service-impl_bean> </port-component> </webservice-description> </webservices>The following is an example of the ejb-jar.xml file. Look for the classes and interfaces, and how they are duplicated:
<ejb-jar-id="ejb-jar_ID"> <display-name>WebSvcsInsSession20EJB</display-name> <enterprise-beans> <session-id="WSMultiProtocol"> <ejb-name>WSMultiProtocol</ejb-name> <home>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolHome</home> <remote>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol</remote> <ejb-class>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolWebSvcsBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <ejb-ref-id="EjbRef_1082407586720"> <description></description> <ejb-ref-name>ejb/BeneficiarySession</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>com.ibm.wssvt.tc.pli.ejb.BeneficiarySessionHome</home> <remote>com.ibm.wssvt.tc.pli.ejb.BeneficiarySession</remote> <ejb-link>PolicySession20EJB.jar#BeneficiarySession</ejb-link> </ejb-ref> <ejb-ref-id="EjbRef_1082407586790"> <description></description> <ejb-ref-name>ejb/PolicySession</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>com.ibm.wssvt.tc.pli.ejb.PolicySessionHome</home> <remote>com.ibm.wssvt.tc.pli.ejb.PolicySession</remote> <ejb-link>PolicySession20EJB.jar#PolicySession</ejb-link> </ejb-ref> <session-id="WSMultiProtocol_2"> <ejb-name>WSMultiProtocol_2</ejb-name> <home>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolHome</home> <remote>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol</remote> <ejb-class>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolWebSvcsBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <ejb-ref-id="EjbRef_1082407586720_2"> <description></description> <ejb-ref-name>ejb/BeneficiarySession</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>com.ibm.wssvt.tc.pli.ejb.BeneficiarySessionHome</home> <remote>com.ibm.wssvt.tc.pli.ejb.BeneficiarySession</remote> <ejb-link>PolicySession20EJB.jar#BeneficiarySession</ejb-link> </ejb-ref> <ejb-ref-id="EjbRef_1082407586790_2"> <description></description> <ejb-ref-name>ejb/PolicySession</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>com.ibm.wssvt.tc.pli.ejb.PolicySessionHome</home> <remote>com.ibm.wssvt.tc.pli.ejb.PolicySession</remote> <ejb-link>PolicySession20EJB.jar#PolicySession</ejb-link> </ejb-ref> <session-id="WSMultiProtocol_3"> <ejb-name>WSMultiProtocol_3</ejb-name> <home>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolHome</home> <remote>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocol</remote> <ejb-class>com.ibm.wssvt.tc.pli.ejb.WSMultiProtocolWebSvcsBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <ejb-ref-id="EjbRef_1082407586790_3"> <description></description> <ejb-ref-name>ejb/BeneficiarySession</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>com.ibm.wssvt.tc.pli.ejb.BeneficiarySessionHome</home> <remote>com.ibm.wssvt.tc.pli.ejb.BeneficiarySession</remote> <ejb-link>PolicySession20EJB.jar#BeneficiarySession</ejb-link> </ejb-ref> <ejb-ref-id="EjbRef_1082407586790_3"> <description></description> <ejb-ref-name>ejb/PolicySession</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>com.ibm.wssvt.tc.pli.ejb.PolicySessionHome</home> <remote>com.ibm.wssvt.tc.pli.ejb.PolicySession</remote> <ejb-link>PolicySession20EJB.jar#PolicySession</ejb-link> </ejb-ref> </session>
- Avoiding application errors after uninstalling an interim fix, a fix pack, or a refresh pack
If an application uses functions that are provided by a particular fix and you remove the fix, the application displays an error message. If you remove a fix, make sure that you retest your applications to check for errors. Redeploy any applications that display an error message because of the missing fix.
For example, suppose you install a fix pack on WAS and you create the stock quote Web service, StockQuote. The WSDL2Java command-line tool is used in a deployer role and generates a ServiceLocator class that extends the AgnosticService class. If you uninstall the fix pack, the application is using a new Web services class (AgnosticService) that the version of WAS does not support. The application throws the following error:
java.lang.NoClassDefFoundError: Error while defining class: com.ibm.ws.wsfvt.test.stockquote.StockQuoteServiceLocator This error indicates that the class: com.ibm.webservices.multiprotocol.AgnosticService could not be located while defining the class: com.ibm.ws.wsfvt.test.stockquote.StockQuoteServiceLocatorRedeploy the application on the WAS to emit code that does not use the WAS version that is not supported by the Web services class that you use.
- Use a proxy server to access the Internet while running the WSDL2Java command causes your connection to time out
If you use an environment that requires a proxy server to access the Internet during the run of the WSDL2Java command, the WSDL2Java command might not find the Internet information because the proxy server has the potential to time out. For example, if the input WSDL file is located on the Internet instead of a local drive, and retrieve it from the Internet, the WSDL2Java command fails to find the file because the proxy server times out.
You can work around this problem by editing the WSDL2Java.bat file when using a Windows operating system or the WSDL2Java.sh file if you are using a Linux or operating system. These files are located in the <install_root>/WebSphere/AppServer/bin directory.
If you use a Windows operating system, set your proxy host and port values in the WSDL2Java.bat file as follows:
PROXY_INFO="-Dproxy.httpHost=yourPproxyHost -Dproxy.httpPort=yourProxyPortIf you use a Linux or operating system, set your proxy host and port values in the WSDL2Java.sh file as follows:
PROXY_INFO="-Dproxy.httpHost=yourProxyHost -Dproxy.httpPort=yourProxyPort- Emitter failure error occurs when running the WSDL2Java command on a WSDL document containing a JMS-style endpoint URL
If you run the WSDL2Java command-line tool on a WSDL document that contains a JMS-style endpoint Web address, for example, jms:/..., the urlprotocols.jar file that contains the custom protocol handler for the JMS protocol must be in the CLASSPATH variable statement. The error WSWS3099E: Error: Emitter failure. Invalid endpoint address in port <x> in service <y>: <jms-url-string> is avoided by making sure the urlprotocols.jar file is in the CLASSPATH variable statement.
To add the urlprotocols.jar file to the CLASSPATH variable statement:
On Windows platforms, edit...
install_root\bin\setupCmdLine.bat...and locate the line that sets the WAS_CLASSPATH environment variable. Add %install_root%\lib\urlprotocols.jar to the end of the line that sets the WAS_CLASSPATH environment variable.
On Linux and AIX operating systems, edit the install_root/bin/setupCmdLine.sh file and add $install_root/lib/urlprotocols.jar to the end of the line that sets the WAS_CLASSPATH environment variable.
Make sure to use the proper deliminator character for your platform, for example, use a semicolon (;) for Windows platforms and a colon (:) for Linux and platforms.
Related tasks
Troubleshoot Web services
Related information
Web services: Resources for learning
WSDL2Java command for JAX-RPC applications