Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di Poker1
    Registrato dal
    Jul 2002
    Messaggi
    479

    [JAVA] Primi approcci con le servlet

    ciao a tutti!!!
    sto iniziando a programmare le servlet ma ho qualche problema. Vi posto il file .wsdl e il bean

    servizio.wsdl

    codice:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <wsdl:definitions targetNamespace="http://www.bank.com/ns"
        xmlns:apachesoap="http://xml.apache.org/xml-soap" 
        xmlns:bns="http://www.bank.org/ns"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    
        <wsdl:types>
            <schema elementFormDefault="qualified" targetNamespace="http://www.bank.com/ns"
                xmlns="http://www.w3.org/2001/XMLSchema"
                xmlns:apachesoap="http://xml.apache.org/xml-soap"
                xmlns:tns="http://example" xmlns:intf="http://example"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
            
                
    	    
    	    
                <xsd:element name="saldo" type="bns:saldoType" />
    
       	    <xsd:complexType name="saldoType">
                   <xsd:sequence>
                      <xsd:element name="account" type="bns:accountType" />
                   </xsd:sequence>
                </xsd:complexType>
    
                <xsd:simpleType name="accountType">
                   <xsd:restriction base="xsd:string">
                      <xsd:pattern value="[0-9]{7}[A-Z]{4}" />
                   </xsd:restriction>
                </xsd:simpleType>
    
                
    
                <xsd:element name="saldoResponse" type="bns:saldoResponseType" />
    
                <xsd:complexType name="saldoResponseType">
                   <xsd:sequence>
                      <xsd:element name="saldo" type="xsd:positiveInteger" />
                   </xsd:sequence>
                </xsd:complexType>
            </schema>
        </wsdl:types>
        
        
    
        <wsdl:message name="richiestaSaldo">
            <wsdl:part element="bns:saldo" name="richiestaSaldo"/>
        </wsdl:message>
    
       <wsdl:message name="rispostaSaldo">
            <wsdl:part element="bns:saldoResponse" name="rispostaSaldo"/>
        </wsdl:message>
        
    
        <wsdl:portType name="saldoInterface">
            <wsdl:operation name="saldo">
                <wsdl:input message="bns:richiestaSaldo" />
                <wsdl:output message="bns:rispostaSaldo" />
            </wsdl:operation>
        </wsdl:portType>
        
    
           
        <wsdl:binding name="saldoInterfaceBinding" type="bns:saldoInterface">
            <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
            <wsdl:operation name="saldo">
                <wsdlsoap:operation soapAction=""/>
                <wsdl:input>
                    <wsdlsoap:body use="literal"/>
                </wsdl:input>
                <wsdl:output>
                    <wsdlsoap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
          
        <wsdl:service name="saldoService">
            <wsdl:port binding="bns:saldoInterfaceBinding" name="saldoInterfaceBinding">
                <wsdlsoap:address location="http://www.bank.org/saldo"/>
            </wsdl:port>
        </wsdl:service>
        
    </wsdl:definitions>
    ecco il beans:

    codice:
    <?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:cxf="http://cxf.apache.org/core" 
    	xsi:schemaLocation="http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
            http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
            http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
    
    	<import resource="classpath:META-INF/cxf/cxf.xml" />
    	<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
    	<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
    
        <jaxws:endpoint 
              id="bank" 
              serviceName="bns:saldoService"
              implementor="isi.services.Bank" 
              address="/sportello" 
              xmlns:bns="http://www.bank.org/ns"
    	  	  wsdlLocation="WEB-INF/servizio.wsdl"/>
     
    </beans>
    quando faccio il deploy su tomcat mi da questo errore:

    codice:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bank': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for service {http://www.bank.org/ns}saldoService.
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.
    dice di non riuscire a trovare il servizio saldoService... qualcuno può aiutarmi ?
    Non riscrivere la ruota, usa le librerie.
    by Bjarne Stroustrup
    EIDON SOFT MEMBER

  2. #2
    Utente di HTML.it
    Registrato dal
    Mar 2009
    Messaggi
    174
    Ciao Poker1 hai percaso risolto il problema perchè succede anche a me e non so dove sbattere per risolverlo.

    PS.: E' l'esercitazione di ISI? sto facendo anch'io

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.