Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 272
Registered: ‎05-24-2010
My Device: DEV Alpha C & BB 9720
My Carrier: Idea and Airtel

getting The Element object describing the SOAP fault detail is not available. exception..

javax.xml.rpc.JAXRPCException: java.rmi.MarshalException: The Element object describing the SOAP fault detail is not available.

 

 

here is the code

 

 

Object[] inputObject = new Object[2];
inputObject[0] = arg0;
Object[] organizationSearchCriteriaObject;
if (arg1 == null) {
organizationSearchCriteriaObject = null;
} else {
organizationSearchCriteriaObject = new Object[2];
organizationSearchCriteriaObject[0] = arg1.getOffset();
organizationSearchCriteriaObject[1] = arg1.getOrganizationName();
}
inputObject[1] = organizationSearchCriteriaObject;
Operation op = Operation.newInstance(_qname_locateOrganizations, _type_locateOrganizations, _type_locateOrganizationsResponse, this);
_prepOperation(op);
op.setProperty(Operation.SOAPACTION_URI_PROPERTY, "");
Object resultObj;
try {
resultObj = op.invoke(inputObject);
// i am getting exception here this is working fine in J2ME but in blackberry i am getting exception..
} catch (JAXRPCException e) {
Throwable cause = e.getLinkedCause();
if (cause instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) cause;
} else if (cause instanceof FaultDetailException) {
FaultDetailException fde = (FaultDetailException) cause;
QName fdeName = fde.getFaultDetailName();
if ("MessageFault".equals(fdeName.getLocalPart()) && "http://example.com/".equals(fdeName.getNamespaceURI())) {
java.lang.String message_param;
message_param = (java.lang.String)((Object[])fde.getFaultDetail())[0];
throw new com.example.aa.ws.schema.MessageFault(message_param);
}
}
throw e;
}

 

 

please help me

 

Thanks regards

Yakub Pasha ..

Highlighted
Developer
Posts: 272
Registered: ‎05-24-2010
My Device: DEV Alpha C & BB 9720
My Carrier: Idea and Airtel

Re: getting The Element object describing the SOAP fault detail is not available. exception..

any one please respond adn give me the suggesion ..

 

Developer
Posts: 73
Registered: ‎09-03-2009
My Device: Not Specified

Re: getting The Element object describing the SOAP fault detail is not available. exception..

Whenever you deal with the Web Service from BlackBerry you should make sure that the number of elements you have on a object returned by the Web Service is matching the number of elements in the object that you have in your stub.  Plus their name should match along with their data type.

 

If you're using the WS Client toolkit then you have to regenerate the stubs for BlackBerry and that should take care of this error.

 

Otherwise you will see this error.  I have dealt with this alot and hence i know.  But keep forget why its throwing, I then google and then I realize that I have changed my Web Service object. Smiley Sad

 

Hope, this helps.

 

-Vincent

Contributor
Posts: 14
Registered: ‎11-09-2011
My Device: 8830 4.5 o.s
My Carrier: vodafone

Re: getting The Element object describing the SOAP fault detail is not available. exception..

i am not using "this" in operation...

and i am having the same marshal exception...

what is wrong in my code

  here is my code..

 

public java.lang.String getvideo(java.lang.String videoid) throws java.rmi.RemoteException{
// TODO Auto-generated method stub
Object[] inputObject = new Object[1];

inputObject[0] = videoid;Operation op = Operation.newInstance(_qname_Getvideolist, _type_Getvideoid, _type_Getvideoidresponse);_prepOperation(op);

op.setProperty(Operation.SOAPACTION_URI_PROPERTY, "http://tempuri.org/GetVideoDetails");
Object resultObj;
try {
resultObj = op.invoke(inputObject);
} catch (JAXRPCException e) {
System.out.println("-----------------------------------the get video method---------9------exc------"+e);

//HERE i m getting marshal exception..
Throwable cause = e.getLinkedCause();
System.out.println("-----------------------------------the get video method-----------10----------");
if (cause instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException) cause;

}throw e;

}
java.lang.String result;
// Convert the result into the right Java type.
// Unwrapped return value
Object getLocationListResultObj = ((Object[])resultObj)[0];result = (java.lang.String)getLocationListResultObj;


return result;
}

 

protected static final QName _qname_Getvideolist = new QName("http://tempuri.org/", "GetVideoDetails");
protected static final QName _qname_Getvideolistesponse = new QName("http://tempuri.org/", "GetVideoDetailsResponse");
protected static final QName _qname_GetvideolistResult = new QName("http://tempuri.org/", "GetVideoDetailsResult");

 

protected static final Element _type_Getvideoid;
protected static final Element _type_Getvideoidresponse;

 

 

static {

 

             

Element _type_videoid;
_type_videoid = new Element(_qname_Vdid, Type.STRING, 0, 1, false);
ComplexType _complexType_getVideoResponse;
_complexType_getVideoResponse = new ComplexType();
_complexType_getVideoResponse.elements = new Element[1];
_complexType_getVideoResponse.elements[0] = _type_videoid;
_type_Getvideoid = new Element(_qname_Getvideolist, _complexType_getVideoResponse);


Element _type_GetvieoidResult;
_type_GetvieoidResult = new Element(_qname_GetvideolistResult, Type.STRING, 0, 1, false);
ComplexType _complexType_getVideoidResponse;
_complexType_getVideoidResponse = new ComplexType();
_complexType_getVideoidResponse.elements = new Element[1];
_complexType_getVideoidResponse.elements[0] = _type_GetvieoidResult;
_type_Getvideoidresponse = new Element(_qname_Getvideolistesponse, _complexType_getVideoListResponse);

}