2010-05-12 4 views
4

나는 이것을 약간 익명으로 처리했다. 잘하면 그것은 유용한 메시지를 손상시키지 않습니다. 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 웹 참조를 사용하여 모든 리프팅을 수행합니다. 손으로 생성하지 않습니다)

다른 작업을해야합니까?

그냥 집에 가서 잠을 자면 내일은 모든 것이 "잘될 것"입니까?

답변

4

그래서이 질문에 대한 대답은 WSDL이 실제 메소드가하는 것과 일치하지 않는다는 것입니다. 나는 이것이 정확히 어떻게되는지 모른다.

설명을 위해이 메서드는 문자열 배열이 아닌 3 개의 문자열 배열을 취하고 두 개의 개별 문자열을 사용합니다. 따라서 테이크 어웨이는 "WSDL이 정확하다는 것을 두 번 확인"합니다.

0

제대로 처리되지 않는 네임 스페이스와 관련이 있다고 생각합니다.

나는 항상 &을 잘라내어 Google에 들어가는 오류 메시지를 붙여 놓은 다음 다른 사람에게 같은 문제가 있는지 확인합니다. 나는 항상 대답을 찾지는 못하지만, 나는 보통 혼자가 아니며 처음도 아니란 것을 알게됩니다.

+0

Google은 내가 모르는 것을 알아낼 때까지 젖은 국수와 같이 유용합니다. 특정 오류는 분명히 다른 끝에서 발생하므로 어디에서 오류가 발생하는지 알지 못합니다. 아니면 오류 [[org.xml.sax.SAXException : 배열 요소 내에서 문자 데이터를 deserializing하는 동안 오류가 발생했습니다.] – jcolebrand

+0

또한 네임 스페이스 문제라면 내 오류가 아니겠습니까? 이전에 네임 스페이스 오류가 발생했습니다. 그들은 (필자의 제한된 경험에서) XML deserializing 에러를 던지지는 않는다. – jcolebrand

관련 문제