2015-12-29 4 views
1

Я уже два дня борется с этим, поэтому я должен обратиться за помощью.CXF: Метод WSDL не найден

У меня есть многопользовательский проект Maven с использованием Spring.

GesAction 
-ihm 
-metier 
-dao 
-entite 
-ws 

Весь проект скомпилирован, никаких проблем с mvn: install.

Проблема заключается в модуле Ws: у меня может быть проблема с конфигурацией CXF: Когда я развернуть модуль на моем коте (v7) Я эти предупреждений для каждой операции на моем WSDL:

déc. 29, 2015 10:02:56 AM org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean initializeWSDLOperations 
AVERTISSEMENT: No method was found for the WSDL operation {http://ws.gesaction.interiale.fr}Authentification. 

Но, конечно, эти операции включены в WSDL ... Это сводит меня с ума.

Вот конфигурационные файлы:

WS-context.xml

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:context="http://www.springframework.org/schema/context" 
    xsi:schemaLocation=" 
     http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-4.1.xsd  
     http://www.springframework.org/schema/context  
     http://www.springframework.org/schema/context/spring-context-4.1.xsd "> 

    <context:component-scan base-package="fr.interiale.gesaction.ws.impl"/> 
    <context:annotation-config /> 
    <import resource="classpath:metier-context.xml"/> 
    <import resource="cxf-context.xml" /> 

</beans> 

CXF-context.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:jaxws="http://cxf.apache.org/jaxws" 
    xmlns:soap="http://cxf.apache.org/bindings/soap" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xsi:schemaLocation=" 
     http://www.springframework.org/schema/beans 
     http://www.springframework.org/schema/beans/spring-beans-4.1.xsd 
     http://www.springframework.org/schema/context 
     http://www.springframework.org/schema/context/spring-context-4.1.xsd 
     http://cxf.apache.org/bindings/soap 
     http://cxf.apache.org/schemas/configuration/soap.xsd 
     http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> 

<!-- <bean class="org.springframework.context.annotation.CommonAnnotationBeanPostProcessor"/> --> 

    <jaxws:endpoint 
     id="interialActionSocialAuthentification" 
     implementor="fr.interiale.gesaction.ws.InterialActionSocialAuthentification" 
     endpointName="tns:InterialActionSocialAuthentificationPort" 
     serviceName="tns:InterialActionSocialAuthentificationService" 
     address="/InterialActionSocialAuthentificationPort" 
     xmlns:tns="http://ws.gesaction.interiale.fr" 
     wsdlLocation="wsdl/interialactionsocialauthentification.wsdl"> 
    </jaxws:endpoint> 

</beans> 

И теперь WSDL:

<?xml version="1.0" encoding="UTF-8"?> 
<wsdl:definitions 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:tns="http://ws.gesaction.interiale.fr" 
    name="interialactionsocialauthentification" 
    targetNamespace="http://ws.gesaction.interiale.fr" 
    > 

    <wsdl:types> 
     <schema xmlns="http://www.w3.org/2001/XMLSchema"> 
      <import namespace="http://ws.gesaction.interiale.fr" schemaLocation="interialactionsocialauthentification_schema1.xsd" /> 
     </schema> 
    </wsdl:types> 


    <wsdl:message name="Authentification"> 
     <wsdl:part name="parameters" element="tns:Authentification"></wsdl:part> 
    </wsdl:message> 
    <wsdl:message name="AuthentificationResponse"> 
     <wsdl:part name="parameters" element="tns:AuthentificationResponse"></wsdl:part> 
    </wsdl:message> 

    <wsdl:message name="remiseANullTokenResponse"> 
     <wsdl:part name="parameters" element="tns:remiseANullTokenResponse"> 
     </wsdl:part> 
    </wsdl:message> 
    <wsdl:message name="remiseANullToken"> 
     <wsdl:part name="parameters" element="tns:remiseANullToken"> 
     </wsdl:part> 
    </wsdl:message> 
    <wsdl:message name="AuthentificationParTokenResponse"> 
     <wsdl:part name="parameters" element="tns:AuthentificationParTokenResponse"> 
     </wsdl:part> 
    </wsdl:message> 
    <wsdl:message name="AuthentificationParToken"> 
     <wsdl:part name="parameters" element="tns:AuthentificationParToken"> 
     </wsdl:part> 
    </wsdl:message> 
    <wsdl:message name="Exception"> 
     <wsdl:part name="Exception" element="tns:Exception"> 
     </wsdl:part> 
    </wsdl:message> 

    <wsdl:portType name="InterialActionSocialAuthentification"> 

     <wsdl:operation name="Authentification"> 
      <wsdl:input name="Authentification" message="tns:Authentification"></wsdl:input> 
      <wsdl:output name="AuthentificationResponse" message="tns:AuthentificationResponse"></wsdl:output> 
      <wsdl:fault name="Exception" message="tns:Exception"></wsdl:fault> 
     </wsdl:operation> 

     <wsdl:operation name="remiseANullToken"> 
      <wsdl:input name="remiseANullToken" message="tns:remiseANullToken"> 
      </wsdl:input> 
      <wsdl:output name="remiseANullTokenResponse" message="tns:remiseANullTokenResponse"> 
      </wsdl:output> 
      <wsdl:fault name="Exception" message="tns:Exception"> 
      </wsdl:fault> 
     </wsdl:operation> 
     <wsdl:operation name="AuthentificationParToken"> 
      <wsdl:input name="AuthentificationParToken" message="tns:AuthentificationParToken"> 
      </wsdl:input> 
      <wsdl:output name="AuthentificationParTokenResponse" 
       message="tns:AuthentificationParTokenResponse"> 
      </wsdl:output> 
      <wsdl:fault name="Exception" message="tns:Exception"> 
      </wsdl:fault> 
     </wsdl:operation> 
    </wsdl:portType> 

    <wsdl:binding name="InterialActionSocialAuthentificationServiceSoapBinding" 
     type="tns:InterialActionSocialAuthentification"> 
     <soap:binding style="document" 
      transport="http://schemas.xmlsoap.org/soap/http" /> 
     <wsdl:operation name="Authentification"> 
      <soap:operation soapAction="" style="document" /> 
      <wsdl:input name="Authentification"> 
       <soap:body use="literal" /> 
      </wsdl:input> 
      <wsdl:output name="AuthentificationResponse"> 
       <soap:body use="literal" /> 
      </wsdl:output> 
      <wsdl:fault name="Exception"> 
       <soap:fault name="Exception" use="literal" /> 
      </wsdl:fault> 
     </wsdl:operation> 
     <wsdl:operation name="AuthentificationParToken"> 
      <soap:operation soapAction="" style="document" /> 
      <wsdl:input name="AuthentificationParToken"> 
       <soap:body use="literal" /> 
      </wsdl:input> 
      <wsdl:output name="AuthentificationParTokenResponse"> 
       <soap:body use="literal" /> 
      </wsdl:output> 
      <wsdl:fault name="Exception"> 
       <soap:fault name="Exception" use="literal" /> 
      </wsdl:fault> 
     </wsdl:operation> 
     <wsdl:operation name="remiseANullToken"> 
      <soap:operation soapAction="" style="document" /> 
      <wsdl:input name="remiseANullToken"> 
       <soap:body use="literal" /> 
      </wsdl:input> 
      <wsdl:output name="remiseANullTokenResponse"> 
       <soap:body use="literal" /> 
      </wsdl:output> 
      <wsdl:fault name="Exception"> 
       <soap:fault name="Exception" use="literal" /> 
      </wsdl:fault> 
     </wsdl:operation> 
    </wsdl:binding> 

    <wsdl:service name="InterialActionSocialAuthentificationService"> 
     <wsdl:port name="InterialActionSocialAuthentificationPort" 
      binding="tns:InterialActionSocialAuthentificationServiceSoapBinding"> 
      <soap:address location="http://localhost:8080/gesAction-ws" /> 
     </wsdl:port> 
    </wsdl:service> 

</wsdl:definitions> 

XSD refered в WSDL:

<xs:schema 
    xmlns:tns="http://ws.gesaction.interiale.fr" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    attributeFormDefault="unqualified" 
    elementFormDefault="unqualified" 
    targetNamespace="http://ws.gesaction.interiale.fr"> 

    <xs:element name="Authentification" type="tns:Authentification"/> 
    <xs:element name="AuthentificationParToken" type="tns:AuthentificationParToken"/> 
    <xs:element name="AuthentificationParTokenResponse" type="tns:AuthentificationParTokenResponse"/> 
    <xs:element name="AuthentificationResponse" type="tns:AuthentificationResponse"/> 
    <xs:element name="remiseANullToken" type="tns:remiseANullToken"/> 
    <xs:element name="remiseANullTokenResponse" type="tns:remiseANullTokenResponse"/> 
    <xs:element name="utilisateur" type="tns:utilisateur"/> 

    <xs:complexType name="Authentification"> 
    <xs:sequence> 
     <xs:element minOccurs="0" name="arg0" type="xs:string"/> 
     <xs:element minOccurs="0" name="arg1" type="xs:string"/> 
     <xs:element minOccurs="0" name="arg2" type="xs:boolean"/> 
    </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="AuthentificationResponse"> 
    <xs:sequence> 
     <xs:element minOccurs="0" name="return" type="tns:utilisateur"/> 
    </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="utilisateur"> 
    <xs:sequence> 
     <xs:element minOccurs="0" name="idutilisateur" type="xs:decimal"/> 
     <xs:element minOccurs="0" name="nom" type="xs:string"/> 
     <xs:element minOccurs="0" name="prenom" type="xs:string"/> 
     <xs:element minOccurs="0" name="login" type="xs:string"/> 
     <xs:element minOccurs="0" name="mdp" type="xs:string"/> 
     <xs:element minOccurs="0" name="profil" type="xs:string"/> 
     <xs:element minOccurs="0" name="token" type="xs:string"/> 
     <xs:element minOccurs="0" name="tokenTimestamp" type="tns:timestamp"/> 
     <xs:element minOccurs="0" name="maritalStatus" type="xs:string"/> 
     <xs:element minOccurs="0" name="profilSummary" type="xs:string"/> 
     <xs:element minOccurs="0" name="birthday" type="xs:dateTime"/> 
     <xs:element minOccurs="0" name="ville" type="xs:string"/> 
     <xs:element minOccurs="0" name="codePostal" type="xs:string"/> 
     <xs:element minOccurs="0" name="mobileNumber" type="xs:string"/> 
     <xs:element minOccurs="0" name="email" type="xs:string"/> 
     <xs:element minOccurs="0" name="civilite" type="xs:string"/> 
    </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="timestamp"> 
    <xs:sequence> 
     <xs:element name="nanos" type="xs:int"/> 
    </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="remiseANullToken"> 
    <xs:sequence> 
     <xs:element name="arg0" type="xs:int"/> 
    </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="remiseANullTokenResponse"> 
    <xs:sequence> 
     <xs:element name="return" type="xs:boolean"/> 
    </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="AuthentificationParToken"> 
    <xs:sequence> 
     <xs:element minOccurs="0" name="arg0" type="xs:string"/> 
    </xs:sequence> 
    </xs:complexType> 
    <xs:complexType name="AuthentificationParTokenResponse"> 
    <xs:sequence> 
     <xs:element minOccurs="0" name="return" type="tns:utilisateur"/> 
    </xs:sequence> 
    </xs:complexType> 
    <xs:element name="Exception" type="tns:Exception"/> 
    <xs:complexType name="Exception"> 
    <xs:sequence> 
     <xs:element minOccurs="0" name="message" type="xs:string"/> 
    </xs:sequence> 
    </xs:complexType> 
</xs:schema> 

Я могу развернуть это правильно и отправить некоторый запрос SOAP с GUI SOAP инструментом.

Но я не могу эту работу: '(

Если что-то нужно, чтобы помочь для понимания я буду редактировать свой пост с ним

Большое спасибо за помощь

ответ

1

На самом деле я пропускал поколение CXF кода ... Эта часть генерации сервисный интерфейс со всеми необходимыми аннотациями (@WebService и т. д.)

+0

Если вы не забыли, можете ли вы расширить свое решение? – geg

+0

Вам нужна операция maven, которая запускает генерацию кода (ищите что-нибудь о плагине maven: cxf-codegen-plugin) – Deunz

1

Вам нужно.. . на карту конечной метод с «Аутентификация», так что весна будет обнаруживать и выполнять несколько раз просил от мыла клиента

весной мы делаем это следующим образом: -

@Endpoint
общественного класса MyEndpoint {

@PayloadRoot(localPart="Authentification", namespace=SOME_TARGET_NAMESPACE) 
public @ResponsePayload MyResponse myMethod(@RequestPayload MyRequest request){ 

} 

}

Добавить <context:component-scan base-package="package-name" /> в весенне-config.xml

+0

Во-первых: большое вам спасибо за помощь. Таким образом, для он alreayd в моем ws-context.xml, который является конфигурационным файлом Spring. Затем о анонсировании @PayloadRoot. В проекте я не знаю, почему, но нет такой аннотации. По-видимому, все это делается через Autowired контроллеры – Deunz

+0

Хорошо, вы, возможно, придерживались некоторого другого подхода к настройке весны, это нормально.Но вам нужно поместить сопоставление где-нибудь в приложении с помощью xml или аннотации, поэтому весна будет знать, какой java-метод выполнить для данной локальной части запроса. Просто дайте ему попробовать, добавив аннотацию @PayloadRoot выше метода, который вы хотите выполнить, как только будет выполнен запрос. –

+0

сделаю: обратная связь как можно скорее. – Deunz

Смежные вопросы