Re: [Axis2] problem with WSDL2Java generated stubs and databinding
Nikola, This might be easier for you - it works for me using the .93 release. Options options = stub._getClientOptions(); options.setAction(http://smartSWANS/smartLogin;); Where the relevant section of the wsdl is: wsdl:operation name=smartLogin soap:operation soapAction=http://smartSWANS/smartLogin; style=document / wsdl:input soap:body use=literal / /wsdl:input wsdl:output soap:body use=literal / /wsdl:output /wsdl:operation Or you could try the latest nightly: http://cvs.apache.org/dist/axis2/nightly/ HTH, iksrazal Em Terça 27 Dezembro 2005 14:14, o Nikola Zifra escreveu: Hi iksrazal and Chintaka, this is the part of the stub code generated by the 0.92 version of the WSDL2Java tool: org.apache.axis2.clientapi.Call _call = new org.apache.axis2.clientapi.Call(_serviceContext); _call.setTransportInfo(this.senderTransport,this.listenerTransport,this.use SeparateListener); _call.setDoREST(this.doRest); org.apache.axis2.context.MessageContext _messageContext = getMessageContext(); _call.setTo(this.toEPR); _call.setSoapAction(echoString); And this is the part generated by 0.93 version of WSDL2Java tool: org.apache.axis2.client.Call _call = new org.apache.axis2.client.Call(_serviceContext); _call.setClientOptions(_clientOptions); org.apache.axis2.context.MessageContext _messageContext = getMessageContext(); if(_clientOptions.getSoapAction() == null) { } if(_clientOptions.getAction() == null) { } Notice that two different Call classes with different APIs are used in 0.92 and 0.93 version of the generated stub.You can't add line _call.setSoapAction(echoString) to the 0.93 version gen code because the org.apache.axis2.client.Call used in the 0.93 does not have method setSoapAction() . You can just use _clientOptions.setSoapAction(echoString) but it seems that it does not resolve my issue, because I am still getting the exception I've complained about. When I modify the 0.93 version code like this i am still getting the exception: rg.apache.axis2.client.Call _call = new org.apache.axis2.client.Call(_serviceContext); _call.setClientOptions(_clientOptions); org.apache.axis2.context.MessageContext _messageContext = getMessageContext(); if(_clientOptions.getSoapAction() == null) { System.out.println(\n\n\n SETTING SOAP ACTION); _clientOptions.setSoapAction(echoString); } org.apache.axis2.AxisFault: org.apache.axis2.AxisFault: Operation Not found EPR is http://localhost:8080/axis2/services/Axis2SampleDocLitPortType and WSA Action = at org.apache.axis2.engine.DispatchingChecker.invoke(DispatchingChecker.java:7 0) at org.apache.axis2.engine.Phase.invoke(Phase.java:167) at org.apache.axis2.engine.AxisEngine.invokePhases(AxisEngine.java:443) at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:137) When I modify the 0.93 code in the following manner : org.apache.axis2.client.Call _call = new org.apache.axis2.client.Call(_serviceContext); _call.setClientOptions(_clientOptions); org.apache.axis2.context.MessageContext _messageContext = getMessageContext(); _clientOptions.setSoapAction(echoString); if(_clientOptions.getSoapAction() == null) { } if(_clientOptions.getAction() == null) { } I got the the following exception: org.apache.axis2.AxisFault: null; nested exception is: java.lang.NullPointerException at org.apache.axis2.AxisFault.makeFault(AxisFault.java:190) at org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver.invokeB usinessLogic(Axis2SampleDocLitPortTypeMessageReceiver.java:120) at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(Abstrac tInOutSyncMessageReceiver.java:36) Caused by: java.lang.NullPointerException at org.apache.axis2.userguide.databinding.Axis2SampleDocLitPortTypeechoStringD atabindingSupporter.toOM(Axis2SampleDocLitPortTypeechoStringDatabindingSuppo rter.java:34) at org.apache.axis2.userguide.Axis2SampleDocLitPortTypeMessageReceiver.invokeB usinessLogic(Axis2SampleDocLitPortTypeMessageReceiver.java:106) ... 20 more Could you pls. be more specific what part of the generated code should I modify and how? Regards, Nikola Eran Chinthaka [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nikola, the iksrazal's method will fix the problem, BUT .. I should accept that its a bug in 0.93 release, which is now fixed in current SVN head. - -- Chinthaka iksrazal wrote: Nikola, Try following this thread - worked for me when I had a similiar problem:
[axis2] service not found erp!!!
i'm new to axis2 and i tried to fallow the example of the user guide, using wsdl2java iv'e created the skeleton and the stab from the axis2SampleDoclit.wsdl I made the aar and deployed the service. The service was shown inside available services. Then I tried to run the stab and got the exception I'm can't show the errors, because my computer is off the internet. The error happens in the post dispatch For the service to work I copied the service url shown inside the erp. It claims that he can't find the service I have some questions 1. how can I know which services the client can see? 2.2. is there a set of commands that can pull the services names and theirs erp? 3. 3. how can I create the client without all the data binding? 4. 4. which parameters are required in the client options just to identify the service with outsendingan operation? Any other info will be very helpful. I read the user guide and the architect guide, but there was no real info on this. Thanks, Alon. Don't just search. Find. MSN Search Check out the new MSN Search!
Re: WSDL generators
Is the soa editor from cape clear - 'free as in beer' - what you are after? Not sure otherwise how you could 'programatically' generate a wsdl. HTH, iksrazal Em Terça 27 Dezembro 2005 15:58, o Asaf Lahav escreveu: Hi all, I'm not sure if this is the right group to ask. But, I'm looking for a java WSDL generator. Is there a tool that will enable me to generate WSDL files? I know AXIS provides a tool called java2wsdl.exe but that would force me to generate a java file in-order to generate a WSDL file first. Is there any other way to generate WSDL files? (Preferably open source tool) Thanks in advance, Asaf Lahav VP RD, Prima Grid LTD. Cellular: 972-54-4717955 Phone: 972-3-6540255 Fax: 972-3-6540254 -- http://www.braziloutsource.com/
Re: [axis2] service not found erp!!!
Em Terça 27 Dezembro 2005 15:57, o alon cohen escreveu: i'm new to axis2 and i tried to fallow the example of the user guide, using wsdl2java iv'e created the skeleton and the stab from the axis2SampleDoclit.wsdl I made the aar and deployed the service. The service was shown inside available services. Then I tried to run the stab and got the exception… I'm can't show the errors, because my computer is off the internet. The error happens in the post dispatch… For the service to work I copied the service url shown inside the erp. It claims that he can't find the service… I have some questions… 1. how can I know which services the client can see? Try http://localhost:8080/axis2/listServices 2. 2. is there a set of commands that can pull the services names and theirs erp? Try: Options options = stub._getClientOptions(); 3. 3. how can I create the client without all the data binding? Maybe I misunderstand your question. There are 3 or 4 examples without data binding, ie the callback one for example. 4. 4. which parameters are required in the client options just to identify the service with out sending an operation? If the wsdl is correct and is packaged correctly, none are theoretically needed. I say 'theoretically' because the .93 release had a bug - since fixed - where you may need to do a 'options.setAction(yourAction)' that matches the soapAction for your operation. See this tutorial which may help: http://www.developer.com/open/print.php/10930_3557741_2 Any other info will be very helpful. I read the user guide and the architect guide, but there was no real info on this. Thanks, Alon. -- HTH, iksrazal http://www.braziloutsource.com/
Re: WSDL generators
what you're describing sounds like building the DOM tree in-memory and then serializing it (to file, stream, whatever). so you want a Java API that wraps building the DOM tree of a WSDL? that's fairly straight-forward to write. - Original Message - From: Asaf Lahav To: axis-user@ws.apache.org Sent: Tuesday, December 27, 2005 9:58 AM Subject: WSDL generators Hi all, I'm not sure if this is the right group to ask. But, I'm looking for a java WSDL generator. Is there a tool that will enable me to generate WSDL files? I know AXIS provides a tool called java2wsdl.exe but that would force me to generate a java file in-order to generate a WSDL file first. Is there any other way to generate WSDL files? (Preferably open source tool) Thanks in advance, Asaf Lahav VP RD, Prima Grid LTD. Cellular: 972-54-4717955 Phone: 972-3-6540255 Fax: 972-3-6540254
Avoiding 'Invalid element in ...'
We have a web service client created with Axis WSDL2Java calling a web service created by another company in .NET. We need to be able to extend the web service over time without having to synchronize the updates of our respective system. If a property is added to a type/bean/DTO on the server part, the client will issue the well known Invalid element in until we have regerated the client stubs. I would like Axis to just ignore unknown elements. What is the proper way to do this? Is there an argument to WSDL2Java to control this behaviour? Thanks in advance, Mattias Jiderhamn
Need help with SAXParseException
I'm getting the following SAXParseException. Does anyone have anyone dealt with error or have an idea of what it is related to?org.xml.sax.SAXParseException: Element or attribute do not match QName production: QName::=(NCName':')?NCName. Thanks for the help,Pat Yahoo! for Good - Make a difference this year.
RE: Re: How to set an SSL socket connect timeout value?
I don't believe that will work. In class org.apache.axis.transport.http.HTTPSender, this method: protected void getSocket(SocketHolder sockHolder, MessageContext msgContext, String protocol, String host, int port, int timeout, StringBuffer otherHeaders, BooleanHolder useFullURL) throws Exception { Hashtable options = getOptions(); if(timeout 0) { if(options == null) { options = new Hashtable(); } options.put(DefaultSocketFactory.CONNECT_TIMEOUT,Integer.toString(timeou t)); } SocketFactory factory = SocketFactoryFactory.getFactory(protocol, options); if (factory == null) { throw new IOException(Messages.getMessage(noSocketFactory, protocol)); } Socket sock = factory.create(host, port, otherHeaders, useFullURL); if(timeout 0) { sock.setSoTimeout(timeout); } sockHolder.setSocket(sock); } -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Kent Tong Sent: Sunday, December 25, 2005 8:16 AM To: axis-user@ws.apache.org Subject: Re: How to set an SSL socket connect timeout value? David Penaskovic DPenaskovic at silver-peak.com writes: I can't figure out how to set the timeout value for an initial SSL socket connect. The default varies from platform to platform and I would like to set this value explicitly. Have you tried: call.setTimeout(timeout);
RE: Re: How to set an SSL socket connect timeout value?
Didn't finish. Apologies. That method below, getSocket() in HTTPSender, uses the timeout to call setSoTimeout(). But it is already too late, the socket is already created. I need to set the *connect* timeout at socket creation time. The org.apache.axis.components.net.DefaultSocketFactory (used for HTTP) does create a socket with a connect timeout if I've set the AXIS property 'axis.client.connect.timeout' But the org.apache.axis.components.net.JSSESocketFactory (used for HTTPS) does not do this. I can't seem to figure this out for SSL. dave -Original Message- From: David Penaskovic Sent: Tuesday, December 27, 2005 11:50 AM To: 'axis-user@ws.apache.org' Subject: RE: Re: How to set an SSL socket connect timeout value? I don't believe that will work. In class org.apache.axis.transport.http.HTTPSender, this method: protected void getSocket(SocketHolder sockHolder, MessageContext msgContext, String protocol, String host, int port, int timeout, StringBuffer otherHeaders, BooleanHolder useFullURL) throws Exception { Hashtable options = getOptions(); if(timeout 0) { if(options == null) { options = new Hashtable(); } options.put(DefaultSocketFactory.CONNECT_TIMEOUT,Integer.toString(timeou t)); } SocketFactory factory = SocketFactoryFactory.getFactory(protocol, options); if (factory == null) { throw new IOException(Messages.getMessage(noSocketFactory, protocol)); } Socket sock = factory.create(host, port, otherHeaders, useFullURL); if(timeout 0) { sock.setSoTimeout(timeout); } sockHolder.setSocket(sock); } -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Kent Tong Sent: Sunday, December 25, 2005 8:16 AM To: axis-user@ws.apache.org Subject: Re: How to set an SSL socket connect timeout value? David Penaskovic DPenaskovic at silver-peak.com writes: I can't figure out how to set the timeout value for an initial SSL socket connect. The default varies from platform to platform and I would like to set this value explicitly. Have you tried: call.setTimeout(timeout);
Use Axis engine to pass through SOAP
Hi all, Is it possible to use Axis infrastructure just to pass through the SOAP xml documents and develop my own SOAP processing? Or, how can I extract the SOAP message from Axis after a call had been made to a bean invoked by Axis? Thanks in advance, Asaf Lahav VP RD, Prima Grid LTD. Cellular: 972-54-4717955 Phone: 972-3-6540255 Fax: 972-3-6540254
RE: WSDL generators
Well, of course it can be done using simple DOM document construction But what I'm looking for is an infrastructure that may provide a wrapper to standard WSDL construction tasks. Asaf Lahav VP RD, Prima Grid LTD. Cellular: 972-54-4717955 Phone: 972-3-6540255 Fax: 972-3-6540254 From: Ron Reynolds [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 27, 2005 9:19 PM To: axis-user@ws.apache.org Subject: Re: WSDL generators what you're describing sounds like building the DOM tree in-memory and then serializing it (to file, stream, whatever). so you want a Java API that wraps building the DOM tree of a WSDL? that's fairly straight-forward to write. - Original Message - From: Asaf Lahav To: axis-user@ws.apache.org Sent: Tuesday, December 27, 2005 9:58 AM Subject: WSDL generators Hi all, I'm not sure if this is the right group to ask. But, I'm looking for a java WSDL generator. Is there a tool that will enable me to generate WSDL files? I know AXIS provides a tool called java2wsdl.exe but that would force me to generate a java file in-order to generate a WSDL file first. Is there any other way to generate WSDL files? (Preferably open source tool) Thanks in advance, Asaf Lahav VP RD, Prima Grid LTD. Cellular: 972-54-4717955 Phone: 972-3-6540255 Fax: 972-3-6540254
RE: Re: How to set an SSL socket connect timeout value?
Our Webservices are always SSL and we have always successfully timed out a socket by calling setTimeout(InMillis) on org.apache.axis.client.Stub instance. sample code is attached below. if(port instanceof org.apache.axis.client.Stub){ // instanceof and Class casting will always drag performance org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub) port; /** * set the timeout to in MilliSeconds */ int timeOut = 1; // 10 seconds stub.setTimeout(timeOut); return stub; } Have not yet looked at the underlying code to see how it works, but then never had the need as it has been working like a charm. The same works fine for non SSL socket too. Thanks and Regards, === Gary Grewal - David Penaskovic [EMAIL PROTECTED]To: axis-user@ws.apache.org r-peak.com cc: Subject: RE: Re: How to set an SSL socket connect timeout value? 12/27/2005 01:56 PM Please respond to axis-user Didn't finish. Apologies. That method below, getSocket() in HTTPSender, uses the timeout to call setSoTimeout(). But it is already too late, the socket is already created. I need to set the *connect* timeout at socket creation time. The org.apache.axis.components.net.DefaultSocketFactory (used for HTTP) does create a socket with a connect timeout if I've set the AXIS property 'axis.client.connect.timeout' But the org.apache.axis.components.net.JSSESocketFactory (used for HTTPS) does not do this. I can't seem to figure this out for SSL. dave -Original Message- From: David Penaskovic Sent: Tuesday, December 27, 2005 11:50 AM To: 'axis-user@ws.apache.org' Subject: RE: Re: How to set an SSL socket connect timeout value? I don't believe that will work. In class org.apache.axis.transport.http.HTTPSender, this method: protected void getSocket(SocketHolder sockHolder, MessageContext msgContext, String protocol, String host, int port, int timeout, StringBuffer otherHeaders, BooleanHolder useFullURL) throws Exception { Hashtable options = getOptions(); if(timeout 0) { if(options == null) { options = new Hashtable(); } options.put(DefaultSocketFactory.CONNECT_TIMEOUT,Integer.toString(timeou t)); } SocketFactory factory = SocketFactoryFactory.getFactory(protocol, options); if (factory == null) { throw new IOException(Messages.getMessage(noSocketFactory, protocol)); } Socket sock = factory.create(host, port, otherHeaders, useFullURL); if(timeout 0) { sock.setSoTimeout(timeout); } sockHolder.setSocket(sock); } -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Kent Tong Sent: Sunday, December 25, 2005 8:16 AM To: axis-user@ws.apache.org Subject: Re: How to set an SSL socket connect timeout value? David Penaskovic DPenaskovic at silver-peak.com writes: I can't figure out how to set the timeout value for an initial SSL socket connect. The default varies from platform to platform and I would like to set this value explicitly. Have you tried: call.setTimeout(timeout); This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase Co., its subsidiaries and affiliates
Re: [axis2] service not found EPR!!!
iksrazal wrote: Em Terça 27 Dezembro 2005 15:57, o alon cohen escreveu: i'm new to axis2 and i tried to fallow the example of the user guide, using wsdl2java iv'e created the skeleton and the stab from the axis2SampleDoclit.wsdl I made the aar and deployed the service. The service was shown inside available services. Then I tried to run the stab and got the exception… I'm can't show the errors, because my computer is off the internet. The error happens in the post dispatch… For the service to work I copied the service url shown inside the erp. It claims that he can't find the service… I have some questions… 1. how can I know which services the client can see? Try http://localhost:8080/axis2/listServices 2. 2. is there a set of commands that can pull the services names and theirs erp? Try: Options options = stub._getClientOptions(); I don't think this will do. But when you go to http://ypurIP:yourPort/axis2/listServices, you can see the list of services available, there EPRs (nor ERP ;-) ) and the operations. 3. 3. how can I create the client without all the data binding? Maybe I misunderstand your question. There are 3 or 4 examples without data binding, ie the callback one for example. Well, just look at the test cases we have written, the best one being the EchoRawXMLTest. There we haven't use data binding at all, but you need to work with AXIOM. If you have any questions on this feel free to post it here. This is the code to invoke a service w/o data binding. OMElement payload; // create your payload here. Call call = new Call(clientHome); // client home is where Axis2 will look for modules and Axis2.xml. Options options = new Options(); call.setClientOptions(options); options.setTo(targetEPR); // target epr is listed in listServices page of Axis2 web admin options.setTransportInProtocol(Constants.TRANSPORT_HTTP); OMElement result = call.invokeBlocking(operationName, payload); // process your result here call.close(); 4. 4. which parameters are required in the client options just to identify the service with out sending an operation? Just set options.setTo(). This will identify the service. If the wsdl is correct and is packaged correctly, none are theoretically needed. I say 'theoretically' because the .93 release had a bug - since fixed - where you may need to do a 'options.setAction("yourAction")' that matches the soapAction for your operation. See this tutorial which may help: http://www.developer.com/open/print.php/10930_3557741_2 Any other info will be very helpful. I read the user guide and the architect guide, but there was no real info on this. Thanks, Alon.
Re: ?wsdl links not working on service list page
hi all; sorry for late reply , even in .93 there was no wsdl generation , it only print the wsdl if only the wsdl is there in the archive file. But with next release you will be able to get the wsdl for if the wsdl is there or not and it only generate doc/lit type wsdl. We are thinking to improve that soon. Thanks,Deepal~Future is Open~ - Original Message - From: thilina madu To: axis-user@ws.apache.org Sent: Monday, December 26, 2005 11:50 AM Subject: Re: ?wsdl links not working on service list page hi Which version are you using? According to my knowledge axis2-0.92 is not supporting for generating wsdl for a axis web service.(IF wrong please correct me) madushan thilinaBenjamin Drasin [EMAIL PROTECTED] wrote: Hello,Please excuse me if this is covered somewhere; I looked in the documentation, in the mail archive, and on the wiki and could not find anything promising.I have written some web services (which are working). Here is my web.xml:..AxisServletApache-Axis Servletorg.apache.axis.transport.http.AxisServletAxisServlet/services/*..I then added the file server-config.wsdd with my web services:...value="com.inventigo.mavent.comply.expert.portal.web.service.AsyncReview"/value="com.inventigo.mavent.comply.expert.portal.web.service.GetReviewResult"/..The URL http://localhost/app/services now lists my web services (and the web services work with the client I wrote), but the links lead to 404 error pages - is there another step I need to publish the wsdl files or something?Thanks in advanceBye-Ben Yahoo! DSL Something to write home about. Just $16.99/mo. or less