Apache Axis: disabling formatting

D

Dimitrio

I have a problem accessing a web service with Apache Axis.
The response from the web service indicates that there is an
"unexpected #text element" in the XML request.

If figured that the web service doesn't seem to accept whitespace
inside the SOAP method element. For example:

<soap:Envelope ...>
....
<soap:Body ...>
<someMethod xmlns="http://some.company.com/web/service">
<SomeParam>Some Value</SomeParam>
</someMethod>
</soap:Body>
</soap:Envelope>

This results in the above mentioned error response from the service.
However, once all the whitespace inside the someMethod element is
removed, the service works fine (verified by opening a URL connection
and writing the XML).

BTW, the service works OK if there is whitespace in other places of the
request. It only fails with whitespace in the method call element.

In this regard, some questions:

1. Have anybody ever enciuntered this kind of problem?

2. Is there a way to disable XML request formatting in Axis?

3. Does it have something to do with encoding style URI?
Thanks in advance!
 
D

Dimitrio

I have a problem accessing a web service with Apache Axis.
The response from the web service indicates that there is an
"unexpected #text element" in the XML request.

Just in case somebody is interested...

Had to hack into the Axis code. Changed the
<code>setPretty(boolean)</code> method of
<code>SerializationContextImpl</code> to always keep the
<code>pretty</code> field false. This way Axis will not insert any
newlines/whitespace in the request XML.

Though this is obviously a problem of the web service that I have to
use (not handling whitespace correctly), it's a shame Axis doesn't SEEM
to allow to change the way requests are formatted. I have seen alot of
places throughout Axis code where <code>setPrettry(true)</code> is
called on SerializationContext.

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top