axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Hudec" <>
Subject encoded characters in SOAP Axis
Date Tue, 22 Jul 2003 07:02:44 GMT

I have very simple Axis SOAP client calling service with 3 arguments from this code:

    String ret = (String) call.invoke( new Object[] { "příčina","<data>test</data>",
"<data>příčina</data>" } );

which generates this SOAP request:

<soapenv:Envelope xmlns:soapenv="" xmlns:xsd=""
  <send soapenv:encodingStyle="">
   <arg0 xsi:type="xsd:string">příčina</arg0>
   <arg1 xsi:type="xsd:string">&lt;data&gt;test&lt;/data&gt;</arg1>
   <arg2 xsi:type="xsd:string">&lt;data&gt;p&#345;&#237;&#269;ina&lt;/data&gt;</arg2>

What I really need is to set some call property to get this value in the SOAP request:

   <arg2 xsi:type="xsd:string">&lt;data&gt;příčina&lt;/data&gt;</arg2>

(in other words, to set property that I don't need to encode international characters into
HTML entities (or how is this called :o)) ))

It works for me in Perl using SOAP::Simple, in Java using CapeClear pre-generated code, but
I need to build my code on Apache (because of https, authentication, ...).

Here are some facts I experienced:
1] if I write only international characters into the argument, it sends them in proper way
(as you can see from the argument arg0)
2] after adding "<", ">" or "&" into the argument, it converts international characters
into "&#xxx;" entities (as you can see from the argument arg2)
3] I am using Axis 1_1, but I also tried it in at least 10 months old Axis with the same behaviour.
a] endpoint is hosted on Apache PHP and I took SOAP envelope from $HTTP_RAW_POST_DATA variable.
b] other endpoint was hosted on Lotus Domino Server and I took the same envelope from document.context.

If you have any ideas about it, please let me know.

Thank you,

Jan Hudec
Here is my source code:

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;

public class TestClient1 {
    public static void main(String [] args) {
        String str, whole;
        whole = "";

        try {
            String endpoint = "";
            Service service = new Service();
            Call    call    = (Call) service.createCall();
            call.setTargetEndpointAddress( new );
            call.setOperationName(new QName("send"));
            //    call.setUsername("wsuser");
            //    call.setPassword("wspwd");
                 String ret = (String) call.invoke( new Object[] { "příčina","<data>test</data>",
"<data>příčina</data>" } );
            System.out.println("Value: '" + ret + "'");
        } catch (Exception e) {

Stydím se ho vytáhnout! A jaký je váš důvod vyměnit svůj telefon za nový? 
Nokia 6610 již od 6577 Kč.

View raw message