I have seen this problem a few times on google, and it seems to be due to a
configuration on a WSDD file (there is no WSDD in my case). I am generating
my stub classes via Axis1 and an endpoint that points to a WSDL file.  When
trying to force the stub to use PASSWORD_DIGEST, it doesn¹t seem to call the
.handle method on the callback class.  Does anyone know what im doing wrong?
Thanks for the help.

Code:
        ServiceRequestService_ServiceLocator srsLocator = new
ServiceRequestService_ServiceLocator();
        try {
            ServiceRequestServicePortBindingStub srsStub = new
ServiceRequestServicePortBindingStub(new URL(ENDPOINT), srsLocator);
            
            // Set the stub to use a PASSWORD DIGEST
            srsStub._setProperty(UsernameToken.PASSWORD_TYPE,
WSConstants.PASSWORD_DIGEST);
            srsStub._setProperty(WSHandlerConstants.USER, "sams");
            //SAMSpwCallback samspwCallback = new SAMSpwCallback();
            //srsStub._setProperty(WSHandlerConstants.PW_CALLBACK_REF,
samspwCallback);
            srsStub._setProperty(WSHandlerConstants.PW_CALLBACK_CLASS,
"com.cable.comcast.neto.sams.SAMSpwCallback");
            
            ...
            
            srsStub.create(createServiceRequest);
        } catch (Exception e) {
            logger.error("Test failed: ", e);
            fail();
        }          

Here it will throw:
faultString: Error. Handler Exception. com.sun.xml.wss.XWSSecurityException:
com.sun.xml.wss.XWSSecurityException: Message does not conform to configured
policy [ AuthenticationTokenPolicy(S) ]:  No Security Header found

Here is the WSDL:
<?xml version="1.0" encoding="UTF-8"?><!-- Published by JAX-WS RI at
http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.2-hudson-181-RC1.
--><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version
is JAX-WS RI 2.1.2-hudson-181-RC1. --><definitions
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
y-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:tns="http://ServiceRequestService.ws.sams.cable.comcast.com/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns="http://schemas.xmlsoap.org/wsdl/";
targetNamespace="http://ServiceRequestService.ws.sams.cable.comcast.com/";
name="ServiceRequestService">
<wsp:UsingPolicy></wsp:UsingPolicy>
<wsp:Policy wsu:Id="ServiceRequestServicePortBinding_MTOM_Policy">
<wsp:ExactlyOne>
<wsp:All>
<ns1:OptimizedMimeSerialization
xmlns:ns1="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeseriali
zation"></ns1:OptimizedMimeSerialization>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<types>
<xsd:schema>
<xsd:import 
namespace="http://ServiceRequestService.ws.sams.cable.comcast.com/";
schemaLocation="http://sams-web.cable.comcast.com:80/SAMS/1.0/ServiceRequest
Service?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="get">
<part name="parameters" element="tns:get"></part>
</message>
<message name="getResponse">
<part name="parameters" element="tns:getResponse"></part>
</message>
<message name="create">
<part name="parameters" element="tns:create"></part>
</message>
<message name="createResponse">
<part name="parameters" element="tns:createResponse"></part>
</message>
<message name="update">
<part name="parameters" element="tns:update"></part>
</message>
<message name="updateResponse">
<part name="parameters" element="tns:updateResponse"></part>
</message>
<portType name="ServiceRequestService">
<operation name="get">
<input message="tns:get"></input>
<output message="tns:getResponse"></output>
</operation>
<operation name="create">
<input message="tns:create"></input>
<output message="tns:createResponse"></output>
</operation>
<operation name="update">
<input message="tns:update"></input>
<output message="tns:updateResponse"></output>
</operation>
</portType>
<binding name="ServiceRequestServicePortBinding"
type="tns:ServiceRequestService">
<wsp:PolicyReference
URI="#ServiceRequestServicePortBinding_MTOM_Policy"></wsp:PolicyReference>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http";
style="document"></soap:binding>
<operation name="get">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
<operation name="create">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
<operation name="update">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
</binding>
<service name="ServiceRequestService">
<port name="ServiceRequestServicePort"
binding="tns:ServiceRequestServicePortBinding">
<soap:address 
location="http://sams-web.cable.comcast.com:80/SAMS/1.0/ServiceRequestServic
e"></soap:address>
</port>
</service>
</definitions>

Reply via email to