2010-04-03 7 views
0

여기에서 Java 웹 서비스 클라이언트를 생성했습니다. ->http://api.search.live.net/search.wsdl .. 반환 값을 검색하고 나열하려고합니다. ı가 결과를 표시하는 방법은 무엇입니까?웹 서비스 클라이언트 Java

내 코드는 다음과 같습니다

import java.rmi.RemoteException; 
import com.microsoft.schemas.LiveSearch._2008._03.Search.*; 

public class searchtry { 
public static void main(String[] args) throws RemoteException { 
    LiveSearchPortTypeProxy client=new LiveSearchPortTypeProxy(); 
    SearchRequest request=new SearchRequest(); 
    SearchRequestType1 type1=new SearchRequestType1(); 
    sorgu.setAppId("*********************************"); //Windows Live gave this id for using that service 
    sorgu.setSources(new SourceType[]{SourceType.Web}); 
    sorgu.setQuery("Java"); 
    aratip.setParameters(request); 
    SearchResponseType0 answer= client.search(type1); 
    System.out.println(answer.toString()); 
} 
+0

println 출력은 무엇입니까? –

+0

코드를 형식화하십시오. 쉽게 ... – miku

+0

가능한 복제본 http://stackoverflow.com/questions/2567849/java-web-service-client-from-microsoft-live-search – nos

답변

1

당신이 생성 된 클래스 SearchResponseType0보고 toString 메소드 할 (현재의 경우) 무엇을 볼 수 있습니다. 그렇지 않으면 다른 방법을 사용하여 객체의 값을 인쇄해야합니다. int 결과로 개별 결과 항목에 액세스 할 수 있습니다.