views:

236

answers:

2

I've anonymised a bit of this. Hopefully it doesn't detract from the useful message. stringARRAY is where I think I'm getting thrown at, but I'm not sure, so if I'm looking at the wrong place, lemme know.

From the WSDL

  <xsd:element name="LongishOpName">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element maxOccurs="unbounded" name="stringARRAY" type="xsd:string" />
        <xsd:element name="stringfield1" type="xsd:string" />
        <xsd:element name="stringfield2" type="xsd:string" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>

Actual method call looks like this:

string originalValue = "some useful value";
string[] usefulName1 = new[] { originalValue };
service.response[] responses = server.LongishOpName( usefulName1, someString1, someString2 );

And it generates this XML to the server (Thanks to Fiddler2):

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
  <soap:Body>
    <LongishOpName xmlns="http://appropriate-namespace"&gt;
      <stringARRAY>114003</stringARRAY>
      <stringfield1>a string</stringfield1>
      <stringfield2>a string</stringfield2>
    </LongishOpName>
  </soap:Body>
</soap:Envelope>

To which I get this response

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
  <soapenv:Body>
    <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>org.xml.sax.SAXException: Found character data inside an array element while deserializing</faultstring>
      <detail>
        <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/"&gt;SERVERNAME&lt;/ns1:hostname&gt;
      </detail>
    </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>

Is my soap message actually coming out malformed? (yes I am using the ASP.NET web references to do all the lifting, I'm not generating by hand)

Should I be doing something different?

Do I just need to go home and sleep on it and tomorrow everything will "just work"?

A: 

I'm guessing it has to do with namespaces not being treated properly.

I always find it helpful to cut & paste the error messages I get into Google and see if someone else has had the same problem. I don't always find an answer, but I usually learn that I'm neither alone nor the first.

duffymo
Google's about as helpful as a wet noodle till I figure out what I don't know. The particular error is obviously occurring on the other end, so I don't know where it's failing. Or would you google something besides the error [[org.xml.sax.SAXException: Found character data inside an array element while deserializing]]
drachenstern
Also, if it were a namespace issue, wouldn't that be my error? I've run across namespace errors before. They don't tend to throw XML deserializing errors (in my very limited experience).
drachenstern
A: 

So the answer to this question was: the WSDL does not match what the actual method does. I don't know how this is exactly.

For clarification, the method takes an array of three strings, not an array of strings and then two separate strings. So the takeaway is "doublecheck the WSDL is accurate".

drachenstern