Hello,
I wanted to implement a STS using saml 2.0 tokens. I was trying to use the
ws-trust.wsdl and the ws-trust.xsd to generate a java skeleton. I also
downloaded the schemas for wss-security, policy etc and modified them to
point to the local directory. I then added a service name and binding port
in the wsdl.

On using cxf wsdltojava I get the following error:

SEVERE: Exception sending context initialized event to listener instance of
class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected
exception parsing XML document from ServletContext resource
[/WEB-INF/beans.xml]; nested exception is
org.springframework.beans.FatalBeanException: Could not load class:
org.sts.wstrust.SecurityTokenServiceImpl; nested exception is
java.lang.ClassNotFoundException: org.sts.wstrust.SecurityTokenServiceImpl
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
        at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)


The trust wsdl file is as follows:
<wsdl:definitions name = "InvSTS"
        targetNamespace="http://wstrust.sts.org/";
        xmlns:tns="http://wstrust.sts.org/";
        xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512/";
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
        xmlns:xs="http://www.w3.org/2001/XMLSchema";
        xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata";
        xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/";
>
  <!-- this is the WS-I BP-compliant way to import a schema -->
  <wsdl:types>
    <xs:schema>
      <xs:import
namespace="http://docs.oasis-open.org/ws-sx/ws-trust/200512/";
schemaLocation="ws-trust.xsd"/>
    </xs:schema>
  </wsdl:types>

  <!-- WS-Trust defines the following GEDs -->
  <wsdl:message name="RequestSecurityTokenMsg">
    <wsdl:part name="request" element="wst:RequestSecurityToken" />
  </wsdl:message>
  <wsdl:message name="RequestSecurityTokenResponseMsg">
    <wsdl:part name="response"
            element="wst:RequestSecurityTokenResponse" />
  </wsdl:message>
  <wsdl:message name="RequestSecurityTokenCollectionMsg">
    <wsdl:part name="requestCollection"
            element="wst:RequestSecurityTokenCollection"/>
  </wsdl:message>
  <wsdl:message name="RequestSecurityTokenResponseCollectionMsg">
    <wsdl:part name="responseCollection"
            element="wst:RequestSecurityTokenResponseCollection"/>
  </wsdl:message>

  <!-- This portType an example of a Requestor (or other) endpoint that 
         Accepts SOAP-based challenges from a Security Token Service -->
  <wsdl:portType name="WSSecurityRequestor">
    <wsdl:operation name="Challenge">
      <wsdl:input message="tns:RequestSecurityTokenResponseMsg"/>
      <wsdl:output message="tns:RequestSecurityTokenResponseMsg"/>
    </wsdl:operation>
  </wsdl:portType>

  <!-- This portType is an example of an STS supporting full protocol -->
  <wsdl:portType name="SecurityTokenService">
    <wsdl:operation name="Cancel">
      <wsdl:input
wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Cancel";
message="tns:RequestSecurityTokenMsg"/>
      <wsdl:output
wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/CancelFinal";
message="tns:RequestSecurityTokenResponseMsg"/>
    </wsdl:operation>
    <wsdl:operation name="Issue">
      <wsdl:input
wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue";
message="tns:RequestSecurityTokenMsg"/>
      <wsdl:output
wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTRC/IssueFinal";
message="tns:RequestSecurityTokenResponseCollectionMsg"/>
    </wsdl:operation>
    <wsdl:operation name="Renew">
      <wsdl:input
wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Renew";
message="tns:RequestSecurityTokenMsg"/>
      <wsdl:output
wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/RenewFinal";
message="tns:RequestSecurityTokenResponseMsg"/>
    </wsdl:operation>
    <wsdl:operation name="Validate">
      <wsdl:input
wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Validate";
message="tns:RequestSecurityTokenMsg"/>
      <wsdl:output
wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/ValidateFinal";
message="tns:RequestSecurityTokenResponseMsg"/>
    </wsdl:operation>
    <wsdl:operation name="KeyExchangeToken">
      <wsdl:input
wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/KET";
message="tns:RequestSecurityTokenMsg"/>
      <wsdl:output
wsam:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/KETFinal";
message="tns:RequestSecurityTokenResponseMsg"/>
    </wsdl:operation>
    <wsdl:operation name="RequestCollection">
      <wsdl:input message="tns:RequestSecurityTokenCollectionMsg"/>
      <wsdl:output message="tns:RequestSecurityTokenResponseCollectionMsg"/>
    </wsdl:operation>
  </wsdl:portType>

  <!-- This portType is an example of an endpoint that accepts 
         Unsolicited RequestSecurityTokenResponse messages -->
  <wsdl:portType name="SecurityTokenResponseService">
    <wsdl:operation name="RequestSecurityTokenResponse">
      <wsdl:input message="tns:RequestSecurityTokenResponseMsg"/>
    </wsdl:operation>
  </wsdl:portType>

        <wsdl:binding name="STSBinding" type="tns:SecurityTokenService">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="Issue">
      <soap12:operation
soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue";
style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
        </wsdl:binding>
  <wsdl:service name="InvSTS">
    <wsdl:port name="InvSTSPort" binding="tns:STSBinding">
      <soap12:address location="http://localhost:8181/inv-sts"/>
    </wsdl:port>
  </wsdl:service>

</wsdl:definitions>

----------------------
I also wanted to know that to operate in the messaging mode
(PAYLOAD/MESSAGE) is a webserviceprovider necessary or can it be done using
a webservice (since the above wsdl would create a webservice).

Thanks


-- 
View this message in context: 
http://cxf.547215.n5.nabble.com/CXF-WS-Trust-wsdl2java-tp3200092p3200092.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to