axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [jira] Commented: (AXIS-598) re: Incorrect error message thrown. Complaint of lack of method syncronization
Date Sun, 30 May 2004 01:47:01 GMT
The following comment has been added to this issue:

     Author: Erich Pletsch
    Created: Sat, 29 May 2004 6:46 PM
       Body:
If you receive the following error: 

OperationDesc for deassignItem was not synchronized to a method of 
edu.usf.acomp.axis.AxisLMSServerSoapBindingImpl

Chances are that you have a datatype or classloader mismatch between your wsdl/wsdd and your
*SoapBindingImpl.

Do not assume that because you generated a WSDL file with java2wsdl that your datatypes will
always migrate successfuly.  Sometimes, you may get a successful wsdl generation and then
binding stub generation from the WSDL, but when you put your own stuff into the stub it breaks.

For example, if your wsdl specifies type java.util.Date and your method signature specifies
java.sql.date (either explicitly or via import) you will receive an OperationDesc for xxx
was not sychronized to a method of yyy.yyy.yyy where xxx is the method name in class yyy.yyy.yyy

/**********************************************************/
 *Code example:
 */

//Here is a simple example class importing type java.sql.Date

package com.yourcompany.edi;

import java.sql.Date;

public class XMLRPC implements com.yourcompany.XMLRPC{

	public XMLRPC() {
		this.ds = new Datastore();
	}

	//Add User
	public boolean addUser(String sUser, String sPass, Date dDate)	{
		return true;
	}
}

/**********************************************************/
<!--Here is the specification in the WSDL file (excerpt only)-->
<wsdl:message name="getAccountTransactionsSinceRequest">
      <wsdl:part name="sUser" type="xsd:string"/>
      <wsdl:part name="sPass" type="xsd:string"/>    
      <wsdl:part name="dDate" type="xsd:dateTime"/>
</wsdl:message>

/**********************************************************/

The above example will result in the following error:

OperationDesc for addUser was not synchronized to a method of 
com.yourcompany.edi

The reason for the error is that the wsdl specification dateTime is implemented as java.util.Date
and your import in the actual class is importing java.sql.Date (without specifying it implicitly
in the method signature)

To fix the problem modify the code as follows:

/**********************************************************/
 *Code example:
 */

//Here is a simple example class importing type java.sql.Date

package com.yourcompany.edi;

import java.util.Date;

public class XMLRPC implements com.yourcompany.XMLRPC{

	public XMLRPC() {
		this.ds = new Datastore();
	}

	//Add User
	public boolean addUser(String sUser, String sPass, Date dDate)	{
		//Then if for some reason you absolutely must have
		//java.sql.date, cast it in here.
		return true;
	}
}

/**********************************************************/

This may also be caused by a bug in java2wsdl in which the type is not correctly read.

---------------------------------------------------------------------
View this comment:
  http://issues.apache.org/jira/browse/AXIS-598?page=comments#action_35806

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-598

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-598
    Summary: re: Incorrect error message thrown. Complaint of lack of method syncronization
       Type: Bug

     Status: Resolved
 Resolution: CANNOT REPRODUCE

    Project: Axis
 Components: 
             WSDL processing
   Versions:
             current (nightly)

   Assignee: Axis Developers Mailing List
   Reporter: James Black

    Created: Thu, 2 Jan 2003 7:28 PM
    Updated: Sat, 29 May 2004 6:46 PM
Environment: Operating System: Solaris
Platform: Sun

Description:
Hello,
  I built my jar files from the CVS source this morning, and now have this 
error, which I am assuming is a bug.
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: org.apache.axis.InternalException: java.lang.Exception: The 
OperationDesc for deassignItem was not synchronized to a method of 
edu.usf.acomp.axis.AxisLMSServerSoapBindingImpl.
 faultActor: null
 faultNode: null
 faultDetail: 
	{http://xml.apache.org/axis/}stackTrace: 
org.apache.axis.InternalException: java.lang.Exception: The OperationDesc for 
deassignItem was not synchronized to a method of 
edu.usf.acomp.axis.AxisLMSServerSoapBindingImpl.
	at org.apache.axis.description.ServiceDesc.syncOperationToClass
(ServiceDesc.java:723)
	at org.apache.axis.description.ServiceDesc.getSyncedOperationsForName
(ServiceDesc.java:977)
	at 
org.apache.axis.description.ServiceDesc.loadServiceDescByIntrospectionRecursive
(ServiceDesc.java:853)
	at 
org.apache.axis.description.ServiceDesc.loadServiceDescByIntrospection
(ServiceDesc.java:820)
	at 
org.apache.axis.description.ServiceDesc.loadServiceDescByIntrospection
(ServiceDesc.java:770)
	at org.apache.axis.description.ServiceDesc.getOperations
(ServiceDesc.java:380)
	at org.apache.axis.wsdl.fromJava.Emitter.writePortType(Emitter.java:791)
	at org.apache.axis.wsdl.fromJava.Emitter.getWSDL(Emitter.java:383)
	at org.apache.axis.wsdl.fromJava.Emitter.emit(Emitter.java:262)
	at org.apache.axis.providers.java.JavaProvider.generateWSDL
(JavaProvider.java:475)
.
.
.


  I will attach the wsdl file that was used, and the implementation file. This 
may have been caused by fixing bug 13146.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message