Web services compiled bindings troubleshooting tips

 

+

Search Tips   |   Advanced Search

 

This topic discusses troubleshooting compiled bindings of Web services that are developed and implemented based on Java programming models.

Each section in this topic is a problem that you might experience with compiled bindings for Web services. A solution is provided to help you troubleshoot the problem.

 

Context root not recognized when mapping the default XML namespace to a Java package

When you map the default XML namespace to a Java package the context root is not recognized. If two namespaces are the same up to the first slash, they map to the same Java package. For example, the XML namespaces http://www.ibm.com/foo and http://www.ibm.com/bar both map to the www.ibm.com Java package . Use the -NStoPkg option of the Java2WSDL command to specify the package for the fully qualified namespace.

 

Java code to WSDL mapping cannot be reversed to the original Java code

If you find that a WSDL file that you created with the Java2WSDL command-line tool cannot be compiled when regenerated into Java code using the WSDL2Java command-line tool, it is because the Java API for XML-based remote procedure call (JAX-RPC) mapping from Java code to WSDL is not reversible back to the original Java code.

To troubleshoot this problem, try specifying the -introspect option to the WSDL2Java command. The -instrospect option indicates to the WSDL2Java command to look into existing Java classes and gather information useful in generating artifacts that match the original Java code.

 

The session bean fails to instantiate when the Web service is accessed

If you are trying to access a Web service and you get the following error, WSWS3422E: Error: Can not instantiate bean_name, the session bean might be trying to be accessed as a servlet-type Web service.

If this error message displays during the initial testing of a Web service, verify with the Web service developer that the correct type of Web service was generated. For example, if a session bean is exposed as a Web service, an enterprise bean-type Web service should be created. A session bean that is accessed as a servlet-type Web service can cause this exception.


 

Related tasks

Troubleshooting Web services

 

Related information

WSDL2Java command for JAX-RPC applications
Java2WSDL command for JAX-RPC applications
Web services: Resources for learning