3

I'm using Visual Studio to add a web reference to consume a bunch of WSDLs, and VS auto generates a proxy which derives the service classes from SoapHttpClientProtocol (so .net Web Services tech).

My issue is when I call out to the server, it is returning this control character (0x1F or the unit separator), which .net is unable to parse and is throwing an exception (coming from System.Xml.Serialization.XmlSerializer.Deserialize).

Based on this, What is character 0x1f? it seems XML 1.0 doesn't support it, but XML 1.1 does and, based on this, Does .Net 4.5 support XML 1.1 yet (for characters invalid in XML 1.0)? it seems I'm kinda screwed since .net doesn't support 1.1 at all.

Is there a way around this? Can I make SoapHttpClientProtocol use a different parser (non .net) than XmlSerializer? Also, changing everything to use WCF instead of Web Services isn't really an option at this stage.

Community
  • 1
  • 1
shek
  • 215
  • 1
  • 2
  • 11
  • ASMX is a legacy technology, and should not be used for new development. WCF or ASP.NET Web API should be used for all new development of web service clients and servers. One hint: Microsoft has retired the [ASMX Forum](http://social.msdn.microsoft.com/Forums/en-US/asmxandxml/threads) on MSDN. – John Saunders Dec 23 '13 at 19:42
  • You have some misconceptions. WCF _is_ web services. And ASMX is something that Microsoft keeps around just because of existing users. You should not use it for any new development. Also, why not just try using a Service Reference instead of a Web Reference? No need to switch the services to WCF, but you would at least be using modern technology on the client end. – John Saunders Dec 23 '13 at 19:43
  • And are you sure that the service intends to return that character? Is it returning an XML 1.1 document? What kind of service is this? It sounds like a bug in the service. – John Saunders Dec 23 '13 at 19:44
  • Yes I would love for everyone to just agree it's a bug in the service, but the service providers are saying to try and use some other soap client (they suggest JDEV), which is why I was asking if there's any non .net alternatives for just the XmlParser as opposed to the whole client. – shek Dec 23 '13 at 22:08
  • Also, yea I could look into using a service reference, but I thought that was WCF? My only issue is that it will require quite a bit of work to change the entire technology. And in any case if .Net doesn't support XML 1.1, then would changing to WCF make a difference? – shek Dec 23 '13 at 22:10
  • I don't think you're going to get any part of .NET to support XML 1.1, and I really wonder about any service provider which assumes the consumer can support XML 1.1. No, switching to WCF will not directly solve this problem, but you'll have options for workarounds that will not exist for ASMX. You can use a service reference with any kind of service - not just a WCF service. Same way that a Web Reference can be used with a Java service, for instance. – John Saunders Dec 23 '13 at 22:13
  • Could you please explain a bit more? What do you mean a service reference can be used with any kind of service? I understand that it can talk to a service built in whatever technology (only conforming to the wsdl definitions matter). But as a clientside proxy I've tried adding a service reference through visual studio, and the proxy it generates derives the service classes from ClientBase, which seems to be WCF tech. It can't use a Java based client under the hood can it? That could actually solve my issue. – shek Dec 23 '13 at 22:24
  • No, it's only a WCF client, but whatever server. How could .NET generate a Java client, and how would you use it if you had one? No, the WCF technology gives you many options for extensibility, and you may be able to use one of them to permit this supposed XML 1.1 to be used. I don't really see how. – John Saunders Dec 23 '13 at 23:45
  • Did you read http://stackoverflow.com/questions/17231675/does-net-4-5-support-xml-1-1-yet-for-characters-invalid-in-xml-1-0 ? I think it's a horrible bug for your vendor to use a "standard" which hardly anybody supports. – John Saunders Dec 23 '13 at 23:46

0 Answers0