You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Leonardo K. Shikida" <sh...@gmail.com> on 2015/11/17 18:16:50 UTC

Doubt about eclipse-generated SOAP Client

Hi

I've used eclipse to generate a SOAP client using axis 1.

This procedure usually works well, but for Oracle OIM, which exposes its
Task API via SOAP, I am facing a specific problem so I'd like to know if
you guys can help me on that.

What it seems to be the problem is that the Oracle OIM WSDL declares a
response to a method that contains a XML element called "payload".

This XML element can contain arbitrary XML which is not declared in the
WSDL. The payload element is mapped by Axis as a "java.lang.Object" and
declared internally as "anyType".

The problem it seems, is that Axis tries to parse the contents of this
payload element and returns an error saying that the element is unknown.

For example, the response XML looks like this

<tag>
<known tag1>some value here</known tag1>
<payload>
<unknown tag1>some other value</unknown tag1>
</payload>
<known tag2>some value here</known tag2>
</tag>

So for some reason, Axis tries to parse "unknown tag1" and since it's not
declared anywhere (probably because the WSDL does not does so), it fails
like this

org.xml.sax.SAXException: Invalid element in
com.xyz.oim.client.taskserviceport.task.Task - EntityKey
    at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
    at
org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
    at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
    at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.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
com.xyz.oim.client.taskserviceport.taskService.TaskServiceSOAPBindingStub.updateTaskOutcome(TaskServiceSOAPBindingStub.java:8515)
    at
com.xyz.test.TaskServicePortTestClient.main(TaskServicePortTestClient.java:24)

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: org.xml.sax.SAXException: Invalid element in
com.xyz.oim.client.taskserviceport.task.Task - EntityKey
 faultActor:
 faultNode:
 faultDetail:
    {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException:
Invalid element in com.xyz.oim.client.taskserviceport.task.Task - EntityKey
    at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
    at
org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
    at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
    at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.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
com.xyz.oim.client.taskserviceport.taskService.TaskServiceSOAPBindingStub.updateTaskOutcome(TaskServiceSOAPBindingStub.java:8515)
    at
com.xyz.test.TaskServicePortTestClient.main(TaskServicePortTestClient.java:24)

    {http://xml.apache.org/axis/}hostname:68G1ZR1

org.xml.sax.SAXException: Invalid element in
com.xyz.oim.client.taskserviceport.task.Task - EntityKey
    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
com.xyz.oim.client.taskserviceport.taskService.TaskServiceSOAPBindingStub.updateTaskOutcome(TaskServiceSOAPBindingStub.java:8515)
    at
com.xyz.test.TaskServicePortTestClient.main(TaskServicePortTestClient.java:24)
Caused by: org.xml.sax.SAXException: Invalid element in
com.xyz.oim.client.taskserviceport.task.Task - EntityKey
    at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
    at
org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
    at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
    at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.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)
    ... 4 more


I've done some research trying to find  away to ignore the contents of
"payload", or manually including the "payload" contents into the parent XML
structure, but my feeling is that something is not right, or even if it was
possible to modify the XML inside the Axis parser.

Any help is very welcome.

TIA

Leo