More info:
If I send this SOAP message:
Code:
Host: localhost:7001
Content-Length: 493
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.0.1
Content-Type: text/xml;charset=UTF-8
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://com.hlikk.ingenium/machi/schemas">
<soapenv:Header/>
<soapenv:Body>
<sch:MACHI_RESTRICT_DATA_REQUEST>
<sch:MSG_ID>12345678</sch:MSG_ID>
<sch:POLICY_ID>12345678</sch:POLICY_ID>
<sch:USER_ID>duffymo</sch:USER_ID>
<sch:MACHI_RESTRICT_IND>Y</sch:MACHI_RESTRICT_IND>
</sch:MACHI_RESTRICT_DATA_REQUEST>
</soapenv:Body>
</soapenv:Envelope>
I'm getting an HTTP 404 "Not Found" as the response.
My Endpoint code looks like this:
Code:
/**
* Spring "contract first" web service for Restriction.
* Payload endpoint does NOT have access to SOAP headers,
* only the contents of the SOAP body.
* Date: May 30, 2008
* Time: 10:16:28 AM
* @link http://static.springframework.org/spring-ws/site/reference/html/tutorial.html
*/
public class RestrictionEndpoint extends AbstractJDomPayloadEndpoint
{
private XPath policyIdExpression;
private XPath updatedByUserIdExpression;
private XPath restrictedExpression;
private RestrictionService restrictionService;
private static final String DEFAULT_NAMESPACE = "sch";
public RestrictionEndpoint(RestrictionService restrictionService) throws JDOMException
{
this.restrictionService = restrictionService;
policyIdExpression = XPath.newInstance("//POLICY_ID");
updatedByUserIdExpression = XPath.newInstance("//USER_ID");
restrictedExpression = XPath.newInstance("//MACHI_RESTRICT_IND");
// TODO: Add Namespace if necessary
/*
Namespace namespace = Namespace.getNamespace(DEFAULT_NAMESPACE);
policyIdExpression.addNamespace(namespace);
updatedByUserIdExpression.addNamespace(namespace);
restrictedExpression.addNamespace(namespace);
*/
}
protected Element invokeInternal(Element restrictionRequest) throws Exception
{
String policyId = policyIdExpression.valueOf(restrictionRequest);
String updatedByUserId = updatedByUserIdExpression.valueOf(restrictionRequest);
String restrictedStr = restrictedExpression.valueOf(restrictionRequest);
boolean restricted = fromYesNoToBoolean(restrictedStr);
Restriction restriction = new Restriction(policyId, updatedByUserId, restricted);
restrictionService.saveOrUpdate(restriction);
return null;
}
private boolean fromYesNoToBoolean(String restrictedStr)
{
boolean value = false;
if (restrictedStr.length() > 0)
{
char firstChar = restrictedStr.charAt(0);
value = ((firstChar == 'Y') || (firstChar == 'y'));
}
return value;
}
}
As you can see, I have the Namespace addition commented out. If I uncomment the Namespace lines in the constructor, I get a new response: HTTP 503 "service unavailable".
I still don't understand exactly what's going on. Stay tuned. Still digging.
%