나는 이것을 약간 익명으로 처리했다. 잘하면 그것은 유용한 메시지를 손상시키지 않습니다. stringARRAY는 내가 던져 질 것으로 생각하는 곳이지만 확실하지 않습니다. 그래서 내가 잘못된 곳을보고 있으면, 알 수 있습니다. 은 WSDL에서이 XML 블록에 대해 org.xml.sax.SAXException이 표시되는 이유는 무엇입니까?
는
<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>
실제 메소드 호출은 다음과 같습니다
string originalValue = "some useful value";
string[] usefulName1 = new[] { originalValue };
service.response[] responses = server.LongishOpName(usefulName1, someString1, someString2);
을 그리고 (Fiddler2 덕분에) 서버에이 XML을 생성합니다
<?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">
<soap:Body>
<LongishOpName xmlns="http://appropriate-namespace">
<stringARRAY>114003</stringARRAY>
<stringfield1>a string</stringfield1>
<stringfield2>a string</stringfield2>
</LongishOpName>
</soap:Body>
</soap:Envelope>
으로 나는이 반응을 얻는다.
<?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">
<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/">SERVERNAME</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
내 비누 메시지가 실제로 형식이 잘못 되었습니까? (네, ASP.NET 웹 참조를 사용하여 모든 리프팅을 수행합니다. 손으로 생성하지 않습니다)
다른 작업을해야합니까?
그냥 집에 가서 잠을 자면 내일은 모든 것이 "잘될 것"입니까?
Google은 내가 모르는 것을 알아낼 때까지 젖은 국수와 같이 유용합니다. 특정 오류는 분명히 다른 끝에서 발생하므로 어디에서 오류가 발생하는지 알지 못합니다. 아니면 오류 [[org.xml.sax.SAXException : 배열 요소 내에서 문자 데이터를 deserializing하는 동안 오류가 발생했습니다.] – jcolebrand
또한 네임 스페이스 문제라면 내 오류가 아니겠습니까? 이전에 네임 스페이스 오류가 발생했습니다. 그들은 (필자의 제한된 경험에서) XML deserializing 에러를 던지지는 않는다. – jcolebrand