English 中文(简体)
2. 无类型反应
原标题:Apache Axis response without type

我有一个使用轴线的网络服务客户。 它使用文件/文体,本应无效,但服务器坚持在肥皂体内发出头盔反应如下:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <SOAP-ENV:Code>
            <SOAP-ENV:Value>HTTP/1.1 200 OK</SOAP-ENV:Value>
        </SOAP-ENV:Code>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

当然,客户在提出帝国例外情形如下:

AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
 faultActor: 
 faultNode: 
 faultDetail: 
    {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
    at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
    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)

Is there a way to bypass this exception instead of using invokeOneWay function (which is not a good way I suppose)?

最佳回答

通过增加产出信息来予以解决。

<xsd:element name="Code" type="codeDT" />
<xsd:complexType name="codeDT">
    <xsd:sequence>
        <xsd:any />
    </xsd:sequence>
</xsd:complexType>
...
<wsdl:message name="Code">
    <wsdl:documentation />
    <wsdl:part name="Code" element="p1:Code" />
</wsdl:message>

Just changing return type AXIS_VOID to SOAP_ELEMENT inside stub works fine but oh well; this way I can get what s inside of value tag even though I don t need it.

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签