You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "adam (JIRA)" <ji...@apache.org> on 2007/10/08 15:29:50 UTC
[jira] Created: (AXIS2-3252) Unexpected subelement
Unexpected subelement
----------------------
Key: AXIS2-3252
URL: https://issues.apache.org/jira/browse/AXIS2-3252
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Affects Versions: 1.2
Reporter: adam
Priority: Critical
Hi,
I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
Exception *****************:
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
... 2 more
The class that i make from it the web service :
package com.cliniccruise.ws;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.MethodDescriptor;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Iterator;
import com.cliniccruise.vo.main.medicine.FormVO;
import com.cliniccruise.vo.main.medicine.MedicineVO;
import com.cliniccruise.vo.main.medicine.MedicineWVO;
import com.spectraflare.core.app.logging.SpectraLogger;
import com.spectraflare.core.app.logging.SpectraLoggerFactory;
import com.spectraflare.core.app.util.Util;
import com.spectraflare.core.vo.MainObject;
public class MainClassForWS
{
static SpectraLogger logger = SpectraLoggerFactory.getApplicationLogger(MainObject.class);
public MedicineWVO sendMedicenObjetct(String discription)
{
FormVO formVO = new FormVO(1244, "myForm");
MedicineVO medicineVO = new MedicineVO(1515, "eyeLight", formVO);
medicineVO.setOwnerCompanyName("natural");
medicineVO.setAccessories(true);
medicineVO.setDescription(discription);
MedicineWVO medicineWVO = new MedicineWVO();
try
{
this.clone(medicineVO, medicineWVO);
}
catch (Throwable e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("discription ....... " + discription);
return medicineWVO;
}
protected void clone(MainObject object,MedicineWVO medicineWVO) throws Throwable
{
try
{
// introspect object
BeanInfo beanInfo = Introspector.getBeanInfo(object.getClass(), Introspector.USE_ALL_BEANINFO);
MethodDescriptor[] methodDescriptors = beanInfo.getMethodDescriptors();
for (int i = 0; i < methodDescriptors.length; i++)
{
Method method = methodDescriptors[i].getMethod();
String methodName = method.getName();
if (!(methodName.startsWith("get") || methodName.startsWith("is")))
continue;
// method is getter
if (method.getParameterTypes().length > 0)
continue;
if (method.getName().equals("getAnotherCopy"))
continue;
// get field name, value and type
Object fieldValue = method.invoke(object, (Object[]) null);
String fieldName = null;
if (methodName.startsWith("get"))
fieldName = methodName.substring(3);
else if (methodName.startsWith("is"))
fieldName = methodName.substring(2);
Class srcClass = method.getReturnType();
// prepare setter method for this main object
String destSetterName = "set" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
Method destSetterMethod = null;
// in case field is collection
if (fieldValue instanceof Collection)
{
int collectionSize = ((Collection) fieldValue).size();
if (collectionSize <= 0)
continue;
// get type of first element in collection
Class elementType = ((Collection) fieldValue).iterator().next().getClass();
Object paramArray = Array.newInstance(elementType, collectionSize);
try
{
destSetterMethod = medicineWVO.getClass().getMethod(destSetterName, paramArray.getClass());
}
// if no setter found, ignore
catch (NoSuchMethodException e)
{
logger.info("could not find setter method " + destSetterName + " in class " + medicineWVO.getClass());
continue;
}
// copy fieldValue collection to array
int j = 0;
for (Iterator iterator = ((Collection) fieldValue).iterator(); iterator.hasNext(); j++)
((Object[]) paramArray)[j] = iterator.next();
// invoke setter method
destSetterMethod.invoke(medicineWVO, paramArray);
}
// in case field is not collection
else
{
try
{
// in case field is vo containing collection
if (fieldValue instanceof MainObject && Util.classContainsCollection(srcClass))
{
// get wrapper class
String srcClassName = srcClass.getName();
String wrapperName = srcClassName.substring(0, srcClassName.indexOf("VO")) + "WVO";
Class wrapperClass = Class.forName(wrapperName);
// get wrapper constructor that receives vo
Constructor wrapperConstructor = wrapperClass.getConstructor(new Class[]
{ srcClass });
// instaniate wrapper class
fieldValue = wrapperConstructor.newInstance(new Object[]
{ fieldValue });
destSetterMethod = medicineWVO.getClass().getMethod(destSetterName, wrapperClass);
}
else
{
destSetterMethod = medicineWVO.getClass().getMethod(destSetterName, srcClass);
}
}
// if no setter found, ignore
catch (NoSuchMethodException e)
{
logger.info("could not find setter method " + destSetterName + " in class " + medicineWVO.getClass());
continue;
}
// invoke setter method
destSetterMethod.invoke(medicineWVO, fieldValue);
}
}
}
catch (Throwable e)
{
throw e;
}
}
}
and my client test is :
package com.cliniccruise.ws;
import java.rmi.RemoteException;
import org.apache.axis2.AxisFault;
import com.cliniccruise.vo.main.medicine.MedicineWVO;
import com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.SendMedicenObjetct;
import com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.SendMedicenObjetctResponse;
public class WSClient
{
public static void main(String[] args)
{
try
{
MainClassForWSMainClassForWSSOAP11Port_httpStub stub = new MainClassForWSMainClassForWSSOAP11Port_httpStub();
SendMedicenObjetct medicenObjetct = new SendMedicenObjetct();
medicenObjetct.setDiscription("Good Medicine For Eye");
SendMedicenObjetctResponse res = stub.sendMedicenObjetct(medicenObjetct);
com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.MedicineWVO medicineWVO = res.get_return();
System.out.println("Medicine return object : " + medicineWVO);
System.out.println("finishing");
}
catch (AxisFault e)
{
e.printStackTrace();
}
catch (RemoteException e)
{
e.printStackTrace();
}
}
}
and i think the following class you will need it :
/*
* Created on Nov 25, 2005 To change the template for this generated file go to Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.cliniccruise.vo.main.medicine;
import com.cliniccruise.vo.main.LanguageVO;
import com.cliniccruise.vo.relation.disease.DiseaseMedicineVO;
import com.cliniccruise.vo.relation.medicine.MedicineActiveConstVO;
import com.cliniccruise.vo.relation.medicine.MedicineCategoryVO;
import com.cliniccruise.vo.relation.medicine.MedicineNutritionVO;
import com.cliniccruise.vo.relation.medicine.MedicinePhotoVO;
import com.cliniccruise.vo.relation.medicine.RelatedMedicineAdministrationVO;
import com.spectraflare.core.app.logging.SpectraLogger;
import com.spectraflare.core.app.logging.SpectraLoggerFactory;
import com.spectraflare.core.vo.MainObject;
/**
* @author comming_king To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and
* extends MedicineMVO Comments
*/
public class MedicineWVO
{
/**/protected DiseaseMedicineVO[] sideEffectsTree = null;
/**/protected MedicineCategoryVO[] categoriesTree = null;
/**/protected MedicineNutritionVO[] nutritionsTree = null;
/**/protected RelatedMedicineAdministrationVO[] administrationsTree = null;
/**/protected MedicineActiveConstVO[] activeConstituentsTree = null;
/**/private MedicinePriceVO[] priceList = null;
private LanguageVO[] languageList = null;
/**/private MedicinePhotoVO[] photoList = null;
/** medicine VO*/
/** MedicineMVO */
private static final long serialVersionUID = 1L;
protected int formId = -1, ownerCompanyId = -1, medicineId , sizeUnitId = -1;
protected String ownerCompanyName, formName = "", instructions = "", unitName;
protected int packSize = 1;
protected int routeOfAdministration;
protected float size;
protected boolean narcotic, accessories;
/** ObjectVO */
protected int id = -1;
protected int oldId = -1;
protected String name = "", description;
/** MainVO */
static SpectraLogger logger = SpectraLoggerFactory.getApplicationLogger(MainObject.class);
protected String[][] fieldsMaping = null;
public MedicineWVO()
{
super();
}
//
//
// public MedicineWVO(MedicineVO medicineVO) throws Throwable
// {
// this.clone(medicineVO);
// }
//
//
public int getFormId()
{
return formId;
}
public void setFormId(int formId)
{
this.formId = formId;
}
public int getOwnerCompanyId()
{
return ownerCompanyId;
}
public void setOwnerCompanyId(int ownerCompanyId)
{
this.ownerCompanyId = ownerCompanyId;
}
public int getMedicineId()
{
return medicineId;
}
public void setMedicineId(int medicineId)
{
this.medicineId = medicineId;
}
public int getSizeUnitId()
{
return sizeUnitId;
}
public void setSizeUnitId(int sizeUnitId)
{
this.sizeUnitId = sizeUnitId;
}
public String getOwnerCompanyName()
{
return ownerCompanyName;
}
public void setOwnerCompanyName(String ownerCompanyName)
{
this.ownerCompanyName = ownerCompanyName;
}
public String getFormName()
{
return formName;
}
public void setFormName(String formName)
{
this.formName = formName;
}
public String getInstructions()
{
return instructions;
}
public void setInstructions(String instructions)
{
this.instructions = instructions;
}
public String getUnitName()
{
return unitName;
}
public void setUnitName(String unitName)
{
this.unitName = unitName;
}
public int getPackSize()
{
return packSize;
}
public void setPackSize(int packSize)
{
this.packSize = packSize;
}
public int getRouteOfAdministration()
{
return routeOfAdministration;
}
public void setRouteOfAdministration(int routeOfAdministration)
{
this.routeOfAdministration = routeOfAdministration;
}
public float getSize()
{
return size;
}
public void setSize(float size)
{
this.size = size;
}
public boolean isNarcotic()
{
return narcotic;
}
public void setNarcotic(boolean narcotic)
{
this.narcotic = narcotic;
}
public boolean isAccessories()
{
return accessories;
}
public void setAccessories(boolean accessories)
{
this.accessories = accessories;
}
public int getId()
{
return id;
}
public void setId(int id)
{
this.id = id;
}
public int getOldId()
{
return oldId;
}
public void setOldId(int oldId)
{
this.oldId = oldId;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
public static SpectraLogger getLogger()
{
return logger;
}
public static void setLogger(SpectraLogger logger)
{
MedicineWVO.logger = logger;
}
public String[][] getFieldsMaping()
{
return fieldsMaping;
}
public void setFieldsMaping(String[][] fieldsMaping)
{
this.fieldsMaping = fieldsMaping;
}
public DiseaseMedicineVO[] getSideEffectsTree()
{
return sideEffectsTree;
}
public void setSideEffectsTree(DiseaseMedicineVO[] sideEffectsTree)
{
this.sideEffectsTree = sideEffectsTree;
}
public MedicineCategoryVO[] getCategoriesTree()
{
return categoriesTree;
}
public void setCategoriesTree(MedicineCategoryVO[] categoriesTree)
{
this.categoriesTree = categoriesTree;
}
public MedicineNutritionVO[] getNutritionsTree()
{
return nutritionsTree;
}
public void setNutritionsTree(MedicineNutritionVO[] nutritionsTree)
{
this.nutritionsTree = nutritionsTree;
}
public RelatedMedicineAdministrationVO[] getAdministrationsTree()
{
return administrationsTree;
}
public void setAdministrationsTree(RelatedMedicineAdministrationVO[] administrationsTree)
{
this.administrationsTree = administrationsTree;
}
public MedicineActiveConstVO[] getActiveConstituentsTree()
{
return activeConstituentsTree;
}
public void setActiveConstituentsTree(MedicineActiveConstVO[] activeConstituentsTree)
{
this.activeConstituentsTree = activeConstituentsTree;
}
public MedicinePriceVO[] getPriceList()
{
return priceList;
}
public void setPriceList(MedicinePriceVO[] priceList)
{
this.priceList = priceList;
}
public MedicinePhotoVO[] getPhotoList()
{
return photoList;
}
public void setPhotoList(MedicinePhotoVO[] photoList)
{
this.photoList = photoList;
}
}
So.... i need to know from where this exception come and what causes it.
--
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
[jira] Issue Comment Edited: (AXIS2-3252) Unexpected subelement
Posted by "adam (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533129 ]
adamlee edited comment on AXIS2-3252 at 10/9/07 12:28 AM:
-------------------------------------------------------
all the classes that u need it in the attached zip file
was (Author: adamlee):
all the classes that u need it
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Priority: Critical
> Attachments: the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Commented: (AXIS2-3252) Unexpected subelement
Posted by "Olivier Lamiral (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547801 ]
Olivier Lamiral commented on AXIS2-3252:
----------------------------------------
I forgot to mention that the response is correctly parsed when the java code is generated with Axis1.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, jesperp.zip, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Commented: (AXIS2-3252) Unexpected subelement
Posted by "Jesper Peterson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547700 ]
Jesper Peterson commented on AXIS2-3252:
----------------------------------------
More "unexpected subelement" namespace madness. Same basic issue as Olivier descibes.
My setup is: Axis2-1.3 generated stub talking to perl SOAP server under apache. The wsdl (generated by perl), stub source, response xml and exception are attached as is the xml response from an axis2 server skeleton generated from the same WSDL (which allows the client to work). The attachments are bundled in jesperp.zip.
Is there/should there be a way to make the generated stub less picky about namespace prefixes? In my case reader.getName() (line 2697 of TestStub.java) returns "{urn:TESTWS}createsessionReturn" while the temporary QName is just "createsessionReturn" as is reader.getLocalName().
As far as I can tell the --suppress-prefixes option only applies to the writer.
I've reverted to using the Axis1 generated stub, which works with the perl-based server, where the operation setup looks like this:
oper = new org.apache.axis.description.OperationDesc();
oper.setName("createsession");
oper.setReturnType(new javax.xml.namespace.QName("urn:TESTWS", "createsessionResponseType"));
oper.setReturnClass(TESTWS.CreatesessionResponseType.class);
oper.setReturnQName(new javax.xml.namespace.QName("", "createsessionReturn"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
_operations[2] = oper;
It doesn't seem to expect createsessionReturn to be qualified with the namespace either so the issue seems to be either why the axis2 stub uses reader.getName() rather than getLocalName(), or why do the two methods differ for this WSDL/response.
Hopefully this helps make axis2 deal with a less than ideal world :).
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Commented: (AXIS2-3252) Unexpected subelement
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548534 ]
Amila Chinthaka Suriarachchi commented on AXIS2-3252:
-----------------------------------------------------
check the parse methods.
for each child elements it should have something like this,
if (reader.isStartElement() && new javax.xml.namespace.QName("http//tempuri.org/sample4/types", "param").equals(reader.getName()))
{
java.lang.String content = reader.getElementText();
object.setParam(
org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content));
reader.next();
} // End of if for expected property start element
here this javax.xml.namespace.QName doesn't have a namespace if the schema is given as unqualified and
will have a one if it qualified.
Please check whether you point to the changed wsdl or not.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, jesperp.zip, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Issue Comment Edited: (AXIS2-3252) Unexpected subelement
Posted by "Olivier Lamiral (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546721 ]
olivierll edited comment on AXIS2-3252 at 11/29/07 5:55 AM:
------------------------------------------------------------------
I am getting an Unexpected subelement exception too when the response is parsed by the generated stub. I used the eclipse plugin to generate the client (WSDL2Java).
The error occured at the following line (line 1601, in EnviaSolicitacaoNumeroV1Stub):
while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
--> if (reader.isStartElement()
--> && new javax.xml.namespace.QName("","auditoria").equals(reader.getName())){
object.setAuditoria(Auditoria.Factory.parse(reader));
reader.next();
Debugging the code, reader.getName() evaluates to something like namespaceURI = "br/com/indra/..../Auditoria" and localName = "auditoria". As reader.getName() and the newly created QName are different, the flow is redirected to the else section of the code, where the unexpected element exception is thrown.
You may notice that in the response, the auditoria element contains the aud prefix (<aud:auditoria ...).
If the prefix is removed, this element is parsed correctly.
Another point is that I am not sure if the response is compliant with the definition contained in the wsdl.
WSDL, source code and server response are attached.
Hope it helps, and let me know if you need more info.
Thank you in advance.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Commented: (AXIS2-3252) Unexpected subelement
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547745 ]
Amila Chinthaka Suriarachchi commented on AXIS2-3252:
-----------------------------------------------------
look at you wsdl. in that wsdl sehma is defined like this
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:TESTWS">
here it does not have elementFormDefault="qualified" that means it is elementFormDefault="unqualified".
This means, child elements does not belongs to he schema target namesapce. Lets take the two requests
send by the Axis2 and perl
1. Axis2.
<ns1:createsessionResponse xmlns:ns1="urn:TESTWS">
<createsessionReturn>
<sessionid>foo</sessionid>
<result>0</result>
<result_namespace>core</result_namespace>
</createsessionReturn>
</ns1:createsessionResponse>
here child elements does not have a namespace.
2. perl response.
<createsessionResponse xmlns="urn:TESTWS">
<createsessionReturn>
<result_namespace xsi:type="xsd:string">soap</result_namespace>
<sessionid xsi:type="xsd:string">KFR2A5JH3JZC6LDTVO7L</sessionid>
<result xsi:type="xsd:int">0</result>
</createsessionReturn>
</createsessionResponse>
here child elements also belongs to the same namesapce as top element. which is wrong.
Here if you take the very basic idea of the web services is that the implementation should send the
response as given in the wsdl.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, jesperp.zip, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Commented: (AXIS2-3252) Unexpected subelement
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548527 ]
Amila Chinthaka Suriarachchi commented on AXIS2-3252:
-----------------------------------------------------
hi jesper,
The generated stub would be identical. but the data binding code will be differ. i.e the classes like
CreateSessionResponse. So please retest with the newly generated code with the changed wsdl.
the other thing is here you have to check whether the response comes according to the wsdl or not.
Not whether the other frameworks accept it or not.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, jesperp.zip, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Resolved: (AXIS2-3252) Unexpected subelement
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Amila Chinthaka Suriarachchi resolved AXIS2-3252.
-------------------------------------------------
Resolution: Fixed
This is not an Axis2 issue.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, jesperp.zip, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Commented: (AXIS2-3252) Unexpected subelement
Posted by "Jesper Peterson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548532 ]
Jesper Peterson commented on AXIS2-3252:
----------------------------------------
I run wsdl2java without --unpack-classes so there is only a single stub java file. The generated server skeleton classes (which I don't use) differ but the stub is the same for qualified or not. Is that a code generation bug in Axis2? FYI the args I use for stub generation are just sync and unwrap.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, jesperp.zip, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Updated: (AXIS2-3252) Unexpected subelement
Posted by "adam (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
adam updated AXIS2-3252:
------------------------
Attachment: the classes.rar
all the classes that u need it
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Priority: Critical
> Attachments: the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service :
> package com.cliniccruise.ws;
> import java.beans.BeanInfo;
> import java.beans.Introspector;
> import java.beans.MethodDescriptor;
> import java.lang.reflect.Array;
> import java.lang.reflect.Constructor;
> import java.lang.reflect.Method;
> import java.util.Collection;
> import java.util.Iterator;
> import com.cliniccruise.vo.main.medicine.FormVO;
> import com.cliniccruise.vo.main.medicine.MedicineVO;
> import com.cliniccruise.vo.main.medicine.MedicineWVO;
> import com.spectraflare.core.app.logging.SpectraLogger;
> import com.spectraflare.core.app.logging.SpectraLoggerFactory;
> import com.spectraflare.core.app.util.Util;
> import com.spectraflare.core.vo.MainObject;
> public class MainClassForWS
> {
> static SpectraLogger logger = SpectraLoggerFactory.getApplicationLogger(MainObject.class);
> public MedicineWVO sendMedicenObjetct(String discription)
> {
> FormVO formVO = new FormVO(1244, "myForm");
> MedicineVO medicineVO = new MedicineVO(1515, "eyeLight", formVO);
> medicineVO.setOwnerCompanyName("natural");
> medicineVO.setAccessories(true);
> medicineVO.setDescription(discription);
> MedicineWVO medicineWVO = new MedicineWVO();
> try
> {
> this.clone(medicineVO, medicineWVO);
> }
> catch (Throwable e)
> {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> System.out.println("discription ....... " + discription);
> return medicineWVO;
> }
> protected void clone(MainObject object,MedicineWVO medicineWVO) throws Throwable
> {
> try
> {
> // introspect object
> BeanInfo beanInfo = Introspector.getBeanInfo(object.getClass(), Introspector.USE_ALL_BEANINFO);
> MethodDescriptor[] methodDescriptors = beanInfo.getMethodDescriptors();
> for (int i = 0; i < methodDescriptors.length; i++)
> {
> Method method = methodDescriptors[i].getMethod();
> String methodName = method.getName();
> if (!(methodName.startsWith("get") || methodName.startsWith("is")))
> continue;
> // method is getter
> if (method.getParameterTypes().length > 0)
> continue;
> if (method.getName().equals("getAnotherCopy"))
> continue;
> // get field name, value and type
> Object fieldValue = method.invoke(object, (Object[]) null);
> String fieldName = null;
> if (methodName.startsWith("get"))
> fieldName = methodName.substring(3);
> else if (methodName.startsWith("is"))
> fieldName = methodName.substring(2);
> Class srcClass = method.getReturnType();
> // prepare setter method for this main object
> String destSetterName = "set" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
> Method destSetterMethod = null;
> // in case field is collection
> if (fieldValue instanceof Collection)
> {
> int collectionSize = ((Collection) fieldValue).size();
> if (collectionSize <= 0)
> continue;
> // get type of first element in collection
> Class elementType = ((Collection) fieldValue).iterator().next().getClass();
> Object paramArray = Array.newInstance(elementType, collectionSize);
> try
> {
> destSetterMethod = medicineWVO.getClass().getMethod(destSetterName, paramArray.getClass());
> }
> // if no setter found, ignore
> catch (NoSuchMethodException e)
> {
> logger.info("could not find setter method " + destSetterName + " in class " + medicineWVO.getClass());
> continue;
> }
> // copy fieldValue collection to array
> int j = 0;
> for (Iterator iterator = ((Collection) fieldValue).iterator(); iterator.hasNext(); j++)
> ((Object[]) paramArray)[j] = iterator.next();
> // invoke setter method
> destSetterMethod.invoke(medicineWVO, paramArray);
> }
> // in case field is not collection
> else
> {
> try
> {
> // in case field is vo containing collection
> if (fieldValue instanceof MainObject && Util.classContainsCollection(srcClass))
> {
> // get wrapper class
> String srcClassName = srcClass.getName();
> String wrapperName = srcClassName.substring(0, srcClassName.indexOf("VO")) + "WVO";
> Class wrapperClass = Class.forName(wrapperName);
> // get wrapper constructor that receives vo
> Constructor wrapperConstructor = wrapperClass.getConstructor(new Class[]
> { srcClass });
> // instaniate wrapper class
> fieldValue = wrapperConstructor.newInstance(new Object[]
> { fieldValue });
> destSetterMethod = medicineWVO.getClass().getMethod(destSetterName, wrapperClass);
> }
> else
> {
> destSetterMethod = medicineWVO.getClass().getMethod(destSetterName, srcClass);
> }
> }
> // if no setter found, ignore
> catch (NoSuchMethodException e)
> {
> logger.info("could not find setter method " + destSetterName + " in class " + medicineWVO.getClass());
> continue;
> }
> // invoke setter method
> destSetterMethod.invoke(medicineWVO, fieldValue);
> }
> }
> }
> catch (Throwable e)
> {
> throw e;
> }
> }
> }
> and my client test is :
> package com.cliniccruise.ws;
> import java.rmi.RemoteException;
> import org.apache.axis2.AxisFault;
> import com.cliniccruise.vo.main.medicine.MedicineWVO;
> import com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.SendMedicenObjetct;
> import com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.SendMedicenObjetctResponse;
> public class WSClient
> {
> public static void main(String[] args)
> {
> try
> {
> MainClassForWSMainClassForWSSOAP11Port_httpStub stub = new MainClassForWSMainClassForWSSOAP11Port_httpStub();
> SendMedicenObjetct medicenObjetct = new SendMedicenObjetct();
> medicenObjetct.setDiscription("Good Medicine For Eye");
> SendMedicenObjetctResponse res = stub.sendMedicenObjetct(medicenObjetct);
> com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.MedicineWVO medicineWVO = res.get_return();
>
> System.out.println("Medicine return object : " + medicineWVO);
> System.out.println("finishing");
> }
> catch (AxisFault e)
> {
> e.printStackTrace();
> }
> catch (RemoteException e)
> {
> e.printStackTrace();
> }
> }
> }
> and i think the following class you will need it :
> /*
> * Created on Nov 25, 2005 To change the template for this generated file go to Window>Preferences>Java>Code Generation>Code and Comments
> */
> package com.cliniccruise.vo.main.medicine;
> import com.cliniccruise.vo.main.LanguageVO;
> import com.cliniccruise.vo.relation.disease.DiseaseMedicineVO;
> import com.cliniccruise.vo.relation.medicine.MedicineActiveConstVO;
> import com.cliniccruise.vo.relation.medicine.MedicineCategoryVO;
> import com.cliniccruise.vo.relation.medicine.MedicineNutritionVO;
> import com.cliniccruise.vo.relation.medicine.MedicinePhotoVO;
> import com.cliniccruise.vo.relation.medicine.RelatedMedicineAdministrationVO;
> import com.spectraflare.core.app.logging.SpectraLogger;
> import com.spectraflare.core.app.logging.SpectraLoggerFactory;
> import com.spectraflare.core.vo.MainObject;
> /**
> * @author comming_king To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and
> * extends MedicineMVO Comments
> */
> public class MedicineWVO
> {
> /**/protected DiseaseMedicineVO[] sideEffectsTree = null;
> /**/protected MedicineCategoryVO[] categoriesTree = null;
> /**/protected MedicineNutritionVO[] nutritionsTree = null;
> /**/protected RelatedMedicineAdministrationVO[] administrationsTree = null;
> /**/protected MedicineActiveConstVO[] activeConstituentsTree = null;
> /**/private MedicinePriceVO[] priceList = null;
> private LanguageVO[] languageList = null;
> /**/private MedicinePhotoVO[] photoList = null;
>
> /** medicine VO*/
>
> /** MedicineMVO */
> private static final long serialVersionUID = 1L;
> protected int formId = -1, ownerCompanyId = -1, medicineId , sizeUnitId = -1;
> protected String ownerCompanyName, formName = "", instructions = "", unitName;
> protected int packSize = 1;
> protected int routeOfAdministration;
> protected float size;
> protected boolean narcotic, accessories;
>
> /** ObjectVO */
> protected int id = -1;
> protected int oldId = -1;
> protected String name = "", description;
> /** MainVO */
> static SpectraLogger logger = SpectraLoggerFactory.getApplicationLogger(MainObject.class);
> protected String[][] fieldsMaping = null;
>
> public MedicineWVO()
> {
> super();
> }
> //
> //
> // public MedicineWVO(MedicineVO medicineVO) throws Throwable
> // {
> // this.clone(medicineVO);
> // }
> //
> //
>
> public int getFormId()
> {
> return formId;
> }
> public void setFormId(int formId)
> {
> this.formId = formId;
> }
> public int getOwnerCompanyId()
> {
> return ownerCompanyId;
> }
> public void setOwnerCompanyId(int ownerCompanyId)
> {
> this.ownerCompanyId = ownerCompanyId;
> }
> public int getMedicineId()
> {
> return medicineId;
> }
> public void setMedicineId(int medicineId)
> {
> this.medicineId = medicineId;
> }
> public int getSizeUnitId()
> {
> return sizeUnitId;
> }
> public void setSizeUnitId(int sizeUnitId)
> {
> this.sizeUnitId = sizeUnitId;
> }
> public String getOwnerCompanyName()
> {
> return ownerCompanyName;
> }
> public void setOwnerCompanyName(String ownerCompanyName)
> {
> this.ownerCompanyName = ownerCompanyName;
> }
> public String getFormName()
> {
> return formName;
> }
> public void setFormName(String formName)
> {
> this.formName = formName;
> }
> public String getInstructions()
> {
> return instructions;
> }
> public void setInstructions(String instructions)
> {
> this.instructions = instructions;
> }
> public String getUnitName()
> {
> return unitName;
> }
> public void setUnitName(String unitName)
> {
> this.unitName = unitName;
> }
> public int getPackSize()
> {
> return packSize;
> }
> public void setPackSize(int packSize)
> {
> this.packSize = packSize;
> }
> public int getRouteOfAdministration()
> {
> return routeOfAdministration;
> }
> public void setRouteOfAdministration(int routeOfAdministration)
> {
> this.routeOfAdministration = routeOfAdministration;
> }
> public float getSize()
> {
> return size;
> }
> public void setSize(float size)
> {
> this.size = size;
> }
> public boolean isNarcotic()
> {
> return narcotic;
> }
> public void setNarcotic(boolean narcotic)
> {
> this.narcotic = narcotic;
> }
> public boolean isAccessories()
> {
> return accessories;
> }
> public void setAccessories(boolean accessories)
> {
> this.accessories = accessories;
> }
> public int getId()
> {
> return id;
> }
> public void setId(int id)
> {
> this.id = id;
> }
> public int getOldId()
> {
> return oldId;
> }
> public void setOldId(int oldId)
> {
> this.oldId = oldId;
> }
> public String getName()
> {
> return name;
> }
> public void setName(String name)
> {
> this.name = name;
> }
> public String getDescription()
> {
> return description;
> }
> public void setDescription(String description)
> {
> this.description = description;
> }
> public static SpectraLogger getLogger()
> {
> return logger;
> }
> public static void setLogger(SpectraLogger logger)
> {
> MedicineWVO.logger = logger;
> }
> public String[][] getFieldsMaping()
> {
> return fieldsMaping;
> }
> public void setFieldsMaping(String[][] fieldsMaping)
> {
> this.fieldsMaping = fieldsMaping;
> }
> public DiseaseMedicineVO[] getSideEffectsTree()
> {
> return sideEffectsTree;
> }
> public void setSideEffectsTree(DiseaseMedicineVO[] sideEffectsTree)
> {
> this.sideEffectsTree = sideEffectsTree;
> }
> public MedicineCategoryVO[] getCategoriesTree()
> {
> return categoriesTree;
> }
> public void setCategoriesTree(MedicineCategoryVO[] categoriesTree)
> {
> this.categoriesTree = categoriesTree;
> }
> public MedicineNutritionVO[] getNutritionsTree()
> {
> return nutritionsTree;
> }
> public void setNutritionsTree(MedicineNutritionVO[] nutritionsTree)
> {
> this.nutritionsTree = nutritionsTree;
> }
> public RelatedMedicineAdministrationVO[] getAdministrationsTree()
> {
> return administrationsTree;
> }
> public void setAdministrationsTree(RelatedMedicineAdministrationVO[] administrationsTree)
> {
> this.administrationsTree = administrationsTree;
> }
> public MedicineActiveConstVO[] getActiveConstituentsTree()
> {
> return activeConstituentsTree;
> }
> public void setActiveConstituentsTree(MedicineActiveConstVO[] activeConstituentsTree)
> {
> this.activeConstituentsTree = activeConstituentsTree;
> }
> public MedicinePriceVO[] getPriceList()
> {
> return priceList;
> }
> public void setPriceList(MedicinePriceVO[] priceList)
> {
> this.priceList = priceList;
> }
> public MedicinePhotoVO[] getPhotoList()
> {
> return photoList;
> }
> public void setPhotoList(MedicinePhotoVO[] photoList)
> {
> this.photoList = photoList;
> }
> }
> So.... i need to know from where this exception come and what causes it.
--
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
[jira] Assigned: (AXIS2-3252) Unexpected subelement
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Amila Chinthaka Suriarachchi reassigned AXIS2-3252:
---------------------------------------------------
Assignee: Amila Chinthaka Suriarachchi
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Commented: (AXIS2-3252) Unexpected subelement
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548533 ]
Amila Chinthaka Suriarachchi commented on AXIS2-3252:
-----------------------------------------------------
hi olivier,
Sorry earlier I thought src.zip is a part of jespers request.
I looked at it. as you have mentioned this is a wrong xml.
Look here,
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:env="br/com/vivo/sigan/schema/interface5/envio/EnviaSolicitacaoNumeroXMLEntrada"
xmlns:open="http://www.openuri.org/"/>
<soapenv:Body>
<open:enviaSolicitacaoNumeroXMLEntradaResponse>
<env:enviaSolicitacaoNumeroXMLSaida
xmlns:env="br/com/vivo/sigan/integracao/schema/interface5/envio/EnviaSolicitacaoNumeroXMLSaida">
here the two prefixes env and open is declared in Header element and it is used in body element. This element prefix declarations should goes
to the element it self or to a parent element.
And also this has the problem I mentioned for jespers request. these schemas do not have element elementFormDefault="unqualified" part.
i.e they child elements supposed not to be in the parent namespace.
that is why the request parse correctly when you remove the aud prefix.
it seems that the response message produces by the perl has a lot of problems. Please report them at their jira.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, jesperp.zip, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Commented: (AXIS2-3252) Unexpected subelement
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12533254 ]
Amila Chinthaka Suriarachchi commented on AXIS2-3252:
-----------------------------------------------------
First of all Can you test this with Axis2 1.3?
How you create your service? Are you invoking a service written in Axis2 or any other framework?
Can you send a zip file with your wsdl and request and response messages as well?
as I can see the cause for this problem is that your response message does not match with the schema.
it seems there is a missing required element before the element medicineId.
please check around the xml (near the element medicineId) and see whether you getting all the required
elements.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Priority: Critical
> Attachments: the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Issue Comment Edited: (AXIS2-3252) Unexpected subelement
Posted by "Olivier Lamiral (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546721 ]
olivierll edited comment on AXIS2-3252 at 11/29/07 5:57 AM:
------------------------------------------------------------------
I am getting an Unexpected subelement exception too when the response is parsed by the generated stub. I used the eclipse plugin to generate the client (WSDL2Java).
The error occured at the following line (line 1601, in EnviaSolicitacaoNumeroV1Stub):
while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
--> if (reader.isStartElement()
--> && new javax.xml.namespace.QName("","auditoria").equals(reader.getName())){
object.setAuditoria(Auditoria.Factory.parse(reader));
reader.next();
Debugging the code, reader.getName() evaluates to something like namespaceURI = "br/com/indra/..../Auditoria" and localName = "auditoria". As reader.getName() and the newly created QName are different, the flow is redirected to the else section of the code, where the unexpected element exception is thrown.
You may notice that in the response, the auditoria element contains the aud prefix (<aud:auditoria ...).
If the prefix is removed, this element is parsed correctly.
Another point is that I am not sure if the response is compliant with the definition contained in the wsdl.
WSDL, source code and server response are attached.
Hope it helps, and let me know if you need more info.
Thank you in advance.
(I am using Axis2-1.3)
was (Author: olivierll):
I am getting an Unexpected subelement exception too when the response is parsed by the generated stub. I used the eclipse plugin to generate the client (WSDL2Java).
The error occured at the following line (line 1601, in EnviaSolicitacaoNumeroV1Stub):
while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
--> if (reader.isStartElement()
--> && new javax.xml.namespace.QName("","auditoria").equals(reader.getName())){
object.setAuditoria(Auditoria.Factory.parse(reader));
reader.next();
Debugging the code, reader.getName() evaluates to something like namespaceURI = "br/com/indra/..../Auditoria" and localName = "auditoria". As reader.getName() and the newly created QName are different, the flow is redirected to the else section of the code, where the unexpected element exception is thrown.
You may notice that in the response, the auditoria element contains the aud prefix (<aud:auditoria ...).
If the prefix is removed, this element is parsed correctly.
Another point is that I am not sure if the response is compliant with the definition contained in the wsdl.
WSDL, source code and server response are attached.
Hope it helps, and let me know if you need more info.
Thank you in advance.
(I am using Axis2-1.3, and debugged using Axis2-SNAPSHOT)
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Issue Comment Edited: (AXIS2-3252) Unexpected subelement
Posted by "Olivier Lamiral (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546721 ]
olivierll edited comment on AXIS2-3252 at 11/29/07 5:57 AM:
------------------------------------------------------------------
I am getting an Unexpected subelement exception too when the response is parsed by the generated stub. I used the eclipse plugin to generate the client (WSDL2Java).
The error occured at the following line (line 1601, in EnviaSolicitacaoNumeroV1Stub):
while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
--> if (reader.isStartElement()
--> && new javax.xml.namespace.QName("","auditoria").equals(reader.getName())){
object.setAuditoria(Auditoria.Factory.parse(reader));
reader.next();
Debugging the code, reader.getName() evaluates to something like namespaceURI = "br/com/indra/..../Auditoria" and localName = "auditoria". As reader.getName() and the newly created QName are different, the flow is redirected to the else section of the code, where the unexpected element exception is thrown.
You may notice that in the response, the auditoria element contains the aud prefix (<aud:auditoria ...).
If the prefix is removed, this element is parsed correctly.
Another point is that I am not sure if the response is compliant with the definition contained in the wsdl.
WSDL, source code and server response are attached.
Hope it helps, and let me know if you need more info.
Thank you in advance.
(I am using Axis2-1.3, and debugged using Axis2-SNAPSHOT)
was (Author: olivierll):
I am getting an Unexpected subelement exception too when the response is parsed by the generated stub. I used the eclipse plugin to generate the client (WSDL2Java).
The error occured at the following line (line 1601, in EnviaSolicitacaoNumeroV1Stub):
while (!reader.isStartElement() && !reader.isEndElement()) reader.next();
--> if (reader.isStartElement()
--> && new javax.xml.namespace.QName("","auditoria").equals(reader.getName())){
object.setAuditoria(Auditoria.Factory.parse(reader));
reader.next();
Debugging the code, reader.getName() evaluates to something like namespaceURI = "br/com/indra/..../Auditoria" and localName = "auditoria". As reader.getName() and the newly created QName are different, the flow is redirected to the else section of the code, where the unexpected element exception is thrown.
You may notice that in the response, the auditoria element contains the aud prefix (<aud:auditoria ...).
If the prefix is removed, this element is parsed correctly.
Another point is that I am not sure if the response is compliant with the definition contained in the wsdl.
WSDL, source code and server response are attached.
Hope it helps, and let me know if you need more info.
Thank you in advance.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Commented: (AXIS2-3252) Unexpected subelement
Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540357 ]
Amila Chinthaka Suriarachchi commented on AXIS2-3252:
-----------------------------------------------------
I can not unzip the .rar file. please send a .zip file
can you send your generated wsdl file and the response message?
please check whether wsdl and recievied response is matched or not.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Updated: (AXIS2-3252) Unexpected subelement
Posted by "adam (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
adam updated AXIS2-3252:
------------------------
Description:
Hi,
I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
Exception *****************:
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
... 2 more
The class that i make from it the web service is : "MainClassForWS"
and my client test is : "WSClient"
All the class relative to this exception in the attachment file
i need to know from where this exception come and what causes it and what is the solution for it .
Thanks.
M.adam
was:
Hi,
I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
Exception *****************:
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
... 2 more
The class that i make from it the web service :
package com.cliniccruise.ws;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.MethodDescriptor;
import java.lang.reflect.Array;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.Collection;
import java.util.Iterator;
import com.cliniccruise.vo.main.medicine.FormVO;
import com.cliniccruise.vo.main.medicine.MedicineVO;
import com.cliniccruise.vo.main.medicine.MedicineWVO;
import com.spectraflare.core.app.logging.SpectraLogger;
import com.spectraflare.core.app.logging.SpectraLoggerFactory;
import com.spectraflare.core.app.util.Util;
import com.spectraflare.core.vo.MainObject;
public class MainClassForWS
{
static SpectraLogger logger = SpectraLoggerFactory.getApplicationLogger(MainObject.class);
public MedicineWVO sendMedicenObjetct(String discription)
{
FormVO formVO = new FormVO(1244, "myForm");
MedicineVO medicineVO = new MedicineVO(1515, "eyeLight", formVO);
medicineVO.setOwnerCompanyName("natural");
medicineVO.setAccessories(true);
medicineVO.setDescription(discription);
MedicineWVO medicineWVO = new MedicineWVO();
try
{
this.clone(medicineVO, medicineWVO);
}
catch (Throwable e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("discription ....... " + discription);
return medicineWVO;
}
protected void clone(MainObject object,MedicineWVO medicineWVO) throws Throwable
{
try
{
// introspect object
BeanInfo beanInfo = Introspector.getBeanInfo(object.getClass(), Introspector.USE_ALL_BEANINFO);
MethodDescriptor[] methodDescriptors = beanInfo.getMethodDescriptors();
for (int i = 0; i < methodDescriptors.length; i++)
{
Method method = methodDescriptors[i].getMethod();
String methodName = method.getName();
if (!(methodName.startsWith("get") || methodName.startsWith("is")))
continue;
// method is getter
if (method.getParameterTypes().length > 0)
continue;
if (method.getName().equals("getAnotherCopy"))
continue;
// get field name, value and type
Object fieldValue = method.invoke(object, (Object[]) null);
String fieldName = null;
if (methodName.startsWith("get"))
fieldName = methodName.substring(3);
else if (methodName.startsWith("is"))
fieldName = methodName.substring(2);
Class srcClass = method.getReturnType();
// prepare setter method for this main object
String destSetterName = "set" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1);
Method destSetterMethod = null;
// in case field is collection
if (fieldValue instanceof Collection)
{
int collectionSize = ((Collection) fieldValue).size();
if (collectionSize <= 0)
continue;
// get type of first element in collection
Class elementType = ((Collection) fieldValue).iterator().next().getClass();
Object paramArray = Array.newInstance(elementType, collectionSize);
try
{
destSetterMethod = medicineWVO.getClass().getMethod(destSetterName, paramArray.getClass());
}
// if no setter found, ignore
catch (NoSuchMethodException e)
{
logger.info("could not find setter method " + destSetterName + " in class " + medicineWVO.getClass());
continue;
}
// copy fieldValue collection to array
int j = 0;
for (Iterator iterator = ((Collection) fieldValue).iterator(); iterator.hasNext(); j++)
((Object[]) paramArray)[j] = iterator.next();
// invoke setter method
destSetterMethod.invoke(medicineWVO, paramArray);
}
// in case field is not collection
else
{
try
{
// in case field is vo containing collection
if (fieldValue instanceof MainObject && Util.classContainsCollection(srcClass))
{
// get wrapper class
String srcClassName = srcClass.getName();
String wrapperName = srcClassName.substring(0, srcClassName.indexOf("VO")) + "WVO";
Class wrapperClass = Class.forName(wrapperName);
// get wrapper constructor that receives vo
Constructor wrapperConstructor = wrapperClass.getConstructor(new Class[]
{ srcClass });
// instaniate wrapper class
fieldValue = wrapperConstructor.newInstance(new Object[]
{ fieldValue });
destSetterMethod = medicineWVO.getClass().getMethod(destSetterName, wrapperClass);
}
else
{
destSetterMethod = medicineWVO.getClass().getMethod(destSetterName, srcClass);
}
}
// if no setter found, ignore
catch (NoSuchMethodException e)
{
logger.info("could not find setter method " + destSetterName + " in class " + medicineWVO.getClass());
continue;
}
// invoke setter method
destSetterMethod.invoke(medicineWVO, fieldValue);
}
}
}
catch (Throwable e)
{
throw e;
}
}
}
and my client test is :
package com.cliniccruise.ws;
import java.rmi.RemoteException;
import org.apache.axis2.AxisFault;
import com.cliniccruise.vo.main.medicine.MedicineWVO;
import com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.SendMedicenObjetct;
import com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.SendMedicenObjetctResponse;
public class WSClient
{
public static void main(String[] args)
{
try
{
MainClassForWSMainClassForWSSOAP11Port_httpStub stub = new MainClassForWSMainClassForWSSOAP11Port_httpStub();
SendMedicenObjetct medicenObjetct = new SendMedicenObjetct();
medicenObjetct.setDiscription("Good Medicine For Eye");
SendMedicenObjetctResponse res = stub.sendMedicenObjetct(medicenObjetct);
com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.MedicineWVO medicineWVO = res.get_return();
System.out.println("Medicine return object : " + medicineWVO);
System.out.println("finishing");
}
catch (AxisFault e)
{
e.printStackTrace();
}
catch (RemoteException e)
{
e.printStackTrace();
}
}
}
and i think the following class you will need it :
/*
* Created on Nov 25, 2005 To change the template for this generated file go to Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.cliniccruise.vo.main.medicine;
import com.cliniccruise.vo.main.LanguageVO;
import com.cliniccruise.vo.relation.disease.DiseaseMedicineVO;
import com.cliniccruise.vo.relation.medicine.MedicineActiveConstVO;
import com.cliniccruise.vo.relation.medicine.MedicineCategoryVO;
import com.cliniccruise.vo.relation.medicine.MedicineNutritionVO;
import com.cliniccruise.vo.relation.medicine.MedicinePhotoVO;
import com.cliniccruise.vo.relation.medicine.RelatedMedicineAdministrationVO;
import com.spectraflare.core.app.logging.SpectraLogger;
import com.spectraflare.core.app.logging.SpectraLoggerFactory;
import com.spectraflare.core.vo.MainObject;
/**
* @author comming_king To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and
* extends MedicineMVO Comments
*/
public class MedicineWVO
{
/**/protected DiseaseMedicineVO[] sideEffectsTree = null;
/**/protected MedicineCategoryVO[] categoriesTree = null;
/**/protected MedicineNutritionVO[] nutritionsTree = null;
/**/protected RelatedMedicineAdministrationVO[] administrationsTree = null;
/**/protected MedicineActiveConstVO[] activeConstituentsTree = null;
/**/private MedicinePriceVO[] priceList = null;
private LanguageVO[] languageList = null;
/**/private MedicinePhotoVO[] photoList = null;
/** medicine VO*/
/** MedicineMVO */
private static final long serialVersionUID = 1L;
protected int formId = -1, ownerCompanyId = -1, medicineId , sizeUnitId = -1;
protected String ownerCompanyName, formName = "", instructions = "", unitName;
protected int packSize = 1;
protected int routeOfAdministration;
protected float size;
protected boolean narcotic, accessories;
/** ObjectVO */
protected int id = -1;
protected int oldId = -1;
protected String name = "", description;
/** MainVO */
static SpectraLogger logger = SpectraLoggerFactory.getApplicationLogger(MainObject.class);
protected String[][] fieldsMaping = null;
public MedicineWVO()
{
super();
}
//
//
// public MedicineWVO(MedicineVO medicineVO) throws Throwable
// {
// this.clone(medicineVO);
// }
//
//
public int getFormId()
{
return formId;
}
public void setFormId(int formId)
{
this.formId = formId;
}
public int getOwnerCompanyId()
{
return ownerCompanyId;
}
public void setOwnerCompanyId(int ownerCompanyId)
{
this.ownerCompanyId = ownerCompanyId;
}
public int getMedicineId()
{
return medicineId;
}
public void setMedicineId(int medicineId)
{
this.medicineId = medicineId;
}
public int getSizeUnitId()
{
return sizeUnitId;
}
public void setSizeUnitId(int sizeUnitId)
{
this.sizeUnitId = sizeUnitId;
}
public String getOwnerCompanyName()
{
return ownerCompanyName;
}
public void setOwnerCompanyName(String ownerCompanyName)
{
this.ownerCompanyName = ownerCompanyName;
}
public String getFormName()
{
return formName;
}
public void setFormName(String formName)
{
this.formName = formName;
}
public String getInstructions()
{
return instructions;
}
public void setInstructions(String instructions)
{
this.instructions = instructions;
}
public String getUnitName()
{
return unitName;
}
public void setUnitName(String unitName)
{
this.unitName = unitName;
}
public int getPackSize()
{
return packSize;
}
public void setPackSize(int packSize)
{
this.packSize = packSize;
}
public int getRouteOfAdministration()
{
return routeOfAdministration;
}
public void setRouteOfAdministration(int routeOfAdministration)
{
this.routeOfAdministration = routeOfAdministration;
}
public float getSize()
{
return size;
}
public void setSize(float size)
{
this.size = size;
}
public boolean isNarcotic()
{
return narcotic;
}
public void setNarcotic(boolean narcotic)
{
this.narcotic = narcotic;
}
public boolean isAccessories()
{
return accessories;
}
public void setAccessories(boolean accessories)
{
this.accessories = accessories;
}
public int getId()
{
return id;
}
public void setId(int id)
{
this.id = id;
}
public int getOldId()
{
return oldId;
}
public void setOldId(int oldId)
{
this.oldId = oldId;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
public static SpectraLogger getLogger()
{
return logger;
}
public static void setLogger(SpectraLogger logger)
{
MedicineWVO.logger = logger;
}
public String[][] getFieldsMaping()
{
return fieldsMaping;
}
public void setFieldsMaping(String[][] fieldsMaping)
{
this.fieldsMaping = fieldsMaping;
}
public DiseaseMedicineVO[] getSideEffectsTree()
{
return sideEffectsTree;
}
public void setSideEffectsTree(DiseaseMedicineVO[] sideEffectsTree)
{
this.sideEffectsTree = sideEffectsTree;
}
public MedicineCategoryVO[] getCategoriesTree()
{
return categoriesTree;
}
public void setCategoriesTree(MedicineCategoryVO[] categoriesTree)
{
this.categoriesTree = categoriesTree;
}
public MedicineNutritionVO[] getNutritionsTree()
{
return nutritionsTree;
}
public void setNutritionsTree(MedicineNutritionVO[] nutritionsTree)
{
this.nutritionsTree = nutritionsTree;
}
public RelatedMedicineAdministrationVO[] getAdministrationsTree()
{
return administrationsTree;
}
public void setAdministrationsTree(RelatedMedicineAdministrationVO[] administrationsTree)
{
this.administrationsTree = administrationsTree;
}
public MedicineActiveConstVO[] getActiveConstituentsTree()
{
return activeConstituentsTree;
}
public void setActiveConstituentsTree(MedicineActiveConstVO[] activeConstituentsTree)
{
this.activeConstituentsTree = activeConstituentsTree;
}
public MedicinePriceVO[] getPriceList()
{
return priceList;
}
public void setPriceList(MedicinePriceVO[] priceList)
{
this.priceList = priceList;
}
public MedicinePhotoVO[] getPhotoList()
{
return photoList;
}
public void setPhotoList(MedicinePhotoVO[] photoList)
{
this.photoList = photoList;
}
}
So.... i need to know from where this exception come and what causes it.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Priority: Critical
> Attachments: the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Commented: (AXIS2-3252) Unexpected subelement
Posted by "Jesper Peterson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547757 ]
Jesper Peterson commented on AXIS2-3252:
----------------------------------------
Thank you for taking the time to look at this.
Are you saying if the WSDL specified "qualified" for elements then the perl response would be considered correct?
I added elementFormDefault="qualified" to the WSDL schema but the generated Axis2 stub is identical. However the Axis1 stub code changes so the createsessionReturn namespace is now non-empty. See my earlier comment for the Axis1 "unqualified" stub.
oper = new org.apache.axis.description.OperationDesc();
oper.setName("createsession");
oper.setReturnType(new javax.xml.namespace.QName("urn:TESTWS", "createsessionResponseType"));
oper.setReturnClass(TESTWS.CreatesessionResponseType.class);
oper.setReturnQName(new javax.xml.namespace.QName("urn:TESTWS", "createsessionReturn"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
_operations[2] = oper;
So with or without "qualified" the Axis2 stub rejects the perl response and Axis1 accepts it. Only the Axis1 stub has different code for "qualified" .
I accept that the perl WSDL and response in this case are inconsistent but I was hoping to get around it by fixing the WSDL since modifying the perl is not an option in this case.
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, jesperp.zip, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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
[jira] Updated: (AXIS2-3252) Unexpected subelement
Posted by "Jesper Peterson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2-3252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jesper Peterson updated AXIS2-3252:
-----------------------------------
Attachment: jesperp.zip
> Unexpected subelement
> ----------------------
>
> Key: AXIS2-3252
> URL: https://issues.apache.org/jira/browse/AXIS2-3252
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Affects Versions: 1.2
> Reporter: adam
> Assignee: Amila Chinthaka Suriarachchi
> Priority: Critical
> Attachments: classes.rar, jesperp.zip, src.zip, the classes.rar
>
>
> Hi,
> I try to make web service with eclipse and axis2 .. and i recieve the following exception and i don't know what is the casue :
> Exception *****************:
> Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19136)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.sendMedicenObjetct(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:159)
> at com.cliniccruise.ws.WSClient.main(WSClient.java:20)
> Caused by: java.lang.RuntimeException: Unexpected subelement medicineId
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$MedicineWVO$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:14748)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub$SendMedicenObjetctResponse$Factory.parse(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:988)
> at com.cliniccruise.ws.MainClassForWSMainClassForWSSOAP11Port_httpStub.fromOM(MainClassForWSMainClassForWSSOAP11Port_httpStub.java:19130)
> ... 2 more
> The class that i make from it the web service is : "MainClassForWS"
> and my client test is : "WSClient"
> All the class relative to this exception in the attachment file
> i need to know from where this exception come and what causes it and what is the solution for it .
> Thanks.
> M.adam
--
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