axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Samuel Emangard (JIRA)" <j...@apache.org>
Subject [jira] Updated: (AXIS2-3517) java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement
Date Mon, 18 Feb 2008 10:08:34 GMT

     [ https://issues.apache.org/jira/browse/AXIS2-3517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Samuel Emangard updated AXIS2-3517:
-----------------------------------

    Attachment: DummyService.wsdl

I reproduced the issue with a much simpler use-case

public class Dummy {

	private boolean myBoolean;
	private String myString;

public class DummyService {

	public Dummy getDummy() {
		return new Dummy(true, "theDummy");
	}
}

Skeleton code:
 try {
                		 LOGGER.info("Is he a dummy?");
            			 XMLStreamReader reader = BeanUtil.getPullParser(new Dummy(true, "Billy"));

            			 GetDummyResponse response = new GetDummyResponse(); 
		                 response.set_return(com.toluna.as.ext.model.dummy.xsd.Dummy.Factory.parse(reader));
		                 return response;
                	 } catch (Exception e) {
                		 LOGGER.error(e);
                		return null;
                	 }

I generated an Axis2/ADB web service for the DummyService and when invoking it I always have


[ERROR] java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement
myBoolean

Please find in attachment the WSDL

> java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement
> -------------------------------------------------------------------------------------
>
>                 Key: AXIS2-3517
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3517
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: databinding
>    Affects Versions: 1.3
>         Environment: Axis2 tools 1.3.0 for eclipse
> Eclipse 3.3.1.1
> apache-axis2-1.3
> apache-tomcat-6.0.16
> Windows XP
>            Reporter: Samuel Emangard
>         Attachments: DummyService.wsdl
>
>
> I expose 3 operations of a service
> 	public Project[] getProjectsAsArray(String schema, String login) throws ServiceException
{
> 		try {
> 			return (Project[]) projectDAO.findAllByLogin(schema, login).toArray();
> 		} catch (Exception e) {
> 			throwServiceException("Exception while getting projects for the login "+login, e);
> 			return null;
> 		}
> 	}
> 	
> 	public Project getFirstProject(String schema, String login) throws ServiceException
{
> 		try {
> 			return (Project) projectDAO.findAllByLogin(schema, login).get(0);
> 		} catch (Exception e) {
> 			throwServiceException("Exception while getting projects for the login "+login, e);
> 			return null;
> 		}
> 	}
> 	
> 	public String getFirstProjectName(String schema, String login) throws ServiceException
{
> 		try {
> 			return ((Project) projectDAO.findAllByLogin(schema, login).get(0)).getName();
> 		} catch (Exception e) {
> 			throwServiceException("Exception while getting projects for the login "+login, e);
> 			return null;
> 		}
> 	}
> I generated the web service Axis2 archive
> with the adb binding
> here is the code of my skeletton
>                   public com.toluna.as.ext.services.project.xsd.GetProjectsAsArrayResponse
getProjectsAsArray
>                   (
>                   com.toluna.as.ext.services.project.xsd.GetProjectsAsArray getProjectsAsArray
>                   )
>             throws ServiceException{
>                 	 try {
>                 		 String schema = getProjectsAsArray.getSchema();
>                 		 String login = getProjectsAsArray.getLogin();
>                 		 List<Project> projects = new ProjectHibernateDAO().findAllByLogin(schema,
login);
>                 		 LOGGER.info("size----> " + projects.size() + " for schema "+ schema
+ " and login "+ login);
>                 		 GetProjectsAsArrayResponse response = new GetProjectsAsArrayResponse();

>                 		 Iterator it = projects.iterator();
>                 		 while (it.hasNext()) {
>                 			 Project project = (Project) it.next();
>                 			 XMLStreamReader reader = BeanUtil.getPullParser(project);
>                 			 // 1
>                 			 // StreamWrapper parser = new StreamWrapper(reader);
>                 			 // StAXOMBuilder stAXOMBuilder =
>                 			 // OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(),
>                 			 // parser);
>                 			 // OMElement element = stAXOMBuilder.getDocumentElement();
>                 			 // projectArray.add(com.toluna.as.ext.model.project.xsd.Project.Factory.parse(element.getXMLStreamReader()));
>                 			 // 2
>                 			 
>                 			 response.add_return(com.toluna.as.ext.model.project.xsd.Project.Factory.parse(reader));
>                 		 }
>                 		
>                 		 return response;
>                 	 } catch (Exception e) {
>                 		 LOGGER.error(e);
>                 		 throw new ServiceException("", e);
>                 	 }
>         }
>                  public com.toluna.as.ext.services.project.xsd.GetFirstProjectResponse
getFirstProject
>                   (
>                   com.toluna.as.ext.services.project.xsd.GetFirstProject getFirstProject
>                   )
>             throws ServiceException{
>                  	 try {
>                 		 String schema = getFirstProject.getSchema();
>                 		 String login = getFirstProject.getLogin();
>                 		 List<Project> projects = new ProjectHibernateDAO().findAllByLogin(schema,
login);
>                 		 LOGGER.info("size----> " + projects.size() + " for schema "+ schema
+ " and login "+ login);
>             			 Project project = projects.get(0);
>             			 XMLStreamReader reader = BeanUtil.getPullParser(project);
>             			 // 1
>             			 // StreamWrapper parser = new StreamWrapper(reader);
>             			 // StAXOMBuilder stAXOMBuilder =
>             			 // OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getOMFactory(),
>             			 // parser);
>             			 // OMElement element = stAXOMBuilder.getDocumentElement();
>             			 // projectArray.add(com.toluna.as.ext.model.project.xsd.Project.Factory.parse(element.getXMLStreamReader()));
>             			 // 2
> 		                 GetFirstProjectResponse response = new GetFirstProjectResponse();

> 		                 response.set_return(com.toluna.as.ext.model.project.xsd.Project.Factory.parse(reader));
> 		                 return response;
>                 	 } catch (Exception e) {
>                 		 LOGGER.error(e);
>                 		 throw new ServiceException("", e);
>                 	 }
>         }
>                  public com.toluna.as.ext.services.project.xsd.GetFirstProjectNameResponse
getFirstProjectName
>                   (
>                   com.toluna.as.ext.services.project.xsd.GetFirstProjectName getFirstProjectName
>                   )
>             throws ServiceException{
>                 	 try {
>                 		 String schema = getFirstProjectName.getSchema();
>                 		 String login = getFirstProjectName.getLogin();
>                 		 List<Project> projects = new ProjectHibernateDAO().findAllByLogin(schema,
login);
>                 		 LOGGER.info("size----> " + projects.size() + " for schema "+ schema
+ " and login "+ login);
>                 		 Project project = (Project) projects.get(0);
>                 		 GetFirstProjectNameResponse response = new GetFirstProjectNameResponse();

>                 		 response.set_return(project.getName());
>                 		 return response;
>                 	 } catch (Exception e) {
>                 		 LOGGER.error(e);
>                 		 throw new ServiceException("", e);
>                 	 }
>                  
>                  }		
> 		
> 					 
> 					 
> when I test it with SOAP UI
> I always have the following exception (SOAP response)
> java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement
creationDate
> public class Project extends ASObject {
>     private Date launchDate;
>     private Date endDate;
>     private boolean launched;
>     private boolean paused;
>     private boolean requestEmail;
>     private boolean webSiteAccess;
>     private boolean useCookies;
>     private boolean fullService;
>     private boolean noBack;
>     private boolean validEmails;
>     private boolean validSample;
>     private String url;
>     private String urlParamName; 
>     private String urlParam2Name; 
>     private String fakeUserId;
>     private String fakeUserId2;
>     private String returnURLParamName;
>     private String returnURLComplete;
>     private String returnURLScreenOut;
>     private String returnURLQuotaFull;
>     private int keyType = KeyTypes.KEY_TYPE_TOLUNA;
>     private String keyPattern;
>     private String keyLastValue;
>     private Long quotasPanelists;
> 	
> public abstract class ASObject implements Serializable {
> 	protected long id;
> 	protected String name;
> 	protected String description;
> 	protected long guid;
> 	protected Date creationDate;
> 	protected Date modificationDate;
> 	protected Date lockingDate;
> 	protected boolean deleted;
> 	protected int sharingType;
> 	protected int versionNumber;
> 	protected String versionComment;
> 	protected boolean last;
> 	protected ASObject prevVersion;
> 	protected User user;
> 	protected User versionCreatingUser;
> 	protected User versionModifyingUser;
> 	protected User lockingUser;
> 	
> Do you have any solution?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message