[Axis2] Problem in om element?
We have the floowing on line 439 of modules/xml/om/om_element.c: return axis2_om_element_find_namespace ( (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node, env), env, parent, uri, prefix); I think we are doing something wrong here, mixing up the element with the parent node. Should we not have the following instead?: return axis2_om_element_find_namespace ( (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(parent, env), env, parent, uri, prefix); Or have I missed something here? NOTE: I get a seg fault in axis2_om_element_find_namespace for some of the responses from WCF test endpoints. Thanks, Samisa...
Invalid URI reported by .NET Client (WSE 3.0)
Title: Invalid URI reported by .NET Client (WSE 3.0) I have been struggling with this for a while. I have a basic service that receives an OMElement and returns one. Here is an example of what it return (with header info ommitted). createContentResponseresultHello/result/createContentResponse Using WSE3.0 I pass it a string and everything is good, I can manipulate it on the server side just fine. When my axis2 service returns the soap response, me .NET client reports this: System.UriFormatException : Invalid URI: The format of the URI could not be determined. at Microsoft.Web.Services3.AsyncResult.End(IAsyncResult result) at Microsoft.Web.Services3.Messaging.SoapClient.SendRequestResponse(String methodname, SoapEnvelope envelope) at Microsoft.Web.Services3.Messaging.SoapClient.SendRequestResponse(String methodname, Object obj) Here is my service: public OMElement createContent (OMElement elem) { String resultText; OMElement resultElem; OMFactory fac = OMAbstractFactory.getOMFactory(); OMNamespace namespace = fac.createOMNamespace(http://tempuri.org, ns1); OMElement theResult = fac.createOMElement(result, namespace); resultText = Hello; theResult.setText(resultText); resultElem = fac.createOMElement(createContentResponse, namespace); resultElem.addChild(theResult); return resultElem; } } I know the correct response is generated because I can see it through the TcpTunnelGUI. Why can't WSE 3.0 interpret it? Can somebody tell me what I am doing wrong or whatever other information I need to provide for better troubleshooting. Thanks! Kosta Tachtevrenidis
Axis 1.2.1 XmlBeans Performance Boost
(I posted this on Friday but never saw it make the list, so sorry if this is a duplicate)Hi. I have added a major performance improvement to the XMLBeanSerializer Class that has made its way around the lists. We saw the performance for large documents (7MB) drop from 106 seconds to 8 seconds! With smaller improvements for smaller documents. Here is the updated Serialize method: public void serialize( QName name, Attributes attributes, Object value, SerializationContext context ) throws IOException { if( !(value instanceof XmlObject) ) { throw new IOException( ((value != null) ? value.getClass().getName() : null) + is not an + XmlObject.class.getName() ); } else { context.setWriteXMLType( null ); XmlObject xmlObject= (XmlObject) value;XmlOptions xmlOptions= new XmlOptions(); xmlOptions.setSaveSyntheticDocumentElement( name ); context.writeString( xmlObject.xmlText( xmlOptions ) ); /** //---this is SW on very large xml documents context.startElement( name, attributes );XmlCursor xCur = ((XmlObject) value).newCursor();if( xCur.toFirstContentToken() == XmlCursor.TokenType.START ){ do { Node n = xCur.getDomNode(); if( n.getNodeType() == Node.ELEMENT_NODE ) { context.writeDOMElement( (Element) n ); } } while( xCur.toNextSibling() );} context.endElement (); **/ } }
Re: [Axis2] ArrayIndexOutOfBounds driving me crazy
Hi, Yes, I'm using ADB. I tried to change to sequence instead of all, but nothing changed. I'm implementing a workaround now by returning an 'empty'-element, but that's not good coding style IMHO. Didn't try with XMLBeans yet. Could you tell me what's the difference between the two? Bram Op zondag 26 februari 2006 02:40, schreef Ajith Ranabahu: Hi Bram, Are you using ADB ? if so the all/ schema construct can be an issue. A recently done change to the deser code of ADB only supports sequence. So here are two things you can try out! 1. Change all to sequence. However the sequence requires the elements to be properly ordered! 2. Try using XMLBeans.(it should handle all these schema constructs properly!). Ajith On 2/25/06, Bram Biesbrouck [EMAIL PROTECTED] wrote: Hi all, I'm having a problem with an Axis2 webservice and it's driving me nuts for all day now, please help me out. Basically, it comes down to this: My webservice returns an array of categories to my client program and when no categories are found, a zero-sized array is returned to indicate this. However, when I try to return an empty-sized array, an ArrayIndexOutOfBound error is thrown. Here's the relevant WSDL scheme: complexType name=Category all element name=id type=xsd:int/ element name=parent type=xsd:int/ element name=title type=xsd:string/ /all /complexType complexType name=CategoryArray sequence element name=category minOccurs=0 maxOccurs=unbounded type=myxsd:Category/ /sequence /complexType The Java-code calls the autogenerated (WSDL2java) toEnvelope method: org.apache.axis2.databinding.ADBSOAPModelBuilder builder = new org.apache.axis2.databinding.ADBSOAPModelBuilder(param.getPullParser(com. bpower2.ws.instrudeo.xsd.AvailableCategoriesResponse.MY_QNAME), factory); return builder.getEnvelope(); When I debug this (autogenerated) piece of code with a breakpoint on the return statement, the debugger says com.sun.jdi.InvocationException occurred invoking method when inspecting the body member of the builder variable, so I guess the problem must be around that position somewhere. I hope this is enough information. Please help me out with this one, I'm debugging for all damn day now and you're my last resort. Bram -- Ajith Ranabahu
[axis2] User guide sample application inconsistency(?)
Dear all,I'm a new axis2 user and want to learn it by following the instructions in it's user guide. First of all, i tried to generate a web service from a given WSDL as introduced in "Writing Web Services by Code Generating Skeleton". Therefore, i generated Java files from Axis2SampleDocLit.wsdl found in samples\wsdl directory. I also passed "-d xmlbeans" parameter to WSDL2Java.bat to make it use XMLBeans databinding. When i looked at the generated files, i found two directory created: src and resources. Under resources folder there was an interesting directory called "schemaorg_apache_xmlbeans" which i could not found any reference in user guide. I thought it must be "schema" directory mentioned in the guide. Anyway, i filled the empty methods in Axis2SampleDocLitPortTypeSkeleton.java file with the codes given in the user guide. Created services.xml file and filled with the code given in the guide. And created a package called Axis2SampleDocLitPortType.aar by following the instuctions. After all, i put the file under the \webapps\axis2\WEB-INF\services directory. Then after started Tomcat 5.5, clicked the "services" link listed in http://localhost:8080/axis2/index.jsp. Since i did not see the Axis2SampleDocLitPortType service listed in the page, looked at the log files of Tomcat resides under logs directory. Then i saw a line says "NullPointerException" without any further information. I also tried to change the name of schemaorg_apache_xmlbeans directory to schema. It did not work either.Am i missing something?Thans in advance,Ali Sadik Kumlali Yahoo! Mail Use Photomail to share photos without annoying attachments.
Re: accessing services at xmethods.net
For the most part Axis will generate valid WSDL, but as you can tell from the discussion list, bugs exist, and sometimes the generated WSDL is not valid. Sometimes it's just very difficult to generate good WSDLs from complex object structures --especially if you aren't using beans or if you are using Collection classes. That's why it's always a good idea to adopt a WSDL-first development methodology. Many people will use java2wsdl to generate a first pass at a WSDL definition, but you should always validate it and verify that the generated WSDL does what you want. You may need to tweak it to make it validate properly. From that point on, you should use your validated WSDL as the primary source for the rest of your project -- i.e., generate your code from the WSDL, not the other way around. The same holds true for other toolkits.As for the xmethods.org directory -- many of those services have been there for a long time, and they were developed either by hand or using very old toolkits, and they simply have errors. In the early years (2000-2003), many toolkits generated invalid WSDLs. AnneOn 2/25/06, eric kong [EMAIL PROTECTED] wrote: Thanks you so much for the hint !But if you are using a web service toolkit that implements WSDL standard - the WSDL get generated should be valid WSDL(Axis for example uses ?wsdl at the end of the URL) Are you meaning the WSDLs listed at xmethods.net are hand coded by service provider instead of generated by web services tool kits? -OR- any other things makes the WSDL an invalid WSDL?Thanks againAnne Thomas Manes [EMAIL PROTECTED] wrote: I mean that the WSDLs for many of these services aren't valid. xmethods doesn't provide a toolkit -- it just provides a place for people to post their services -- it's up to the folks that post their service to make sure that they are valid. Many are not. I f the WSDL isn't valid, wsdl2java is likely to barf on it.Anne On 2/25/06, eric kong [EMAIL PROTECTED] wrote: Thankyou so much anne, but could you explain what is non-standard? WSDL should be universal + language independent right? are you meaning the SOAP toolkit xmethod.net services using didn't implement the WSDL standard, so when I use WSDL2Java to generate my client won't compatible w ith others? thanks again Anne Thomas Manes [EMAIL PROTECTED] wrote: A lot of the services at xmethods are non-standard or don't work. Assuming you pick one that works properly, you s hould be able to take the WSDL and generate a stub to talk to it. Most other SOAP toolkits work the same way, although some use a call interface instead of a stub interface. Anne On 2/24/06, eric kong [EMAIL PROTECTED] wrote: -- There is alot web services at http://www.xmethods.net. -- When i click on Try It feature I get wsdl file. -- Can i use WSDL2Java to generate stub -- then call those web services (listed on xmethods) just like calling local java object / methods? Is that all for using web services? -- if using PERL / .NET as web service client, does it also generate stub / skeleton just like Axis (java) does? thanks Relax. Yahoo! Mail virus scanning helps detect nasty viruses! Yahoo! MailBring photos to life! New PhotoMail makes sharing a breeze. Yahoo! Mail Use Photomail to share photos without annoying attachments.
Re: Performance Problem and ConfigurationException
Hello Scott, Judging from the information you're giving us it sounds like a service you're calling isn't there. One solution would be to stopping calling it, another would be to check why it is not there at the location you are calling it (is it deployed correctly, are you calling it in the right way, etc.). Regards, Dies Scott Goldstein wrote: In Axis 1.2, every time the client makes a webservice call, a ConfigurationException is generated - ConfigurationException - No service named X is available. Building the stack trace for this exception is expensive and I'd like to remove it. However, the only solution I've seen on the web and in mailing lists for this problem is to ignore it. Is there a better answer? Is there something that I can add to the client-config.wsdd file to avoid this exception? Thanks. Scott
Re: multiple class objects for single web service
You can have several URLs for one service but only one web service interface at a particular URL. You can define multiple web services (with all their URLs) in one WSDL. Whether you want to use different URLs, WSDL files and web services for your HelloWorld and EchoServer interfaces or not, is a design decision. Regards, Dies david duncan wrote: A Web service only maps to 1 Java object / class? For example I have 2 Classes (each class has 1 java method) 1) HelloWorld Object / class -- get a service request name and return Hello + name back to service caller 2) EchoServer Object / class -- get a service request Some string and return Same string back to caller Can I put this 2 class (each class has 1 method) into 1 Web Service URL + 1 WSDL ? -OR- I have to have 2 seperate web services ? one for HelloWorld another one for EchoServer? thanks
Re: loading web serices at application server startup
Hello Antoine, If you mean you want to do some initialization processing in your web services instances when Tomcat starts: 1. Use the load-on-startup definition in your web.xml to make Tomcat instantiate Axis' servlet at startup time 2. Let your impl class implement javax.xml.rpc.server.ServiceLifecycle and put your initialization processing in the init method. Regards, Dies Antoine Galataud wrote: Hi ! I'm currenlty trying to find a way to move a corba software implementation (which is run in a stand-alone way) to a web services using Axis 1.3. I'm searching a way to start web services on application server startup (eg tomcat). In fact, back-end objects instanciated at web service instanciation time are heavy, and must be loaded before calling the web service for the first time. Is there a way to do that (maybe with deploy.wsdd) ? Thanks in advance for responses -- Antoine Galataud [EMAIL PROTECTED] Département Architecture des Systèmes d'Information INSA - Rouen -- Dies KOPER [EMAIL PROTECTED] (changed on 1 July 2005) Fujitsu Ltd - MWPF1 (changed from MWPF3 on 21 Nov 2005) 2-15-16, Shin-Yokohama, Kouhoku-ku, Yokohama, 222-0033, Japan Tel. +81(45)-475-5605 (internal 7181-4217)
serialization problem in axis 1.3 with bean that includes an array of strings
Hi, I'm using the axis 1.3 java2wsdl tool (with -y WRAPPED) to create a wsdl from an existing java class which has a method that returns a bean object that contains an array of strings. My client is written in gsoap (2.7.6e), and the problem I am having is that my gsoap client is unable to deserialize the array inside the returned bean object. The reason is that the name of the XML elements for the strings inside the array do not match what the WSDL specifies. Here is a snippet from my wsdl showing the response to an orderMeal method that returns a Meal bean object containing an array of strings: element name=orderMealResponse complexType sequence element name=orderMealReturn type=impl:Meal/ /sequence /complexType /element complexType name=Meal sequence element name=appetizers nillable=true type=impl:ArrayOf_xsd_string/ element name=mainCourse nillable=true type=xsd:string/ /sequence /complexType complexType name=ArrayOf_xsd_string sequence element maxOccurs=unbounded minOccurs=0 name=item type=xsd:string/ /sequence /complexType The body of an actual SOAP response that my gsoap client receives is: soapenv:Body orderMealResponse xmlns=urn:Tarray orderMealReturn appetizers appetizersChips/appetizers appetizersSalsa/appetizers /appetizers mainCoursePizza/mainCourse /orderMealReturn /orderMealResponse /soapenv:Body My gsoap client does not like the fact that the name of the XML element for the string array members is appetizers. According to the WSDL these array members should be named item. If I intercept the SOAP response using WebScarab and change the array part of the response to be: appetizers itemChips/item itemSalsa/item /appetizers then my gsoap client is happy and everything works. So why isn't axis naming these array elements item as specified in the WSDL? Is this a bug in axis? How can I get my gsoap client to work with this axis web service? Thanks! Jared
Re: Parameter question
Its ok dont worry but I dont get it. Im using MyService. Whenthis classits callfrom the client the echoecho receive an OMElement at this point I would like to check some variables that have insede the axis2.xml but I dont understand how to do it.Sorry and thank you for your help.public OMElement echo(OMElement element) throws XMLStreamException { //Praparing the OMElement so that it can be attached to another OM Tree. //First the OMElement should be completely build in case it is not fully built and still //some of the xml is in the stream. element.build(); //Secondly the OMElement should be detached from the current OMTree so that it can be attached //some other OM Tree. Once detached the OmTree will remove its connections to this OMElement. element.detach(); return element; }Deepal Jayasinghe [EMAIL PROTECTED] wrote: Hi Alan;I am sorry for late reply .If you include some parameters in axis2.xml you can get them usingAxisConfiguration.If you have access to message context you can directly ask from msgCtxfor your parameters.If you are using ServiceClient then you can get the ServiceContext andfrom that you can get the configurationContext and fromconfigurationContext you can get AxisConfiguration.Alan Aguia wrote: Maybe Its really simple but I dont k now how to do it. I include parameters in my axis2.xml (server side) but I dont kwow how to retrieve them when the petition arrive from the client. How can I get access to that file to retrieve that parameters? Thank you. Yahoo! Mail Use Photomail to share photos without annoying attachments. -- Thanks,Deepal~Future is Open~ Yahoo! Mail Bring photos to life! New PhotoMail makes sharing a breeze.
RE: serialization problem in axis 1.3 with bean that includes an array of strings
Title: RE: serialization problem in axis 1.3 with bean that includes an array of strings Hi Jared, I have got similar problems returning arrays using the Wrapped style, I have solved most of them. I still have an Apache Axis 1.3 Agent deserializing a bean array within a bean problem. My run time environment is different to most, I use Axis in a standalone mode, no HTTP server, no deployment, etc.. If you are using the Java2WSDL -y WRAPPED on your own created bean, you need to add your own Apache MetaData methods to these beans. Use the Java2WSDL -d option to generate the bean helper code to see how the meta data methods are created. Then add your own meta data methods to your bean to assist the AxisServer in serializing your bean. I have found that for RPC/Encoded these meta data methods are not needed. -Original Message- From: Jared Betteridge [mailto:[EMAIL PROTECTED]] Sent: Monday, 27 February 2006 11:23 AM To: axis-user@ws.apache.org Subject: serialization problem in axis 1.3 with bean that includes an array of strings Hi, I'm using the axis 1.3 java2wsdl tool (with -y WRAPPED) to create a wsdl from an existing java class which has a method that returns a bean object that contains an array of strings. My client is written in gsoap (2.7.6e), and the problem I am having is that my gsoap client is unable to deserialize the array inside the returned bean object. The reason is that the name of the XML elements for the strings inside the array do not match what the WSDL specifies. Here is a snippet from my wsdl showing the response to an orderMeal method that returns a Meal bean object containing an array of strings: element name=orderMealResponse complexType sequence element name=orderMealReturn type=impl:Meal/ /sequence /complexType /element complexType name=Meal sequence element name=appetizers nillable=true type=impl:ArrayOf_xsd_string/ element name=mainCourse nillable=true type=xsd:string/ /sequence /complexType complexType name=ArrayOf_xsd_string sequence element maxOccurs=unbounded minOccurs=0 name=item type=xsd:string/ /sequence /complexType The body of an actual SOAP response that my gsoap client receives is: soapenv:Body orderMealResponse xmlns=urn:Tarray orderMealReturn appetizers appetizersChips/appetizers appetizersSalsa/appetizers /appetizers mainCoursePizza/mainCourse /orderMealReturn /orderMealResponse /soapenv:Body My gsoap client does not like the fact that the name of the XML element for the string array members is appetizers. According to the WSDL these array members should be named item. If I intercept the SOAP response using WebScarab and change the array part of the response to be: appetizers itemChips/item itemSalsa/item /appetizers then my gsoap client is happy and everything works. So why isn't axis naming these array elements item as specified in the WSDL? Is this a bug in axis? How can I get my gsoap client to work with this axis web service? Thanks! Jared Employee.java Description: Binary data
Web Services for attachments.
Hi, I am trying to write a few web services using attachments. Can some body give some inputs on that? I am basically hand coding my wsdd to deploy the web services. How can I specify the mime type for the same in my generated wsdls? Any help is appreciated. Regards, Subir S 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
RE: java2Wsdl and interface
This issue is probably related to the open one AXIS-1720, where a class that fails the isBeanCompatible test and appears more than once, leads to an invalid schema that references a non-existent type. https://issues.apache.org/jira/browse/AXIS-1720 Regards, Darma -Original Message- From: Darma Muthiayen Sent: Saturday, February 25, 2006 11:02 PM To: 'axis-user@ws.apache.org' Cc: 'axis-dev@ws.apache.org'; '[EMAIL PROTECTED]' Subject: RE: java2Wsdl and interface I ran into the same issue, which looks very much like a bug (in Axis 1.4). Java2wsdl adds an undefined type to the types list on its first occurrence, causing subsequent occurrences to output a message part with the undefined type (instead of anyType). Any chance to have a fix in 1.4? Regards, Darma -Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED] Sent: Monday, January 23, 2006 1:34 AM To: axis-user@ws.apache.org Subject: java2Wsdl and interface Hello, My business service uses an Interface UtilisateurWeb as parameter. Java2wsdl builds an invalid WSDL : wsdl:message name=activerRenvoiRequest wsdl:part name=in0 type=tns1:UtilisateurWeb/ /wsdl:message but complextype UtilisateurWeb is not defined anywhere in generated WSDL. Debuging Java2wsdl process I've found that first occurence of my interface is translated as xsd:anytype, as axis doesn't have a serializer for it (Interface is not a Bean because it has no default constructor). In o.a.a.wsdl.fromJava.Types (line 421) makeTypeElement returns false, so Constants.XSD_ANYTYPE is used. BUT next occurence returns true, as addToTypesList has added it to it's types list. Maybe it's a bug ? How can I configure Java2Wsdl to use a custom serializer, or any other way to force using xsd:anytype ? Nico. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.