1

我总是得到错误

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。

有人有想法吗?

4

1 回答 1

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>
于 2012-10-03T00:30:20.410 回答