Re: newbie question about WSDL2JAVA
Hi Bille, It was ok. I did it. But, what methods and in what sequence I need to invoke to access the webservice? I am doing the followig: - generating java code based on wsdl, using ecplise plugin. - did a very simple client whit the following code: GeneratedStubClass myStub = new GeneratedStubClass(); System.out.println(myStub.MethodWithOperationName()); I am getting the following error: java.lang.NullPointerException at org.apache.axis2.context.MessageContext.setEnvelope(MessageContext.java:681) An other e-mail about this especific error is running in the list thanks a lot From: [EMAIL PROTECTED] Reply-To: axis-user@ws.apache.org To: axis-user@ws.apache.org Subject: Re: newbie question about WSDL2JAVA Date: Fri, 23 Jun 2006 23:04:32 +0200 - Generate Java from WSDL - Select the WSDL-File - Next page you can leave all the selections. - If you want to get the service classes, then you have to additionally select "Generate serverside code" Thats all HTH Bille > -Ursprüngliche Nachricht- > Von: axis-user@ws.apache.org > Gesendet: 22.06.06 06:39:07 > An: axis-user@ws.apache.org > Betreff: newbie question about WSDL2JAVA > Hi All, > > > Sorry if it is a very basic question, but the user guide is not clear for > me. > > Can somebody send a step by step example about how to build a webservice > client? > > I am using wsdl2java in eclipse but I do not know what generated classes may > be used for what. > > I am in doubt about what fields in wizard I need to select to build only a > simple soap web service client. > > > > thanks a lot > > _ > COPA 2006: (¯`·._.·[ Ooola ]·._.·´¯) e + frases para seu MSN Clique > aqui! http://copa.br.msn.com/extra/frases/ > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > _ Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! http://smartsurfer.web.de/?mc=100071&distributionid=0071 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ COPA 2006: (¯`·._.·[ Ooola ]·._.·´¯) e + frases para seu MSN Clique aqui! http://copa.br.msn.com/extra/frases/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AxisFault: Unconnected sockets not implemented; nested exceptio
Hi All, I am getting org.apache.axis2.AxisFault: Unconnected sockets not implemented exception. Whant can be the root cause of this ? JAVA CODE: # import java.security.Security; import org.apache.axiom.om.OMAbstractFactory; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.OMFactory; import org.apache.axiom.om.OMNamespace; import org.apache.axis2.AxisFault; import org.apache.axis2.Constants; import org.apache.axis2.addressing.EndpointReference; import org.apache.axis2.client.Options; import org.apache.axis2.client.ServiceClient; public class WSClient { public static void main(String[] args) { System.setProperty("javax.net.ssl.trustStore", "D:\\clientcert.jks"); System.setProperty("javax.net.ssl.trustStorePassword", "password123"); try { OMFactory fac = OMAbstractFactory.getOMFactory(); OMNamespace omNs = fac .createOMNamespace( "http://www.NAMESAPCEURL";, "methodname"); OMElement method = fac.createOMElement("wsmethodname", omNs); EndpointReference endpoint = new EndpointReference( "https://webserviceurl.com/wsfile.asmx";); Options options = new Options(); options.setTransportInProtocol(Constants.TRANSPORT_HTTP); options.setTo(endpoint); ServiceClient serviceClient = new ServiceClient(); serviceClient.setOptions(options); OMElement result = serviceClient.sendReceive(method); System.out.println(result); } catch (AxisFault axisFault) { axisFault.printStackTrace(); } } } # ERROR: Jun 23, 2006 5:51:27 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: I/O exception (java.net.SocketException) caught when processing request: Unconnected sockets not implemented Jun 23, 2006 5:51:27 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: Retrying request Jun 23, 2006 5:51:27 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: I/O exception (java.net.SocketException) caught when processing request: Unconnected sockets not implemented Jun 23, 2006 5:51:27 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: Retrying request Jun 23, 2006 5:51:27 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: I/O exception (java.net.SocketException) caught when processing request: Unconnected sockets not implemented Jun 23, 2006 5:51:27 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry INFO: Retrying request org.apache.axis2.AxisFault: Unconnected sockets not implemented; nested exception is: java.net.SocketException: Unconnected sockets not implemented; nested exception is: org.apache.axis2.AxisFault: Unconnected sockets not implemented; nested exception is: java.net.SocketException: Unconnected sockets not implemented at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:223) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:328) at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:279) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:457) at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:399) at WSClient.main(WSClient.java:42) Caused by: org.apache.axis2.AxisFault: Unconnected sockets not implemented; nested exception is: java.net.SocketException: Unconnected sockets not implemented at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:305) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:207) ... 6 more Caused by: java.net.SocketException: Unconnected sockets not implemented at javax.net.SocketFactory.createSocket(DashoA12275) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:115) at org.apache.commons.httpclient.protocol
RE: NullPointerException in MessageContext.setEnvelope(MessageContext.java:681)
Hi Ted Jones, Thanks for your response. I am already using AXIS2. I did not solve this problem yet . Any suggestions are welcome. regards IP VP From: "Ted Jones" <[EMAIL PROTECTED]> Reply-To: axis-user@ws.apache.org To: Subject: RE: NullPointerException in MessageContext.setEnvelope(MessageContext.java:681) Date: Fri, 23 Jun 2006 13:30:34 -0500 IP VP, I encountered the same thing (or something very similar) with Axis 1.3. I was hoping an upgrade to Axis2 would fix my problem. Have you had any luck resolving? Thanks, Ted Jones -Original Message- From: ip vp [mailto:[EMAIL PROTECTED] Sent: Thursday, June 22, 2006 4:28 PM To: axis-user@ws.apache.org Subject: NullPointerException in MessageContext.setEnvelope(MessageContext.java:681) Importance: High Hi all, I am trying to call a comercial partner webservice thats return a string and do not need input parameters. Based on User guide ( Client for echoVoid Operation) I am doing the followig: - generating java code based on wsdl, using ecplise plugin. - did a very simple client whit the following code: GeneratedStubClass myStub = new GeneratedStubClass(); System.out.println(myStub.MethodWithOperationName()); I am getting the following error: java.lang.NullPointerException at org.apache.axis2.context.MessageContext.setEnvelope(MessageContext.java:681) This error occurs with all variants of WSDL2JAVA configuration: with and without databinds, using get, using post, using soap... What am I doing wrong ? thanks in advance IP VP _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Você sabe desde que ano as camisas de futebol são numeradas? http://copa.br.msn.com/extra/curiosidades/futebol2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
NullPointerException in MessageContext.setEnvelope(MessageContext.java:681)
Hi all, I am trying to call a comercial partner webservice thats return a string and do not need input parameters. Based on User guide ( Client for echoVoid Operation) I am doing the followig: - generating java code based on wsdl, using ecplise plugin. - did a very simple client whit the following code: GeneratedStubClass myStub = new GeneratedStubClass(); System.out.println(myStub.MethodWithOperationName()); I am getting the following error: java.lang.NullPointerException at org.apache.axis2.context.MessageContext.setEnvelope(MessageContext.java:681) This error occurs with all variants of WSDL2JAVA configuration: with and without databinds, using get, using post, using soap... What am I doing wrong ? thanks in advance IP VP _ Você sabe em qual Copa o Pelé vestiu a camisa 10 pela 1a. vez? http://copa.br.msn.com/extra/curiosidades/1958/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question about WSDL2JAVA
Hi All, Sorry if it is a very basic question, but the user guide is not clear for me. Can somebody send a step by step example about how to build a webservice client? I am using wsdl2java in eclipse but I do not know what generated classes may be used for what. I am in doubt about what fields in wizard I need to select to build only a simple soap web service client. thanks a lot _ COPA 2006: (¯`·._.·[ Ooola ]·._.·´¯) e + frases para seu MSN Clique aqui! http://copa.br.msn.com/extra/frases/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A concrete axis + ssl client example.
Hey Subir, Thanks for your response. Can you provide a sample code ? regards, IPVP From: "Sai Arunachalam" <[EMAIL PROTECTED]> Reply-To: axis-user@ws.apache.org To: axis-user@ws.apache.org Subject: Re: A concrete axis + ssl client example. Date: Mon, 19 Jun 2006 13:31:06 +0530 Hey Subir, Can you provide some code or example for what you did...? I am looking to implement a similar functionality. Thanks, Sai On 6/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Thanks manuel... I am using a self signed certificate and so I had to import my servers certificate (not issued by any CA, but me ;) ) into the truststore and change the default trust store as they are not available in the default CA file available in the JRE.. That is the reason that I set the truststore explicitly ofcourse I can import my servers certificate into the default file to avoid setting any properties related to trust store..you can say I do this for testing purpose Thanks again for pointing out that. I thought you could have given a few links that discuss these things (SSL, Certificates in JAVA) in detail to help all of us in the group. Cheers -Subir S -Original Message- From: Manuel Mall [mailto:[EMAIL PROTECTED] Sent: Friday, June 16, 2006 9:08 PM To: axis-user@ws.apache.org Subject: Re: A concrete axis + ssl client example. On Friday 16 June 2006 21:07, [EMAIL PROTECTED] wrote: > Hi, > > I guess if you use the stubs generated using WSDL2Java then there is > nothing much to do. Set the trust store property and trust store > password property before invoking the client. Just leave the other > properties as default it self. > > System.setProperty("javax.net.ssl.trustStore", > "c:\\TraceLogs\\tempstore.jks"); > System.setProperty("javax.net.ssl.trustStorePassword", "temp123"); > For client authentication you usually the the keyStore and keyStorePassword properties not the trustStore. The keyStore contains your key and the corresponding certificate presented to the server. The trustStore contains certificates of the servers you trust. Actually typically not the certificates itself but the CA certificates. The CA trustStore that comes with your JDK/JRE contains many of the commonly used CA certificates (Verisign and the like) and normally you don't need to make any changes to it. System.setProperty("javax.net.ssl.keyStore", ""); System.setProperty("javax.net.ssl.keyStorePassword", ""); works for me to use SSL client authentication. The biggest complication typically is to get your keyStore sorted out. The details of that depend on how you your private/public key pair and from that your certificate is issued to you. This topic is however way off this list. > > -Subir S > > -Original Message- > From: ip vp [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, June 14, 2006 6:56 PM > To: axis-user@ws.apache.org > Subject: A concrete axis + ssl client example. > > > > Can somebody supply a concrete example of axis client accessing > webservice > > using ssl and a client certificate ? > > > regards > Manuel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Seja um dos primeiros a testar o novo Windows Live Mail Beta- grátis. Acesse http://www.ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
A concrete axis + ssl client example.
Can somebody supply a concrete example of axis client accessing webservice using ssl and a client certificate ? regards _ COPA 2006: (¯`·._.·[ Ooola ]·._.·´¯) e + frases para seu MSN Clique aqui! http://copa.br.msn.com/extra/frases/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: URGENT !! error accessing webservices via SSL
HI, Any suggestions ? regards, From: "ip vp" <[EMAIL PROTECTED]> Reply-To: axis-user@ws.apache.org To: axis-user@ws.apache.org Subject: URGENT !! error accessing webservices via SSL Date: Thu, 08 Jun 2006 21:49:35 + Hi all! First of all, I am a newbie in webservices. :-) I have a remote webservice to acess from java and get a message. I do not need to send any parameters, only get a String. I have de client certificate ( .pfx). I got the BouncyClaster lib. PLEASE, take a llok ate the code and the exception stack trace below and let me know where I am doing the wrong thing JAVA CODE ### import java.security.Security; import java.util.List; import javax.xml.namespace.QName; import org.apache.axis.client.Call; import org.apache.axis.client.Service; public class WSCall { public static void main(String[] args) { Service service = new Service(); Call call; List rtnValues; try { Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); System.setProperty("javax.net.ssl.keyStore", "D:\\MY_CERTIFICATE.PFX"); System.setProperty("javax.net.ssl.keyStorePassword", ""); System.setProperty("javax.net.ssl.keyStoreType", "PKCS12"); System.setProperty("javax.net.ssl.trustStore", "D:\\certificadoACRaiz.cer"); System.setProperty("javax.net.ssl.trustStorePassword", ""); System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol"); call = (Call)service.createCall(); call.setTargetEndpointAddress(new java.net.URL("https://WSURL";)); call.setOperationName(new QName("http://URL";, "MYOPERATIONNAME")); call.setReturnType(org.apache.axis.Constants.XSD_STRING); call.addParameter("testParam", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN); call.invoke(new Object[] { "" }); rtnValues = call.getOutputValues(); System.out.println("WS return : " + rtnValues.get(0).toString()); } catch (Exception ex) { System.out.println(ex.getCause()); System.out.println(ex.getMessage()); ex.printStackTrace(); } // end catch } } D:\>javac WSCall.java D:\>java WSCall java.net.SocketException: Default SSL context init failed: / by zero ; nested exception is: java.net.SocketException: Default SSL context init failed: / by zero AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.net.SocketException: Default SSL context init failed: / by zero faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:java.net.SocketException: Default SSL context init failed: at javax.net.ssl.DefaultSSLSocketFactory.createSocket(DashoA12275) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at WSCall.main(WSCall.java:32) {http://xml.apache.org/axis/}hostname:BESAO000667 java.net.SocketException: Default SSL context init failed: / by zero at org.apache.axis.AxisFault.makeFault(AxisFault.java:101) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apach
URGENT !! error accessing webservices via SSL
Hi all! First of all, I am a newbie in webservices. :-) I have a remote webservice to acess from java and get a message. I do not need to send any parameters, only get a String. I have de client certificate ( .pfx). I got the BouncyClaster lib. PLEASE, take a llok ate the code and the exception stack trace below and let me know where I am doing the wrong thing JAVA CODE ### import java.security.Security; import java.util.List; import javax.xml.namespace.QName; import org.apache.axis.client.Call; import org.apache.axis.client.Service; public class WSCall { public static void main(String[] args) { Service service = new Service(); Call call; List rtnValues; try { Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); System.setProperty("javax.net.ssl.keyStore", "D:\\MY_CERTIFICATE.PFX"); System.setProperty("javax.net.ssl.keyStorePassword", ""); System.setProperty("javax.net.ssl.keyStoreType", "PKCS12"); System.setProperty("javax.net.ssl.trustStore", "D:\\certificadoACRaiz.cer"); System.setProperty("javax.net.ssl.trustStorePassword", ""); System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol"); call = (Call)service.createCall(); call.setTargetEndpointAddress(new java.net.URL("https://WSURL";)); call.setOperationName(new QName("http://URL";, "MYOPERATIONNAME")); call.setReturnType(org.apache.axis.Constants.XSD_STRING); call.addParameter("testParam", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN); call.invoke(new Object[] { "" }); rtnValues = call.getOutputValues(); System.out.println("WS return : " + rtnValues.get(0).toString()); } catch (Exception ex) { System.out.println(ex.getCause()); System.out.println(ex.getMessage()); ex.printStackTrace(); } // end catch } } D:\>javac WSCall.java D:\>java WSCall java.net.SocketException: Default SSL context init failed: / by zero ; nested exception is: java.net.SocketException: Default SSL context init failed: / by zero AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.net.SocketException: Default SSL context init failed: / by zero faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:java.net.SocketException: Default SSL context init failed: at javax.net.ssl.DefaultSSLSocketFactory.createSocket(DashoA12275) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191) at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at WSCall.main(WSCall.java:32) {http://xml.apache.org/axis/}hostname:BESAO000667 java.net.SocketException: Default SSL context init failed: / by zero at org.apache.axis.AxisFault.makeFault(AxisFault.java:101) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:2443) at org.apache.axis.client.Call.invoke(Call.java:2366) at org.apache.axis.client.Call.invoke(Call.java:1812) at WSCall.main(WSCall.java:32) Caused by: java.net.SocketException: Default SSL context init failed: / by zero at javax.net.ssl.DefaultSSLSocketFactory.createSocket(DashoA12275) at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92) at org.apache.axis.transport.htt