I been having troubles posting this item.
=========================================================
Hi Guys,
I have been working with Axis 1.2 Final and it has been working well on an IBM iSeries machine.
I have started testing on a Windows machine using Java 1.4.2_08 and I am getting the following error: "Content is not allowed in trailing section"
The Agent stub can call the server, the server receives the request and creates the response, the agent receives the response ( I think it does, but it does not get to my response handler to trace the response SOAP message ) and then fails.
I am using Axis 1.2 Final on the agent and server ends.
I have kept the test sample simple, call operation getDesc, pass the dept code and receive the dept description.
String desc = getDesc ( String dept_code )
Request
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getDesc soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://server.soap.mylaptop.com"><dept_code xsi:type="xsd:string">ADM</dept_code></ns1:getDesc></soapenv:Body></soapenv:Envelope>
Response
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:getDescResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://server.soap.mylaptop.com"><ns1:getDescReturn xsi:type="xsd:string">ADMINISTRATOR DEPT</ns1:getDescReturn></ns1:getDescResponse></soapenv:Body></soapenv:Envelope>
I started the test using Java 1.5 and dropped back to 1.4.2_08
I have tried using different Xalan/Xerces versions 2.4.1 and 2.6.0.
I have so far discovered the following.
iSeries machine 1 ( Agent ) ========> iSeries machine 2 ( Server ) - OK
iSeries machine 1 ( Agent ) ========> Windows machine 1 ( Server ) - DOES NOT WORK
Microsoft .Net WebService Studio Tool ===> iSeries machine 2 ( Server ) - OK
Microsoft .Net WebService Studio Tool ===> Windows machine 1 ( Server ) - OK
Windows machine 1 (Agent) ========> Windows machine 1 (Server ) - DOES NOT WORK
Windows machine 1 (Agent) ========> iSeries machine 2 ( Server ) - OK
The SOAP response traced by my program looks identicial and the HTTP protocol header are nearly identical, expect that the Server property are different and IIS adds an X-Powered-By: ASP.NET property
One is Server: Microsoft-IIS/5.1 and the other is Server: IBM-HTTP-Server/1.0
===================================================================================================
Create trace file : SOAP_REQUEST000001.XML
SOAP fault code : {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
SOAP fault actor : null
SOAP fault string : java.lang.RuntimeException: Exception in preInvoke : javax.xml.soap.SOAPException: org.xml.sax.SAXParseException: Content is not allowed in trailing section.
Fault detail : 0
<?xml version="1.0" encoding="utf-8"?>
<stackTrace>java.lang.RuntimeException: Exception in preInvoke :
javax.xml.soap.SOAPException: org.xml.sax.SAXParseException: Content
is not allowed in trailing section. at
org.apache.axis.handlers.HandlerChainImpl.preInvoke(HandlerChainImpl.java:188)
at
org.apache.axis.handlers.HandlerChainImpl.handleResponse(HandlerChainImpl.java:160)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180) at
org.apache.axis.client.Call.invokeEngine(Call.java:2765) at
org.apache.axis.client.Call.invoke(Call.java:2748) at
org.apache.axis.client.Call.invoke(Call.java:2424) at
org.apache.axis.client.Call.invoke(Call.java:2347) at
org.apache.axis.client.Call.invoke(Call.java:1804) at
com.mylaptop.soap.server.SimpleServerServiceBindingStub.getDesc(SimpleServerServiceBindingStub.java:103)
at
com.mylaptop.soap.agent.SimpleAgentService.callOperation_GETDESC(SimpleAgentService.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
com.lansa.jsm.service.SOAPAgentService.char(Unknown Source) at
com.lansa.jsm.service.SOAPAgentService.for(Unknown Source) at
com.lansa.jsm.service.SOAPAgentService.command(Unknown Source) at
com.lansa.jsm.b.a(Unknown Source) at com.lansa.jsm.b.run(Unknown
Source) </stackTrace>
=================================================================
HandlerChainImpl.java
private void preInvoke ( SOAPMessageContext msgContext )
{
try
{
SOAPMessage message = msgContext.getMessage();
// Ensure that message is already in the form we want
if(message != null && message.getSOAPPart() != null)
message.getSOAPPart().getEnvelope();
msgContext.setProperty(org.apache.axis.SOAPPart.ALLOW_FORM_OPTIMIZATION,
Boolean.FALSE);
msgContext.setProperty(JAXRPC_METHOD_INFO, getMessageInfo(message));
}
catch (Exception e)
{
log.debug("Exception in preInvoke : ", e);
throw new RuntimeException("Exception in preInvoke : " + e.toString());
}
}
=================================================================
regards
Alick Buckley
LANSA Research and Development
LANSA Pty Ltd
Phone: +61289070243
http://www.lansa.com
mailto:Alick.Buckley@lansa.com.au
