2010-01-22 2 views
5

축이있는 웹 서비스를 사용하고 있습니다. 내가 호출하는 모든 웹 서비스 메서드에서 NoEndpointException이 발생합니다.NoEndPointException을 던지는 Java Axis Webservice 스텁

이 코드에서 생성됩니다.

if (super.cachedEndpoint == null) { 
    throw new org.apache.axis.NoEndPointException(); 
} 

그래서 끝점을 올바르게 설정하지 않은 것 같습니다.

이 내가 스텁을 인스턴스화 한 방법입니다

MyService_ServiceLocator myService_ServiceLocator = new MyService_ServiceLocator(); 
MyService_PortType webservice = new MYServiceSOAPStub(myService_ServiceLocator); 

뭔가이 문제입니다 가정합니다. 웹 서비스 주소를 전달해야합니까? 이미 스텁에 통합 된 것처럼 보입니다.

답변

7

축 버전에 따라 다를 수 있지만 (버전 1.4를 사용하고 있습니다.) 로케이터에서 getYourPortType() 메서드를 사용하는 것이 좋습니다. 웹 서비스 URL (생성 된 파일에 저장 됨)을 제공 할 필요가 없습니다.

는 그런 일이 될 것입니다 샘플을 사용하여 :

MyService_ServiceLocator myService_ServiceLocator = new MyService_ServiceLocator(); 
MyService_PortType webservice = myService_ServiceLocator.getMyService_PortType(); 
+1

는 WSDL에서 자바 파일을 생성 한 후 모든 웹 서비스에 액세스하는 방법에 대한 튜토리얼이있다. ? –