• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

saxexception-invalid element

 
sasank ch
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am created webservice client using a wsdl (webservice is running on siebel).I have used wsdl2java in eclipse and even tried with stylus.i am successfully able to create client.the problem is when i try to call the webservice from my java application, it gives an error

"saxexception invalid element" .It says it having problem during serialization,

I am calling a webservice method with signature

void activateMember(javaobject,stringholder,stringholder,javaobject);

1st javaobject is again composed on objects , which i will build
stringholders are just java.lang.String
the last javaobject is what webservice fills and sends it back, there seems to be the problem....it says problem during deserialization.please let me know if there are any solutions or workarounds...it would be of greathelp

regards,
sasank.
sasank_ch@rediffmail.com
 
Peer Reynders
Bartender
Posts: 2933
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch sasank,

Please check your private messages.
 
Peer Reynders
Bartender
Posts: 2933
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When diagnosing these type of web service problems it is usually more helpful to show the WSDL and the relevant XML schemas and the HTTP/SOAP request and response captured with TCPMon (Tutorial) with may show malformed requests or XML data � even though the problems could still be in the generated code.
 
sasank ch
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THIS IS THE LOG I GET IN TOMCAT:

Before Webservice Call for activateMember()
Before invoke _call
Nov 7, 2007 8:30:27 AM org.apache.axis.client.Call invoke
SEVERE: Exception:
org.xml.sax.SAXException: Invalid element in nwtdevsieb77.trxadv_eai_enu.TrxAppl
icantResult - MemberId
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeseri
alizer.java:258)
at org.apache.axis.encoding.DeserializationContext.startElement(Deserial
izationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.ja
va:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElemen
t.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at TrxaInboundWebActivation_pkg.TrxaInboundWebActivation_BindingStub.act
ivateMember(TrxaInboundWebActivation_BindingStub.java:257)
at TestActive.main(TestActive.java:79)
axisFaultException::; nested exception is:
org.xml.sax.SAXException: Invalid element in nwtdevsieb77.trxadv_eai_enu
.TrxApplicantResult - MemberId
Exception in thread "main" AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Invalid element in nwtdevsieb77.trxadv_e
ai_enu.TrxApplicantResult - MemberId
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace rg.xml.sax.SAXException: Invali
d element in nwtdevsieb77.trxadv_eai_enu.TrxApplicantResult - MemberId
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeseri
alizer.java:258)
at org.apache.axis.encoding.DeserializationContext.startElement(Deserial
izationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.ja
va:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElemen
t.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at TrxaInboundWebActivation_pkg.TrxaInboundWebActivation_BindingStub.act
ivateMember(TrxaInboundWebActivation_BindingStub.java:257)
at TestActive.main(TestActive.java:79)

{http://xml.apache.org/axis/}hostname:136098-web1

org.xml.sax.SAXException: Invalid element in nwtdevsieb77.trxadv_eai_enu.TrxAppl
icantResult - MemberId
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.client.Call.invoke(Call.java:2470)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at TrxaInboundWebActivation_pkg.TrxaInboundWebActivation_BindingStub.act
ivateMember(TrxaInboundWebActivation_BindingStub.java:257)
at TestActive.main(TestActive.java:79)
Caused by: org.xml.sax.SAXException: Invalid element in nwtdevsieb77.trxadv_eai_
enu.TrxApplicantResult - MemberId
at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeseri
alizer.java:258)
at org.apache.axis.encoding.DeserializationContext.startElement(Deserial
izationContext.java:1035)
at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.ja
va:165)
at org.apache.axis.message.MessageElement.publishToHandler(MessageElemen
t.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
 
Peer Reynders
Bartender
Posts: 2933
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please see:

Empty Namespace in SOAP (Axis 1.4)
old dog learning ---wsdl problem

for examples of what I was talking about.
 
sasank ch
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i got the solution for my problem , here it goes:

In my problem , my webservice client was sending an empty object which will be filled by webservice with the required information , but the problem was webservice was filling the data for which (datatypes) were not matching with the expected return type, hence it was giving the exception invalid element and unable to deserialize...so what i did is , i used the tool stylus to test the webservice , it worked just fine and in the return i saw the change in the datatype and changed my webservice client code manually (note :i used wsdl2java tool to generate webserviceclient)to match the datatypes and it worked just fine with my java code in my application. Hope this helps someone, All the best !!!
 
shajid basha
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peer,

Please can you help me on the below link topic:

http://www.coderanch.com/t/449487/Web-Services/java/org-xml-sax-SAXException-Invalid

Thanks,
Shajid
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic