2011-09-19 8 views
0

이 WSDL 파일이 이미 있습니다. 내가 사용하는 경우 Axis2를 도구 WSDL2Java의 -uri StockQuoteService.wsdlAxis2 : wsdl2java 도구 명령 줄

<wsdl:definitions xmlns:axis2="http://quickstart.samples/" 
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 

xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
    xmlns:ns="http://quickstart.samples/xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://quickstart.samples/"> 
    <wsdl:types> 
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    attributeFormDefault="qualified" elementFormDefault="qualified" 
    targetNamespace="http://quickstart.samples/xsd"> 
    <xs:element name="getPrice"> 
    <xs:complexType> 
    <xs:sequence> 
    <xs:element name="symbol" nillable="true" type="xs:string" /> 
    </xs:sequence> 
    </xs:complexType> 
    </xs:element> 
    <xs:element name="getPriceResponse"> 
    <xs:complexType> 
    <xs:sequence> 
    <xs:element name="return" nillable="true" type="xs:double" /> 
    </xs:sequence> 
    </xs:complexType> 
    </xs:element> 
    </xs:schema> 
    </wsdl:types> 
    <wsdl:message name="getPriceMessage"> 
    <wsdl:part name="part1" element="ns:getPrice" /> 
    </wsdl:message> 
    <wsdl:message name="getPriceResponseMessage"> 
    <wsdl:part name="part1" element="ns:getPriceResponse" /> 
    </wsdl:message> 
    <wsdl:portType name="StockQuoteServicePortType"> 
    <wsdl:operation name="getPrice"> 
    <wsdl:input message="axis2:getPriceMessage" /> 
    <wsdl:output message="axis2:getPriceResponseMessage" /> 
    </wsdl:operation> 
    </wsdl:portType> 
    <wsdl:binding name="StockQuoteServiceSOAP11Binding" type="axis2:StockQuoteServicePortType"> 
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" 
    style="document" /> 
    <wsdl:operation name="getPrice"> 
    <soap:operation soapAction="urn:getPrice" style="document" /> 
    <wsdl:input> 
    <soap:body use="literal" namespace="http://quickstart.samples/" /> 
    </wsdl:input> 
    <wsdl:output> 
    <soap:body use="literal" namespace="http://quickstart.samples/" /> 
    </wsdl:output> 
    </wsdl:operation> 
    </wsdl:binding> 
    <wsdl:service name="StockQuoteService"> 
    <wsdl:port name="StockQuoteServiceSOAP11port" binding="axis2:StockQuoteServiceSOAP11Binding"> 
    <soap:address 
    location="http://localhost:8080/axis2/services/StockQuoteService" /> 
    </wsdl:port> 
    </wsdl:service> 
    </wsdl:definitions> 

내가 뭘 기대 한 것은 내가 WSDL2Java의 -uri 서 StockQuoteService를 실행할 때

package samples.quickstart; 

import java.util.HashMap; 

public class StockQuoteService { 
    private HashMap map = new HashMap(); 

    public double getPrice(String symbol) { 
     Double price = (Double) map.get(symbol); 
     if(price != null){ 
      return price.doubleValue(); 
     } 
     return 42.00; 
    } 


} 

일해야하지만 자바 코드입니다. wsdl

위의 Java 파일을 기대하는 java 파일의 코드가 있습니다.

,363,210

1.StockQuoteServiceCallbackHandler 2.StockQuoteServiceStub

하지만 StockQuoteService.java

패키지 samples.quickstart;

import java.util.HashMap; 

public class StockQuoteService { 
    private HashMap map = new HashMap(); 

    public double getPrice(String symbol) { 
     Double price = (Double) map.get(symbol); 
     if(price != null){ 
      return price.doubleValue(); 
     } 
     return 42.00; 
    } 


} 

왜 그런지 말해 주시겠습니까 ??

답변

0

wsdl2java 명령은 축 2 서비스 (즉 스텁 및 콜백 처리기 클래스)를 호출하는 클라이언트 코드를 생성합니다. getPrice() 메소드 내의 비즈니스 로직은 wsdl과 아무 관련이 없습니다.

+0

나도 똑같은 문제에 직면 해있다. 스텁 클래스에서는 porttype에서 wsdl의 실제 작업을 찾을 수있다. – Dhinakar

관련 문제