views:

171

answers:

1

I have developed a Web Service using JAX-WS (v2.1.3 - Sun JDK 1.6.0_05) that works just fine when I use a Java client or SoapUI or other Web Services testing tools. I need to consume this service using 2005 Microsoft SQL Server Reporting Services and I get the following error

<?xml version='1.0' encoding='UTF-8'?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    <S:Body>
        <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope"&gt;
            <faultcode>S:Client</faultcode>
            <faultstring>Couldn't create SOAP message due to exception: XML reader error: unexpected character content:
                "?"
            </faultstring>
        </S:Fault>
    </S:Body>
</S:Envelope>

If I use a HTTP proxy to sniff out what SSRS is sending, I see EF BB BF as the beginning of the post body and JAX-WS doesn't like that. If I remove the special characters and resubmit the request using Fiddler, then the web-service invocation works.

My question is why does SSRS introduce these special characters and how can I make it stop? If I can't stop it, how can I get JAX-WS to ignore them? Here is my SSRS query:

<Query>
<Method Name="getOneUser" Namespace="http://vinny.com" >
</Method>
</Query>

I've also tried a query like this below:

<Query>
<Method Name="getOneUser" Namespace="http://vinny.com" >
</Method>
 <SoapAction>http://vinny.com/getOneUser&lt;/SoapAction&gt;
<ElementPath IgnoreNamespaces="true">*</ElementPath>
</Query>

Does anyone have any ideas on what I can try? I've tried several different types of annotations on the JAX-WS side to change the type of SOAPBinding, etc. but nothing seem to make it work with Microsoft SSRS. Thanks in advance.

--Vinny

A: 

The "Special characters" are the "Byte order marker" (BOM) indicating that the post body is UTF-8. http://unicode.org/faq/utf%5Fbom.html#BOM

The Java service should be smart enough not to puke on these characters; I'm afraid I don't know how to help it.

EricLaw -MSFT-
Thanks Eric. SSRS is the only thing adding the BOM to the post body. I used SSIS and even created a .NET app in C# and they all consume the webservice just fine.
Vinny Carpenter
On an unrelated note, thank you very much for writing Fiddler. I LOVE FIDDLER and can't imagine developing webapps with out. So thank you Eric for creating this awesome tool.
Vinny Carpenter