2017-12-14 4 views
0

클라이언트를 웹 서비스에 연결하고 서버에서 SetFlight 메서드를 사용하려고합니다.Intellij의 WSDL 클라이언트가 코드를 생성했습니다.

환경은 Intellij Ultimate, Java 7 및 JAXWS입니다. WSDL로부터 클래스 생성이 완료되었습니다. 내가 https://docs.oracle.com/javaee/5/tutorial/doc/bnayn.html 그러나이 다른 클라이언트를 구현하는 몇 가지 예를 보았다

@WebService(name = "IFOService", targetNamespace = "urn:fo.com.au/schema/common") 
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) 
@XmlSeeAlso({ 
    ObjectFactory.class 
}) 
public interface IFOService { 


    /** 
    * 
    * @param parameters 
    * @return 
    *  returns svc.SetFlightResponse 
    */ 
    @WebMethod(operationName = "SetFlight", action = "http://fo.com.au/SetFlight") 
    @WebResult(name = "SetFlightResponse", targetNamespace = "urn:fo.com.au/schema/common/types", partName = "parameters") 
    public SetFlightResponse SetFlight(
     @WebParam(name = "SetFlightRequest", targetNamespace = "urn:fo.com.au/schema/common/types", partName = "parameters") 
     SetFlightRequest parameters); 

} 

@WebServiceClient(name = "FOService", targetNamespace = "http://temporaryuri.org.au/", wsdlLocation = "http://fovanil.com/FOService.svc?wsdl") 
    public class FOService 
    extends Service 
     { 

     private final static URL FOSERVICE_WSDL_LOCATION; 
     private final static WebServiceException FOSERVICE_EXCEPTION; 
     private final static QName FOSERVICE_QNAME = new QName("http://temporaryuri.org.au/", "FOService"); 

      static { 
... 

그리고 IFO 서비스 : 생성 된 클래스 중

나는 두 가지 서비스가 있습니다.

IFOSerice service = new IFOService(); 
service.SetFlight(someinstanceofflight); //setFlight is not a available method 

가 어떻게 클라이언트를 확인하고 SetFlight 방법을 사용합니까 :

나는이 될 것이라고 사용하여 생각이나 했 겠어요?

+0

? CXF를 사용하여이 작업을 수행 할 때 클라이언트 구현 대 서버 구현을 생성하도록 지시해야합니다. 불행히도이 분야의 Intellij에 대해서는별로 익숙하지 않습니다. – Namphibian

답변

0

이 코드는 일 :

SetFORequest request = new SetFORequest(); 
    SetFOResponse response = new SetFOResponse(); 
    request.setFO(flight); 
    FOService foService = new FOService(); 
    IfoService ifoService = foService.getWSHttpBindingIFOService(); 
    ifoService.setFO(request); 
당신은 WSDL에서 클래스를 생성 않았다 어떻게
관련 문제