Actually, Kerek best to ask CXF questions on the us...@cxf.apache.org list (also on Nabble), which has virtually everybody on dev (for internal development of CXF only) plus tons of users.

I think you're running wsdl2java with the "-validate" option, the error below might be WS-I Basic Profile related and not an actual WSDL syntactical error, so the wsdl2jva process should complete if you don't use "-validate" option. Of course, the WSDLs you create should not fail the -validate option, but if you are provided the WSDL and it doesn't completely follow the WS-I BP there may not be much you can do about it.

Anyway, you might not even need to run WSDL2Java on the below WSDL -- using CXF's stsclient[1] to access the STS may be sufficient for your needs.

HTH,
Glen

[1] http://cxf.apache.org/docs/ws-trust.html

On 2/11/2011 10:35 AM, Kerek.Tibor wrote:
Hi!
I hope i'm writing to the right mailing list. I want to use OpenAm, and it
has a few webservices. When i tried to generate a client to one of them, i
got the following error message (i'm using SpringSource Tool Suitewith CXF
2.3.1):

WSDLToJava Error:
  Summary:  Failures: 2, Warnings: 0

  <<<  ERROR!
Part<rstMessage>  in Message
<{http://localhost:8080/openfm/SecurityTokenService/}ISecurityTokenService_IssueToken_InputMessage>
referenced Type
<{http://docs.oasis-open.org/ws-sx/ws-trust/200512}RequestSecurityToken>  can
not be found in the schemas
Part<ProcessRequestSecurityTokenResult>  in Message
<{http://localhost:8080/openfm/SecurityTokenService/}ISecurityTokenService_IssueToken_OutputMessage>
referenced Type
<{http://docs.oasis-open.org/ws-sx/ws-trust/200512}RequestSecurityTokenResponse>
can not be found in the schemas

A document-literal binding in a DESCRIPTION MUST refer, in each of its
soapbind:body element(s),only to wsdl:part element(s) that have been defined
using the element attribute.



org.apache.cxf.tools.common.ToolException:
  Summary:  Failures: 2, Warnings: 0

  <<<  ERROR!
Part<rstMessage>  in Message
<{http://localhost:8080/openfm/SecurityTokenService/}ISecurityTokenService_IssueToken_InputMessage>
referenced Type
<{http://docs.oasis-open.org/ws-sx/ws-trust/200512}RequestSecurityToken>  can
not be found in the schemas
Part<ProcessRequestSecurityTokenResult>  in Message
<{http://localhost:8080/openfm/SecurityTokenService/}ISecurityTokenService_IssueToken_OutputMessage>
referenced Type
<{http://docs.oasis-open.org/ws-sx/ws-trust/200512}RequestSecurityTokenResponse>
can not be found in the schemas

A document-literal binding in a DESCRIPTION MUST refer, in each of its
soapbind:body element(s),only to wsdl:part element(s) that have been defined
using the element attribute.


         at
org.apache.cxf.tools.validator.internal.WSDL11Validator.isValid(WSDL11Validator.java:141)
         at
org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:201)
         at
org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11.JAXWSDefinitionBuilder.validate(JAXWSDefinitionBuilder.java:61)
         at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:167)
         at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:128)
         at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:271)
         at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
         at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
         at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
         at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)

The wsdl to the webservice i'm trying to use is the following:

<?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.8-hudson-123-.
--><!--
    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

    Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved

    The contents of this file are subject to the terms
    of the Common Development and Distribution License
    (the License). You may not use this file except in
    compliance with the License.

    You can obtain a copy of the License at
    https://opensso.dev.java.net/public/CDDLv1.0.html or
    opensso/legal/CDDLv1.0.txt
    See the License for the specific language governing
    permission and limitations under the License.

    When distributing Covered Code, include this CDDL
    Header Notice in each file and include the License file
    at opensso/legal/CDDLv1.0.txt.
    If applicable, add the following below the CDDL Header,
    with the fields enclosed by brackets [] replaced by
    your own identifying information:
    "Portions Copyrighted [year] [name of copyright owner]"

    $Id: famsts.wsdl,v 1.10 2009/10/23 21:22:07 mallas Exp $

--><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:wsap10="http://www.w3.org/2006/05/addressing/wsdl";
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing";
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy";
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/09/policy/addressing";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract";
xmlns:tns="http://localhost:8080/openfm/SecurityTokenService/";
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/";
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex";
xmlns:wsa10="http://www.w3.org/2005/08/addressing";
name="SecurityTokenService"
targetNamespace="http://localhost:8080/openfm/SecurityTokenService/";>
         <wsp:Policy wsu:Id="ISecurityTokenService_policy">
                 <wsp:ExactlyOne>
                         <wsp:All>
                                 <sp:AsymmetricBinding
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                                         <wsp:Policy>
                                                 <sp:InitiatorToken>
                                                         <wsp:Policy>
                                                                 <sp:X509Token
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient";>

                                                                         
<wsp:Policy>
                                                                                 
<sp:WssX509V3Token10 />
                                                                         
</wsp:Policy>
                                                                 </sp:X509Token>
                                                         </wsp:Policy>
                                                 </sp:InitiatorToken>
                                                 <sp:RecipientToken>
                                                         <wsp:Policy>
                                                                 <sp:X509Token
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Always";>

                                                                         
<wsp:Policy>
                                                                                 
<sp:WssX509V3Token10 />
                                                                         
</wsp:Policy>
                                                                 </sp:X509Token>
                                                         </wsp:Policy>
                                                 </sp:RecipientToken>
                                                 <sp:AlgorithmSuite>
                                                         <wsp:Policy>
                                                                 <sp:Basic256 />

                                                         </wsp:Policy>
                                                 </sp:AlgorithmSuite>
                                                 <sp:Layout>
                                                         <wsp:Policy>
                                                                 <sp:Lax />
                                                         </wsp:Policy>
                                                 </sp:Layout>
<!--
                                                 <sp:IncludeTimestamp/>
-->
                                                 <sp:OnlySignEntireHeadersAndBody 
/>

                                         </wsp:Policy>
                                 </sp:AsymmetricBinding>
                                 <sp:Wss10
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                                         <wsp:Policy>
                                                 <sp:MustSupportRefKeyIdentifier 
/>
                                                 <sp:MustSupportRefIssuerSerial 
/>
                                         </wsp:Policy>
                                 </sp:Wss10>
                                 <!--sunsp:DisableStreamingSecurity
xmlns:sunsp="http://schemas.sun.com/2006/03/wss/server"/-->


                                 <wspe:Utf816FFFECharacterEncoding
xmlns:wspe="http://schemas.xmlsoap.org/ws/2004/09/policy/encoding"; />
                                 <wsap10:UsingAddressing />
                         </wsp:All>
                 </wsp:ExactlyOne>
         </wsp:Policy>
         <wsp:Policy wsu:Id="ISecurityTokenService_IssueToken_Input_policy">
                 <wsp:ExactlyOne>
                         <wsp:All>
                                 <sp:SignedParts
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>

                                         <sp:Body />
                                         <!--sp:Header Name="To"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="From"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="FaultTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="ReplyTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="MessageID"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="RelatesTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="Action"
Namespace="http://www.w3.org/2005/08/addressing"/-->
                                 </sp:SignedParts>
                                 <!--sp:EncryptedParts
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                                         <sp:Body/>
                                 </sp:EncryptedParts-->
                         </wsp:All>
                 </wsp:ExactlyOne>
         </wsp:Policy>
         <wsp:Policy wsu:Id="ISecurityTokenService_IssueToken_Output_policy">
                 <wsp:ExactlyOne>

                         <wsp:All>
                                 <sp:SignedParts
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                                         <sp:Body />
                                         <!--sp:Header Name="To"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="From"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="FaultTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="ReplyTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="MessageID"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="RelatesTo"
Namespace="http://www.w3.org/2005/08/addressing"/>
                                         <sp:Header Name="Action"
Namespace="http://www.w3.org/2005/08/addressing"-->
                                 </sp:SignedParts>
                                 <!--sp:EncryptedParts
xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy";>
                                         <sp:Body/>
                                 </sp:EncryptedParts-->
                         </wsp:All>
                 </wsp:ExactlyOne>
         </wsp:Policy>


         <wsdl:types>
                 <xsd:schema
targetNamespace="http://localhost:8080/openfm/SecurityTokenService/Imports";>
                         <xsd:import
schemaLocation="http://kicsakadam:8080/openam_s951/sts/soap11?xsd=1";
namespace="http://schemas.message.com/Message"; />
                 </xsd:schema>
         </wsdl:types>

         <wsdl:message name="ISecurityTokenService_IssueToken_InputMessage">
             <wsdl:part
xmlns:q1="http://docs.oasis-open.org/ws-sx/ws-trust/200512";
name="rstMessage" type="q1:RequestSecurityToken" />
         </wsdl:message>

         <wsdl:message name="ISecurityTokenService_IssueToken_OutputMessage">
             <wsdl:part
xmlns:q2="http://docs.oasis-open.org/ws-sx/ws-trust/200512";
name="ProcessRequestSecurityTokenResult"
type="q2:RequestSecurityTokenResponse" />
         </wsdl:message>

         <wsdl:portType name="ISecurityTokenService">
                 <wsdl:operation name="IssueToken">
                         <wsdl:input
wsap10:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue";
message="tns:ISecurityTokenService_IssueToken_InputMessage" />
                         <wsdl:output
wsap10:Action="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RSTR/Issue";
message="tns:ISecurityTokenService_IssueToken_OutputMessage" />
                 </wsdl:operation>

         </wsdl:portType>
         <wsdl:binding name="ISecurityTokenService_Binding"
type="tns:ISecurityTokenService">
                 <wsp:PolicyReference URI="#ISecurityTokenService_policy" />
                 <soap12:binding
transport="http://schemas.xmlsoap.org/soap/http"; />
                 <wsdl:operation name="IssueToken">
                         <soap12:operation
soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue";
style="document" />
                         <wsdl:input>
                                 <wsp:PolicyReference
URI="#ISecurityTokenService_IssueToken_Input_policy" />
                                 <soap12:body use="literal" />

                         </wsdl:input>
                         <wsdl:output>
                                 <wsp:PolicyReference
URI="#ISecurityTokenService_IssueToken_Output_policy" />
                                 <soap12:body use="literal" />
                         </wsdl:output>
                 </wsdl:operation>
         </wsdl:binding>
         <wsdl:binding name="ISecurityTokenService_BindingSoap11"
type="tns:ISecurityTokenService">
                  <wsp:PolicyReference URI="#ISecurityTokenService_policy" />

                  <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"; />
                  <wsdl:operation name="IssueToken">
                          <soap:operation
soapAction="http://docs.oasis-open.org/ws-sx/ws-trust/200512/RST/Issue";
style="document" />
                          <wsdl:input>
                                  <wsp:PolicyReference
URI="#ISecurityTokenService_IssueToken_Input_policy" />
                                  <soap:body use="literal" />
                          </wsdl:input>
                          <wsdl:output>
                                  <wsp:PolicyReference
URI="#ISecurityTokenService_IssueToken_Output_policy" />

                                  <soap:body use="literal" />
                          </wsdl:output>
                  </wsdl:operation>
         </wsdl:binding>
         <wsdl:service name="SecurityTokenService">
                 <wsdl:port name="ISecurityTokenService_Port"
binding="tns:ISecurityTokenService_Binding">
                         <soap12:address
location="http://kicsakadam:8080/openam_s951/sts"; />
                 </wsdl:port>
                 <wsdl:port name="ISecurityTokenService_PortSoap11"
binding="tns:ISecurityTokenService_BindingSoap11">

                         <soap:address
location="http://kicsakadam:8080/openam_s951/sts/soap11"; />
                  </wsdl:port>
         </wsdl:service>
</wsdl:definitions>

Could you help me please with a solution to my problem? If CXF does not
support some required feature, or it is a bug, could you help me by altering
the wsdl to a form, that will work with CXF?
Thank you for the help in advance!

Tibor Kerek
--
View this message in context: 
http://cxf.547215.n5.nabble.com/wsdl2java-client-generation-error-with-WS-Trust-tp3381396p3381396.html
Sent from the cxf-issues mailing list archive at Nabble.com.


Reply via email to