I am developing a contract-first web service based on Spring-WS. I'm relying on Castor marshaling, and I have run into the following issue.
Requests are being accepted when the "xmlns" namespace is defined in the Envelope tag, such as:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="http://www.mycompany.com/MyService/schemas">
<soap:Header/>
<soap:Body>
<doPlaceHoldRequest>
<hold>
<accountInfo>
<accountNumber>123456789</accountNumber>
</accountInfo>
<extended>false</extended>
<afterHours>false</afterHours>
<amountSavings>1.00</amountSavings>
<amountChecking>0.00</amountChecking>
</hold>
</doPlaceHoldRequest>
</soap:Body>
</soap:Envelope>
However, both .NET and Java clients generated from the .wsdl provided by Spring-WS (which was generated from a XSD), form their requests in the following manner:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<doPlaceHoldRequest
xmlns="http://www.mycompany.com/MyService/schemas">
<hold>
<accountInfo>
<accountNumber>123456789</accountNumber>
</accountInfo>
<extended>false</extended>
<afterHours>false</afterHours>
<amountSavings>1.00</amountSavings>
<amountChecking>0.00</amountChecking>
</hold>
</doPlaceHoldRequest>
</soap:Body>
</soap:Envelope>
Which results in an Unmarshalling Exception being thrown by Castor. How do I get Castor to recognize these messages as valid? Could my WSDL (or the XSD I used to autogenerate it) be wrong?