?
Solved

XML Encoded When Passed to a Web Service

Posted on 2002-07-01
5
Medium Priority
?
203 Views
Last Modified: 2010-04-15
Hello,

I am having some trouble with a web service. I have a VB6 client app posting data to a web service. One of the parameters that the web method takes is some XML data. The problem I am having is that when the data gets to the web service it has been encoded and can no long be recognized as XML.  So my XML changes from <test>data</test> to &lt;test&gt;data&lt;/test&gt;  

I used "string" as the data type of the parameter and I am wondering if this is the reason that the XML gets encoded.  

If I switch to "XmlNode" as the data type will it solve my problem?  
Can XmlNode support child nodes such as <test><subtest>data</subtest></test> or will it only work for a single node?
Is there anyway I can solve this problem without changing the data type of the parameter?

I have tried having the client send the data via HTTP POST and SOAP with no change in the result.  
Thanks for your help in advance!
 
0
Comment
Question by:sdn421
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 22

Expert Comment

by:CJ_S
ID: 7122822
With SOAP it should work since the commnication between the client and a webservice is based on SOAP. That's as much as I know... so... something else must be wrong. :-/
0
 
LVL 27

Accepted Solution

by:
BigRat earned 800 total points
ID: 7126610
The problem is that passing "string" will cause the "web object" to encode the data so that the other side can reconstruct the string. Therefore entity encoding takes place. The trouble is that the Web Service expects XML and not "string" so the "decoding" does not take place and consequently an error occurs.

XmlNode is a true XML Node object and consequently can have child nodes, attribute and the like. Since you're communicating with a Web-Service send the XmlNode!
0
 
LVL 1

Author Comment

by:sdn421
ID: 7127375
There was no error when I tried to turn the string into XML. It just encoded the text and would not unencode it.  

I have already switched to the XmlNode as the data type. This works, but I had to get the client to change its call to use a complex SOAP data type or else the XML still gets encoded!  It has been a pain in the ass, but I think I figured it out.  

Thanks for trying.
0
 
LVL 27

Expert Comment

by:BigRat
ID: 7127536
Yes, he must in order to run a proper Web Service!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question