Skip to Content
0
Former Member
Mar 10, 2009 at 05:46 AM

Error calling[Standalone proxy]uFF1Aexternal web service(SSL + anonymous)

44 Views

hi SDNer

I use Standalone proxy to call external web service(SSL + anonymous)

web service Endpoint is : https://localhost:8443/HelloWorldService/services/HelloWorld

NWDS VERSION: NWDS-IDE-700SP12

Standalone SEI is :

HelloWorld

HelloWorldHttpBindingStub

HelloWorldImpl

HelloWorldPortType

Calling Code as following:

			//1. Access the implementation class of the service interface
			HelloWorldImpl ws = new HelloWorldImpl();
			//2. Create the instance of a logical port
			Remote remote = ws.getLogicalPort();

			HelloWorldHttpBindingStub stub = (HelloWorldHttpBindingStub) remote;
			//3. 
			SecurityProtocol securityProtocol =
				(SecurityProtocol) stub._getGlobalProtocols().getProtocol(
					"SecurityProtocol");
			AuthenticationContext ac =
				securityProtocol.getAuthenticationContext();
			ac.setIgnoreSSLServerCertificate(true);

			//4. invoke the business methods
			String ver = stub.example(str1, str2);

Exception is :

java.rmi.RemoteException: Service call exception; nested exception is: 
	iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
	at com.sap.ws.HelloWorldHttpBindingStub.example(HelloWorldHttpBindingStub.java:84)
	at com.sap.ws.HelloWorldHttpBindingStub.example(HelloWorldHttpBindingStub.java:94)
	at TestHelloWorld.wsHelloWorld(TestHelloWorld.java:55)
	at TestHelloWorld.main(TestHelloWorld.java:24)
Caused by: iaik.security.ssl.SSLException: Peer sent alert: Alert Fatal: handshake failure
	at iaik.security.ssl.r.f(Unknown Source)
	at iaik.security.ssl.x.b(Unknown Source)
	at iaik.security.ssl.x.a(Unknown Source)
	at iaik.security.ssl.r.d(Unknown Source)
	at iaik.security.ssl.SSLTransport.startHandshake(Unknown Source)
	at iaik.security.ssl.SSLTransport.getOutputStream(Unknown Source)
	at iaik.security.ssl.SSLSocket.getOutputStream(Unknown Source)
	at com.sap.engine.services.webservices.jaxm.soap.HTTPSocket.initStreamsFromSocket(HTTPSocket.java:669)
	at com.sap.engine.services.webservices.jaxm.soap.HTTPSocket.initializeStreams(HTTPSocket.java:470)
	at com.sap.engine.services.webservices.jaxm.soap.HTTPSocket.getOutputStream(HTTPSocket.java:427)
	at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.HTTPTransport.getRequestStream(HTTPTransport.java:355)
	at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.outputMessage(MimeHttpBinding.java:550)
	at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.call(MimeHttpBinding.java:1432)
	at com.sap.ws.HelloWorldHttpBindingStub.example(HelloWorldHttpBindingStub.java:77)
	... 3 more