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 Ashish Kulkarni <as...@gmail.com> on 2008/08/03 04:05:57 UTC

Webservice and Japanese Characters

Hi

We have to create a web service which will be used to consume data which may
have japnese characters,

Is there some thing special we have to do for WSDL, do we have to define it
as UTF-16 or some thing. This web service will get data which will be
english characters and some times Japanese characters,

We need to insert this data in a DB2 table which accepts english characters,
so basically use UTF-8 for data inserted

Any suggestions

Re: Webservice and Japanese Characters

Posted by Chinmoy Chakraborty <cc...@gmail.com>.
Hi Carsten,

Default encoding is what you have in your system. E.g. I am running on
Windows XP and my default encoding was something like "windows-1258" (in
regional setting mine was English - United States).....so i had to read the
iputstream in UTF-8 format because characters were coming in as UTF-8.

There are different character-sets. Java also needs to support the
character-set (character-encoding) you want to send in the right format.

Chinmoy

On Tue, Aug 5, 2008 at 7:58 PM, Carsten Burghardt <ca...@cburghardt.com>wrote:

> Hi Chinmoy,
>
> so what was the original encoding of the XML stream? You read the stream
> with UTF-8 (I thought that the Axis Servlet also did this) and then you
> re-encoded or what did you do?
>
> Thanks for your help!
>
> Carsten
>
>
> Quoting "Chinmoy Chakraborty" <cc...@gmail.com>:
>
> Take a look at "javax.servlet.Filter" doc....you can mention this filter in
>> your web.xml like this (e.g):
>>
>> <filter>
>>    <filter-name>WSSOAPFilter</filter-name>
>>    <filter-class>packagename.WebServiceSoapFilter</filter-class>
>>  </filter>
>>  <filter-mapping>
>>    <filter-name>WSSOAPFilter</filter-name>
>>    <servlet-name>AxisServlet</servlet-name>
>>  </filter-mapping>
>>
>> Chinmoy
>>
>> On Mon, Aug 4, 2008 at 8:17 PM, Ashish Kulkarni <
>> ashish.kulkarni13@gmail.com
>>
>>> wrote:
>>>
>>
>> Hi
>>> Thanks for the information, i have to write a client to send this
>>> information to a web service written by some other group.
>>> Do i send data in UTF-8 Format, how do i do any conversion before calling
>>> this web service
>>>
>>> Ashish
>>>
>>>
>>> On Mon, Aug 4, 2008 at 10:06 AM, Carsten Burghardt <
>>> carsten@cburghardt.com
>>> > wrote:
>>>
>>> Quoting "Chinmoy Chakraborty" <cc...@gmail.com>:
>>>>
>>>> Hi Ashish,
>>>>
>>>>>
>>>>> I had same problem with RUSSIAN characters. I used Axis 1.4. I guess
>>>>> Axis2
>>>>> also does not handle this situation well. Here is what I did,
>>>>>
>>>>> I used a custom filter. In there I was reading the inputstream using
>>>>> "UTF-8"
>>>>> [BufferedReader br = new BufferedReader(new
>>>>> InputStreamReader(request.getInputStream(), "UTF-8"));]encoding, do
>>>>> what
>>>>> you
>>>>> require to do here and pass the inputstream to Axis2.
>>>>>
>>>>> Now Axis2 can handle this and this works fine for russian characters at
>>>>> my
>>>>> end.
>>>>>
>>>>>
>>>> That's interesting as I also have the problem with KOI8-R encoded
>>>> characters (see my email "Illegal characters"). Can you provide a little
>>>> bit
>>>> more details on how you added the filter and passed the stream to Axis?
>>>>
>>>> HTH,
>>>>
>>>>> Chinmoy
>>>>>
>>>>> On Sun, Aug 3, 2008 at 7:35 AM, Ashish Kulkarni <
>>>>> ashish.kulkarni13@gmail.com
>>>>>
>>>>> wrote:
>>>>>>
>>>>>>
>>>>>  Hi
>>>>>
>>>>>>
>>>>>> We have to create a web service which will be used to consume data
>>>>>> which
>>>>>> may have japnese characters,
>>>>>>
>>>>>> Is there some thing special we have to do for WSDL, do we have to
>>>>>> define
>>>>>> it
>>>>>> as UTF-16 or some thing. This web service will get data which will be
>>>>>> english characters and some times Japanese characters,
>>>>>>
>>>>>> We need to insert this data in a DB2 table which accepts english
>>>>>> characters, so basically use UTF-8 for data inserted
>>>>>>
>>>>>> Any suggestions
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>>
>>>>
>>>>
>>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Webservice and Japanese Characters

Posted by Carsten Burghardt <ca...@cburghardt.com>.
Hi Chinmoy,

so what was the original encoding of the XML stream? You read the  
stream with UTF-8 (I thought that the Axis Servlet also did this) and  
then you re-encoded or what did you do?

Thanks for your help!

Carsten

Quoting "Chinmoy Chakraborty" <cc...@gmail.com>:

> Take a look at "javax.servlet.Filter" doc....you can mention this filter in
> your web.xml like this (e.g):
>
> <filter>
>     <filter-name>WSSOAPFilter</filter-name>
>     <filter-class>packagename.WebServiceSoapFilter</filter-class>
>   </filter>
>   <filter-mapping>
>     <filter-name>WSSOAPFilter</filter-name>
>     <servlet-name>AxisServlet</servlet-name>
>   </filter-mapping>
>
> Chinmoy
>
> On Mon, Aug 4, 2008 at 8:17 PM, Ashish Kulkarni <ashish.kulkarni13@gmail.com
>> wrote:
>
>> Hi
>> Thanks for the information, i have to write a client to send this
>> information to a web service written by some other group.
>> Do i send data in UTF-8 Format, how do i do any conversion before calling
>> this web service
>>
>> Ashish
>>
>>
>> On Mon, Aug 4, 2008 at 10:06 AM, Carsten Burghardt <carsten@cburghardt.com
>> > wrote:
>>
>>> Quoting "Chinmoy Chakraborty" <cc...@gmail.com>:
>>>
>>> Hi Ashish,
>>>>
>>>> I had same problem with RUSSIAN characters. I used Axis 1.4. I guess
>>>> Axis2
>>>> also does not handle this situation well. Here is what I did,
>>>>
>>>> I used a custom filter. In there I was reading the inputstream using
>>>> "UTF-8"
>>>> [BufferedReader br = new BufferedReader(new
>>>> InputStreamReader(request.getInputStream(), "UTF-8"));]encoding, do what
>>>> you
>>>> require to do here and pass the inputstream to Axis2.
>>>>
>>>> Now Axis2 can handle this and this works fine for russian characters at
>>>> my
>>>> end.
>>>>
>>>
>>> That's interesting as I also have the problem with KOI8-R encoded
>>> characters (see my email "Illegal characters"). Can you provide a  
>>> little bit
>>> more details on how you added the filter and passed the stream to Axis?
>>>
>>> HTH,
>>>> Chinmoy
>>>>
>>>> On Sun, Aug 3, 2008 at 7:35 AM, Ashish Kulkarni <
>>>> ashish.kulkarni13@gmail.com
>>>>
>>>>> wrote:
>>>>>
>>>>
>>>>  Hi
>>>>>
>>>>> We have to create a web service which will be used to consume data which
>>>>> may have japnese characters,
>>>>>
>>>>> Is there some thing special we have to do for WSDL, do we have to define
>>>>> it
>>>>> as UTF-16 or some thing. This web service will get data which will be
>>>>> english characters and some times Japanese characters,
>>>>>
>>>>> We need to insert this data in a DB2 table which accepts english
>>>>> characters, so basically use UTF-8 for data inserted
>>>>>
>>>>> Any suggestions
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>>
>>>
>>
>





---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Attribute 'type' of 'element' of XML schema can refer to only primitive data types?

Posted by Kakoli Sen <ka...@cdacb.ernet.in>.
Hello all,
    I am new to WSDL. Can someone tell me the difference between attributes
'type' and 'ref' of <xsd:element>. Below is a snippet from my wsdl file :

        <xsd:element name="Employee">
                <xsd:complexType>
                <xsd:sequence>
                <xsd:element name="name" type="xsd:string"/>
                <xsd:element name="id" type="xsd:int"/>
                <xsd:element name="join_date" type="xsd:string"/>
                </xsd:sequence>
                </xsd:complexType>
        </xsd:element>
        <xsd:element name="EmployeeArray">
                <xsd:complexType>
                <xsd:sequence>
                <xsd:element type="Employee" minOccurs="1"
maxOccurs="unbounded"/>
                </xsd:sequence>
                </xsd:complexType>
        </xsd:element>.

This gives error : java.io.IOException: Type
{http://schemas.xmlsoap.org/wsdl/}Employee is referenced but not defined.
But when I replace type="Employee" by ref="tns:Employee", the error goes
off.

The attribute 'type' can refer to only primitive data types? But the
documentation on XML schema says otherwise.

Thanks & Regards,
Kakoli

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


Re: Webservice and Japanese Characters

Posted by Chinmoy Chakraborty <cc...@gmail.com>.
Take a look at "javax.servlet.Filter" doc....you can mention this filter in
your web.xml like this (e.g):

<filter>
    <filter-name>WSSOAPFilter</filter-name>
    <filter-class>packagename.WebServiceSoapFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>WSSOAPFilter</filter-name>
    <servlet-name>AxisServlet</servlet-name>
  </filter-mapping>

Chinmoy

On Mon, Aug 4, 2008 at 8:17 PM, Ashish Kulkarni <ashish.kulkarni13@gmail.com
> wrote:

> Hi
> Thanks for the information, i have to write a client to send this
> information to a web service written by some other group.
> Do i send data in UTF-8 Format, how do i do any conversion before calling
> this web service
>
> Ashish
>
>
> On Mon, Aug 4, 2008 at 10:06 AM, Carsten Burghardt <carsten@cburghardt.com
> > wrote:
>
>> Quoting "Chinmoy Chakraborty" <cc...@gmail.com>:
>>
>> Hi Ashish,
>>>
>>> I had same problem with RUSSIAN characters. I used Axis 1.4. I guess
>>> Axis2
>>> also does not handle this situation well. Here is what I did,
>>>
>>> I used a custom filter. In there I was reading the inputstream using
>>> "UTF-8"
>>> [BufferedReader br = new BufferedReader(new
>>> InputStreamReader(request.getInputStream(), "UTF-8"));]encoding, do what
>>> you
>>> require to do here and pass the inputstream to Axis2.
>>>
>>> Now Axis2 can handle this and this works fine for russian characters at
>>> my
>>> end.
>>>
>>
>> That's interesting as I also have the problem with KOI8-R encoded
>> characters (see my email "Illegal characters"). Can you provide a little bit
>> more details on how you added the filter and passed the stream to Axis?
>>
>> HTH,
>>> Chinmoy
>>>
>>> On Sun, Aug 3, 2008 at 7:35 AM, Ashish Kulkarni <
>>> ashish.kulkarni13@gmail.com
>>>
>>>> wrote:
>>>>
>>>
>>>  Hi
>>>>
>>>> We have to create a web service which will be used to consume data which
>>>> may have japnese characters,
>>>>
>>>> Is there some thing special we have to do for WSDL, do we have to define
>>>> it
>>>> as UTF-16 or some thing. This web service will get data which will be
>>>> english characters and some times Japanese characters,
>>>>
>>>> We need to insert this data in a DB2 table which accepts english
>>>> characters, so basically use UTF-8 for data inserted
>>>>
>>>> Any suggestions
>>>>
>>>>
>>>>
>>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>>
>>
>

Re: Webservice and Japanese Characters

Posted by Ashish Kulkarni <as...@gmail.com>.
Hi
Thanks for the information, i have to write a client to send this
information to a web service written by some other group.
Do i send data in UTF-8 Format, how do i do any conversion before calling
this web service

Ashish

On Mon, Aug 4, 2008 at 10:06 AM, Carsten Burghardt
<ca...@cburghardt.com>wrote:

> Quoting "Chinmoy Chakraborty" <cc...@gmail.com>:
>
>  Hi Ashish,
>>
>> I had same problem with RUSSIAN characters. I used Axis 1.4. I guess Axis2
>> also does not handle this situation well. Here is what I did,
>>
>> I used a custom filter. In there I was reading the inputstream using
>> "UTF-8"
>> [BufferedReader br = new BufferedReader(new
>> InputStreamReader(request.getInputStream(), "UTF-8"));]encoding, do what
>> you
>> require to do here and pass the inputstream to Axis2.
>>
>> Now Axis2 can handle this and this works fine for russian characters at my
>> end.
>>
>
> That's interesting as I also have the problem with KOI8-R encoded
> characters (see my email "Illegal characters"). Can you provide a little bit
> more details on how you added the filter and passed the stream to Axis?
>
>  HTH,
>> Chinmoy
>>
>> On Sun, Aug 3, 2008 at 7:35 AM, Ashish Kulkarni <
>> ashish.kulkarni13@gmail.com
>>
>>> wrote:
>>>
>>
>>   Hi
>>>
>>> We have to create a web service which will be used to consume data which
>>> may have japnese characters,
>>>
>>> Is there some thing special we have to do for WSDL, do we have to define
>>> it
>>> as UTF-16 or some thing. This web service will get data which will be
>>> english characters and some times Japanese characters,
>>>
>>> We need to insert this data in a DB2 table which accepts english
>>> characters, so basically use UTF-8 for data inserted
>>>
>>> Any suggestions
>>>
>>>
>>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Webservice and Japanese Characters

Posted by Carsten Burghardt <ca...@cburghardt.com>.
Quoting "Chinmoy Chakraborty" <cc...@gmail.com>:

> Hi Ashish,
>
> I had same problem with RUSSIAN characters. I used Axis 1.4. I guess Axis2
> also does not handle this situation well. Here is what I did,
>
> I used a custom filter. In there I was reading the inputstream using "UTF-8"
> [BufferedReader br = new BufferedReader(new
> InputStreamReader(request.getInputStream(), "UTF-8"));]encoding, do what you
> require to do here and pass the inputstream to Axis2.
>
> Now Axis2 can handle this and this works fine for russian characters at my
> end.

That's interesting as I also have the problem with KOI8-R encoded  
characters (see my email "Illegal characters"). Can you provide a  
little bit more details on how you added the filter and passed the  
stream to Axis?

> HTH,
> Chinmoy
>
> On Sun, Aug 3, 2008 at 7:35 AM, Ashish Kulkarni <ashish.kulkarni13@gmail.com
>> wrote:
>
>>  Hi
>>
>> We have to create a web service which will be used to consume data which
>> may have japnese characters,
>>
>> Is there some thing special we have to do for WSDL, do we have to define it
>> as UTF-16 or some thing. This web service will get data which will be
>> english characters and some times Japanese characters,
>>
>> We need to insert this data in a DB2 table which accepts english
>> characters, so basically use UTF-8 for data inserted
>>
>> Any suggestions
>>
>>
>





---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Webservice and Japanese Characters

Posted by Chinmoy Chakraborty <cc...@gmail.com>.
Hi Ashish,

I had same problem with RUSSIAN characters. I used Axis 1.4. I guess Axis2
also does not handle this situation well. Here is what I did,

I used a custom filter. In there I was reading the inputstream using "UTF-8"
[BufferedReader br = new BufferedReader(new
InputStreamReader(request.getInputStream(), "UTF-8"));]encoding, do what you
require to do here and pass the inputstream to Axis2.

Now Axis2 can handle this and this works fine for russian characters at my
end.

HTH,
Chinmoy

On Sun, Aug 3, 2008 at 7:35 AM, Ashish Kulkarni <ashish.kulkarni13@gmail.com
> wrote:

>  Hi
>
> We have to create a web service which will be used to consume data which
> may have japnese characters,
>
> Is there some thing special we have to do for WSDL, do we have to define it
> as UTF-16 or some thing. This web service will get data which will be
> english characters and some times Japanese characters,
>
> We need to insert this data in a DB2 table which accepts english
> characters, so basically use UTF-8 for data inserted
>
> Any suggestions
>
>