0

I have a WCF web service that returns a string to a Java based client.

<OperationContract()>
Function SomeSvc(ByVal fileString As String) As String

fileString is a bunch of xml. When the client gets the response my xmlstring is encoded as text.

 <s:Body u:Id="_0">
    <SomeSvcResponse xmlns="http://tempuri.org/">
      <SomeSvcResult>&gt; &lt;/ns2:FailureMessage&gt; &lt;/ns:BOD&gt; &lt;/ns:ConfirmDataArea&gt; &lt;/ns:Confirm&gt;
      </SomeSvcResult>
    </SomeSvcResponse>
  </s:Body>
</s:Envelope>

Why is my service returning encoded text instead of xml?

1 Answer 1

4

The service encodes your data because you defined return value as String. If you want to return XML use XElement instead.

Sign up to request clarification or add additional context in comments.

2 Comments

will a non-.net client be able to handle the XElement being returned?
Yes it will be returned as pure XML and WSDL will define message content as xsd:any.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.