2012-09-18 47 views
1

我總是得到錯誤Spring ws org.springframework.ws.soap.saaj.SaajSoapEnvelopeException XSD?

HTTP Status 500 - Request processing failed; nested exception is org.springframework.ws.soap.saaj.SaajSoapEnvelopeException: Could not access envelope: Unable to create envelope from given source: ; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:

當我嘗試用兩個複雜類型,如運行在SOAPRequest:

<xs:element name="blub"> 
    <xs:complexType> 
     <xs:sequence> 
      <xs:element name="mainheader" type="header" /> 
      <xs:element name="mainbody" type="body" /> 
     </xs:sequence> 
    </xs:complexType> 
</xs:element> 

我用org.springframework.oxm.jaxb.Jaxb2Marshaller作爲的Marshaller和org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection爲xsd。

任何人有想法?

回答

0

您可能忽略了soap:Envelope

<?xml version="1.0"?> 
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> 
    <soap:Header> 
    </soap:Header> 
    <soap:Body> 
    <m:GetStockPrice xmlns:m="http://www.example.org/stock"> 
     <m:StockName>IBM</m:StockName> 
    </m:GetStockPrice> 
    </soap:Body> 
</soap:Envelope>