2012-04-08 1 views
0

Ich bin neu in Web-Services, ich ein Buch gekauft und begann davon zu lernen, die WSDL ist:Web Services-Port {http://ttdev.com/ss}p1 nicht gefunden

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ttdev.com/ss" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SimpleService" targetNamespace="http://ttdev.com/ss"> 
    <wsdl:types> 
    <xsd:schema targetNamespace="http://ttdev.com/ss"> 
     <xsd:element name="concatRequest"> 
     <xsd:complexType> 
      <xsd:sequence> 
      <xsd:element name="s1" type="xsd:string" /> 
      <xsd:element name="s2" type="xsd:string"></xsd:element> 
      </xsd:sequence> 
     </xsd:complexType> 
     </xsd:element> 
     <xsd:element name="concatResponse" type="xsd:string"> 

     </xsd:element> 
    </xsd:schema> 
    </wsdl:types> 
    <wsdl:message name="concatRequest"> 
    <wsdl:part element="tns:concatRequest" name="parameters"/> 
    </wsdl:message> 
    <wsdl:message name="concatResponse"> 
    <wsdl:part element="tns:concatResponse" name="parameters"/> 
    </wsdl:message> 
    <wsdl:portType name="SimpleService"> 
    <wsdl:operation name="concat"> 
     <wsdl:input message="tns:concatRequest"/> 
     <wsdl:output message="tns:concatResponse"/> 
    </wsdl:operation> 
    </wsdl:portType> 
    <wsdl:binding name="SimpleServiceSOAP" type="tns:SimpleService"> 
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
    <wsdl:operation name="concat"> 
     <soap:operation soapAction="http://ttdev.com/ss/NewOperation"/> 
     <wsdl:input> 
     <soap:body use="literal"/> 
     </wsdl:input> 
     <wsdl:output> 
     <soap:body use="literal"/> 
     </wsdl:output> 
    </wsdl:operation> 
    </wsdl:binding> 
    <wsdl:service name="SimpleService"> 
    <wsdl:port binding="tns:SimpleServiceSOAP" name="p1"> 
     <soap:address location="http://localhost:8080/ss/p1"/> 
    </wsdl:port> 
    </wsdl:service> 
</wsdl:definitions> 

I führen sie den SimpleService_P1_Server, es s arbeiten, aber wenn ich den Client ausführen: SimpleService_P1_Client ich habe diese Ausnahme:

Apr 8, 2012 9:51:47 AM com.ttdev.ss.SimpleService_Service <clinit> 
INFO: Can not initialize the default wsdl from src/main/resources/SimpleService.wsdl 
Exception in thread "main" javax.xml.ws.WebServiceException: Port {http://ttdev.com/ss}p1 not found. 
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:328) 
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:319) 
    at javax.xml.ws.Service.getPort(Unknown Source) 
    at com.ttdev.ss.SimpleService_Service.getP1(SimpleService_Service.java:56) 
    at com.ttdev.ss.SimpleService_P1_Client.main(SimpleService_P1_Client.java:49) 

Dank, Ihre Hilfe zu schätzen.

Antwort

0

Ich habe auch ein ähnliches Problem vor einiger Zeit konfrontiert. Sie können ein Präfix "file:" vor "src/main/resources" verwenden. Hier ist der resultierende Code:

WSDLToJava.main(new String[] { "-client", "-d", "src/main/java", 
      "file:src/main/resources/SimpleService.wsdl" }); 
Verwandte Themen