2011-01-11 5 views
0

웹 서비스 내에서 웹 서비스를 트리거 할 수 있습니까? 빈에서다른 웹 서비스를 트리거하는 웹 서비스?

/** 
* Web service operation 
*/ 
@WebMethod(operationName = "bookFlight") 
public String bookFlight(@WebParam(name = "destination") 
String destination, @WebParam(name = "seats") 
int seats) { 
    try { 
     String ret = composite.bookFlight(destination, seats); 
      if(composite.checkDistance(destination) > 15) 
      { 

      } 
     return ret; 
    } catch (FileNotFoundException_Exception ex) { 
     Logger.getLogger(compositeBookings.class.getName()).log(Level.SEVERE, null, ex); 
    } catch (InterruptedException_Exception ex) { 
     Logger.getLogger(compositeBookings.class.getName()).log(Level.SEVERE, null, ex); 
    } 
    return null; 
} 

만약 내가 다른 웹 서비스를 실행하는 데 필요한 함수 본문 ...

모든 응시자? 여기

내가 if 문에서 실행하는 데 필요한 웹 서비스입니다

/** 
* Web service operation 
*/ 
@WebMethod(operationName = "bookHotel") 
public String bookHotel(@WebParam(name = "destination") 
String destination, @WebParam(name = "rooms") 
int rooms) {   
    try { 
     String ret = composite.bookHotel(destination, rooms);    
     return ret; 
    } catch (myhotels.InterruptedException_Exception ex) { 
     Logger.getLogger(compositeBookings.class.getName()).log(Level.SEVERE, null, ex); 
    } catch (myhotels.FileNotFoundException_Exception ex) { 
     Logger.getLogger(compositeBookings.class.getName()).log(Level.SEVERE, null, ex); 
    }   
    return null; 
} 

답변

1

당신이 전화하고 거기에서 해당 서비스를 호출 할 서비스의 클라이언트를 생성 할 수있다

하지만 서비스 코드에 액세스 할 수 있다면 거기에서 SOAP을 호출하는 대신 서비스 계층을 직접 사용하십시오.

+0

코드에 액세스 할 수 있지만 부모 서비스처럼 사용자 입력이 필요합니다 ... –

+0

'그러나 부모 서비스처럼 사용자 입력이 필요합니다. '이 시점을 얻지 못하면 서비스가 매개 변수를 사용하고 있습니까? 이것이 당신이 의미하는 것보다 간단한 자바 메서드처럼 직접 매개 변수를 전달할 수 있습니다. –

+0

예, 매개 변수를 사용하지 않습니다. 사용자 정의, 첫 번째와 동일 - @ WebParam의 –

관련 문제