receiving ??? chars instead of "special" chars

M

M.Posseth

Hello i have a strange problem

i made a online catalogue and must submit orders to a remote server

I need to connect to a remote webservice on unix platform , i must say that
this was easier as i thought , i just set a reference to the wsdl in my
VB.NET project and i could access the web methods


the webmethod returns info by reference

Debug.WriteLine(strXML)

intSucces = shopTest.XMLExecute("test|pass", strXML, strError, intReturn)

Debug.WriteLine("returned : " & strXML)


well the problem is that the data that i receive from the webmethod contains
? (question marks )

data send by me through test application ( data is contained in strXML)

<?xml version="1.0" encoding="iso-8859-1"?>
<onlinebestellung>
<request>
<cmd>ORDER</cmd>
</request>
<positionen>
<artikel>
<bestellartikelnummer>24.0110-0116.1</bestellartikelnummer>
<bestellmenge>1</bestellmenge>
<hersteller>ATE</hersteller>
</artikel>
</positionen>
</onlinebestellung>

returned data from the webservice ( data that is contained in strXml after
calling the webservice )

<?xml version="1.0" encoding="iso-8859-1" ?>
<onlinebestellung><request><cmd>Artikelanfrage</cmd></request>
<positionen> <artikel>
<status></status>
<bestellartikelnummer>24.0110-0116.1</bestellartikelnummer>
<bestellmenge>2</bestellmenge>
<r??ckstandsmenge>0</r??ckstandsmenge>
<hlka>CO</hlka>
<lieferantenartikelnr>24.0110-0116.1-CO</lieferantenartikelnr>
<artikelnummer>24011001161</artikelnummer>
<artikelbezeichnung>ATE BREMSSCHEIBE VAG HA Audi 100
2,3E</artikelbezeichnung>
<katalognummer>24.0110-0116.1</katalognummer>
<hauptwarengruppe>035</hauptwarengruppe>
<warengruppe>I10</warengruppe>
<unterwarengruppe>0631</unterwarengruppe>
<liefermenge>2</liefermenge>
<bestellmengenrundung>2</bestellmengenrundung>
<h??chstbestellmenge>0</h??chstbestellmenge>
<gewicht>6,964</gewicht>
<alternative>T</alternative>
<mengeneinheit>STK</mengeneinheit>
Stck
<oenummer></oenummer>
<tauschteilkennz>N</tauschteilkennz>
<mwstschl??ssel>12</mwstschl??ssel>
<repdocmwstschl??ssel>0</repdocmwstschl??ssel>
<bruttopreis>40,3</bruttopreis>
<nettopreis>40,3</nettopreis>
<rabatt1>0</rabatt1>
<rabatt2>0</rabatt2>
<pfandpreis>0</pfandpreis>
<w??hrungsschl??ssel>EUR</w??hrungsschl??ssel>
<preiseinheit>1</preiseinheit>
<preiseinheitenfaktor>1</preiseinheitenfaktor>
<werk>01</werk>
<lieferwerk>01</lieferwerk>
<inttext></inttext>
<lieferwerk1>01</lieferwerk1>
<liefermenge1>2</liefermenge1>
<lieferwerk2></lieferwerk2>
<liefermenge2>0</liefermenge2>
<warengruppenbez>ATE Bremsscheiben</warengruppenbez>
<eannummer></eannummer>
<hlkabezeichnung></hlkabezeichnung>
<artikelzustand>1</artikelzustand>
<call></call>
<auftragnr></auftragnr>
<ztext></ztext>
<staffel></staffel>
</artikel></positionen><rest></rest>
</onlinebestellung>{FF7B6C3C-39BB-21D3-7BA5-004524E7D6D0}test{pass

Ofcourse the problem could be in the charset but that is the strange thing
..NET should be Unicode ( so it should not be a problem )and the proper
charset is set in the XML header ( it is German text wich should correspond
to iso-8859-1)

I call the webservice for testing purposes from a VB.NET application on a
Windows 2000 advanced server US-EN ( all settings are US )

i hope someone can tell me why the ?? problem occurs cause i am getting
desperate right now :-( , ( and it started so promissing )





Met vriendelijke groet
Kind regards,

Michel Posseth
Software Developer
Microsoft Certified Professional
 
D

Dan Rogers

Hi Michel,

There is not necessarily a problem with this result. The issue you are
seeing is in coercing encoded XML into a string. Since XML is not a string
(even though it might look like a string), the conflict in the encoding
between the two systems (ISO-8859-1) and Unicode of the native string type
is probably what you are seeing. To properly convert the output, you need
to use a text reader that properly handles the encoding conversion. The
XmlTextReader is suitable for this.

Assuming that the sending side is properly encoding their output into 8859,
using a encoding sensitive text reader will solve your issue.

Best regards,

Dan Rogers
Microsoft Corporation
--------------------
 
M

M.Posseth

Well the webmethod returns info by reference

i am just a user of the webservice and have no more influence as passing
the required parameters

<CODE >

Debug.WriteLine(strXML)

intSucces = shopTest.XMLExecute("test|pass", strXML, strError, intReturn)

Debug.WriteLine("returned : " & strXML)

< /CODE >

So strXML is actually a unicode string that is passed to the remote machine
, there processed an returned in the same string

So it could even be so that "they" parse the XML as a standard string

Isn`t there a way that i can make a iso-8859-1 string and pass this as a
parameter to the webservice
 
D

Dan Rogers

Hi Michael,

The issue that I'd call out if I were reviewing this design is inherently
an encoding bug. Since the returned XML signals that it is encoded in
8859, processing that string (converted to a string by the underlying .NET
infrastructure serializer) introduces an issue related to not removing the
processing instruction at the start of the XML document. A second issue
comes up in most designs that treat XML as strings for this reason.

Would it be possible to share the WSDL for this service? It isn't clear to
me how your test harness came to be structured this way. It certainly is
possible to devise a RPC style (or SOAP section 5 encoded service) with
parameters in this manner. However, I wouldn't expect the far end to send
a complete XML document using a string in this manner. If you need to
design the service to get an XML file, then you probably want to avoid
using SOAP to do so and use plain old HTTP GET instead.

From the WSDL I'll be able to tell a little more about what the service
authors intended. It may be just one of those cases of a very poorly
designed and implemented "web service" that isn't cross platform
compatible. There are many many such cases, and there is little one can do
other than file a bug. But let's see the WSDL first to get a little more
data.

Regards

Dan Rogers
Microsoft Corporation
--------------------
 

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,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top