org.apache.axis.encoding.ser.xbeans package is not there in axis1.4
Hi, I have been trying to find some link to integrate axis1 with xmlbeans found some sample by replacing wsdd with XmlBeanSerialiser but the package org.apache.axis.encoding.ser.xbeans itself is dropped in axis1.4 which was there in axis1.3 is there any specific reason for doing so. I cannt upgrade to axis2 as of now. Please let me know integrating axis1 with xmlbeans impossible or not and so some links on how to do the same. Thanks in advance -Krishna
Attachement using SAAJ
Hi, I am trying to send two attachements along with request . i need to send this in the followig format how can i send attachements in the above format Thanks & Regards, Krishna - Save all your chat conversations. Find them online.
SAAJ Jar
Hi, I imported all the axis jar files into classpath and trying to create a SOAPMessage, SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance(); SOAPConnection connection =connectionFactory.createConnection(); MessageFactory messageFactory =MessageFactory.newInstance(); SOAPMessage message =messageFactory.createMessage(); QName bodyName = new QName(SOAPConstants.URI_NS_SOAP_ENVELOPE,"general"); SOAPBody body =message.getSOAPBody(); body.addBodyElement(bodyName); I am getting error in addBodyElement as addBodyElement(QName) is not supported. Does i need to add any extra SAAJ Specific jar files to my classpath Regards, ram - Unlimited freedom, unlimited storage. Get it now
RE: wsdl2java
Hi, Thanks for your reply. //, if you switch away from Axis to some other JAX RPC implementation of Web Services Can you please tell me what are other JAX RPC implementations Regards, ram "Chandolu, Yuva" <[EMAIL PROTECTED]> wrote: v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} st1\:*{behavior:url(#default#ieooui) }Using Service and Call you are making your code portable between any JAX RPC based implementation of Web Services. That means, if you switch away from Axis to some other JAX RPC implementation of Web Services, your client code works (should work) without any code changes. Using Stubs your client code is tied to Axis implementation (JAX RPC, of course) because you are using Axis generated stubs classes. Thanks Yuva - From: Seetha Rama Krishna [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2008 4:48 AM To: axis-user@ws.apache.org Subject: Fwd: wsdl2java Hi, can any one tell me the difference for the below mail Seetha Rama Krishna <[EMAIL PROTECTED]> wrote: Date: Thu, 13 Mar 2008 19:03:46 + (GMT) From: Seetha Rama Krishna <[EMAIL PROTECTED]> Subject: wsdl2java To: axis-user@ws.apache.org Hi, What is the difference b/w client program that is generated by using wsdl2java(i.e. generating stubs for WSDL) and writting the client program using axis API like service.call etc..Will there any performance difference b/w them?? If so how can we decide, which one to adapt?? Thanks, ram - Why delete messages? Unlimited storage is just a click away. Thanks & Regards, Krishna - Get the freedom to save as many mails as you wish. Click here to know how. - Get the freedom to save as many mails as you wish. Click here to know how.
Re: difference b/w bean mapping using SOAPBody
Hi, i wanted to know how excatly the difference b/w calling a webservice using AXIS and SAAJ. Is there any extra features provided by SAAJ, apart from attachements. In SAAJ, we will call the webservice,like SOAPConnectionFactory connectionFactory = SOAPConnectionFactory.newInstance(); SOAPConnection connection = connectionFactory.createConnection(); MessageFactory messageFactory = MessageFactory.newInstance(); SOAPMessage message =messageFactory.createMessage(); SOAPBody body =message.getSOAPBody(); SOAPFactory factory = SOAPFactory.newInstance(); String endPointURL = "http://localhost:8081/axis/services/order";; SOAPMessage response =connection.call(message,endPointURL); In Axis, we will call, like GeneralItem gi = new GeneralItem(); gi.setItem("snacks"); gi.setQuantity("4"); LiquitItem lt = new LiquitItem(); lt.setQuantity("5"); lt.setType("Hot Drinks"); FoodItem fi = new FoodItem(); fi.setLt(lt); Item it = new Item(); it.setFi(fi); it.setGi(gi); com.items.Order or = new com.items.Order(); String endPointURL="http://localhost:8081/axis/services/order";; Service service = new Service(); Call call= (Call) service.createCall(); QNameqn = new QName( "urn:Order", "order" ); call.registerTypeMapping(com.items.Order.class, qn, new org.apache.axis.encoding.ser.BeanSerializerFactory(com.items.Order.class, qn), new org.apache.axis.encoding.ser.BeanDeserializerFactory(com.items.Order.class, qn)); call.setTargetEndpointAddress( new java.net.URL(endPointURL) ); call.setOperationName( new QName("Order", "processOrder") ); call.addParameter( "arg1", qn, ParameterMode.IN ); call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING ); result =(String)call.invoke(new Object[] {it}); In the above axis code, we are passing the bean, where as using SAAJ, we are constructing the SOAP Request using SOAP API. Martin Gainty <[EMAIL PROTECTED]> wrote: Didnt see anyone respond so i found this test harness from org.apache.axis2.saaj.SoapMessageTest.java try { MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); //MessageFactory fac = MessageFactory.newInstance(); SOAPMessage msg = fac.createMessage(); SOAPPart soapPart = msg.getSOAPPart(); SOAPEnvelope envelope = soapPart.getEnvelope(); SOAPBody body = envelope.getBody(); AttachmentPart ap; //replace the fileName here with your attachment String fileName = System.getProperty("basedir", ".") + "/test-resources" + File.separator +"attach.xml"; InputStream inputStream = new FileInputStream(new File(fileName)); ap = msg.createAttachmentPart(inputStream, "text/xml"); DataHandler dh = new DataHandler(new SAAJDataSource(inputStream, 1000, "text/xml", true)); StringBuffer sb1 = copyToBuffer(dh.getInputStream()); assertNotNull(ap); //Verify attachment part is not empty and contents are correct try { Object o = ap.getContent(); InputStream is = null; assertNotNull(o); if (o instanceof StreamSource) { StreamSource ss = (StreamSource)o; is = ss.getInputStream(); } else { fail("got object: " + o + ", expected object: javax.xml.transform.stream.StreamSource"); } } catch (Exception e) { fail("attachment has no content - unexpected"); } } catch (Exception e) { fail("Exception: " + e); } HTH Martin-- - Original Message - From: Seetha Rama Krishna To: axis-user@ws.apache.org Sent: Saturday, March 15, 2008 1:06 AM Subject: RE: difference b/w bean mapping using SOAPBody Hi, Thanks for your reply. My focus is to send a SOAP Request to the webservice,which is already exposed and get the response . That's it nothing more than that. No manipulation, nothing What is bothering me is that whether i have to pass the bean class to AXIS / create the SOAP Request using SAAJ. One more thing is i need to send one attachment along with this SOAPRequest.
Re: difference b/w bean mapping using SOAPBody
Hi, Thanks. For time being, let us forget about attachment part. what is the differenece b/w constructing SOAP Request with BeanMapping and using SAAJ. When i check both th request's using TCPMON, i did not find any difference,except extra reference in AXIS, So except for attachement, remaining things are same. Please correct me if i am wrong. Martin Gainty <[EMAIL PROTECTED]> wrote: Didnt see anyone respond so i found this test harness from org.apache.axis2.saaj.SoapMessageTest.java try { MessageFactory fac = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); //MessageFactory fac = MessageFactory.newInstance(); SOAPMessage msg = fac.createMessage(); SOAPPart soapPart = msg.getSOAPPart(); SOAPEnvelope envelope = soapPart.getEnvelope(); SOAPBody body = envelope.getBody(); AttachmentPart ap; //replace the fileName here with your attachment String fileName = System.getProperty("basedir", ".") + "/test-resources" + File.separator +"attach.xml"; InputStream inputStream = new FileInputStream(new File(fileName)); ap = msg.createAttachmentPart(inputStream, "text/xml"); DataHandler dh = new DataHandler(new SAAJDataSource(inputStream, 1000, "text/xml", true)); StringBuffer sb1 = copyToBuffer(dh.getInputStream()); assertNotNull(ap); //Verify attachment part is not empty and contents are correct try { Object o = ap.getContent(); InputStream is = null; assertNotNull(o); if (o instanceof StreamSource) { StreamSource ss = (StreamSource)o; is = ss.getInputStream(); } else { fail("got object: " + o + ", expected object: javax.xml.transform.stream.StreamSource"); } } catch (Exception e) { fail("attachment has no content - unexpected"); } } catch (Exception e) { fail("Exception: " + e); } HTH Martin-- - Original Message - From: Seetha Rama Krishna To: axis-user@ws.apache.org Sent: Saturday, March 15, 2008 1:06 AM Subject: RE: difference b/w bean mapping using SOAPBody Hi, Thanks for your reply. My focus is to send a SOAP Request to the webservice,which is already exposed and get the response . That's it nothing more than that. No manipulation, nothing What is bothering me is that whether i have to pass the bean class to AXIS / create the SOAP Request using SAAJ. One more thing is i need to send one attachment along with this SOAPRequest. So if i go for bean , how can i pass this attachement. "Vinh Nguyen (vinguye2)" <[EMAIL PROTECTED]> wrote: Hi, When you receive a SOAP response from a web service, the contents must match the WSDL/XSD schema defined for that service operation. I believe what you want is to take that XML and send it back out in another slightly different format. That amounts to changing from one schema to another, and I believe that's outside the scope of Axis2. You might be able to write a simple translator framework that converts one XML to another using mappings between one property to another, but it might not be straightforward as that. Keep in mind that Axis2 primaly handles sending/receiving SOAP. It does comes with various data binding options built-in. The actual data binding tool used (i.e. XmlBeans) mainly handles serialization between XML and the Java type for a given XSD schema. To change from one schema to another, you'd have do write additional code for that. -Vinh - From: Seetha Rama Krishna [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2008 11:46 AM To: axis-user@ws.apache.org Subject: difference b/w bean mapping using SOAPBody Hi, I am new bie to AXIS. I have to send a SOAP Request in the following format SOAP 1.1 liquid 1 I had gone through SAAJ API and found that it is very easy to construct the same SOAP Request. My question is the same can be build using bean mapping concept in AXIS.. Is there any difference in sending the SOAP Request using AXIS with bean serialization an by using SAAJ API. Can any body suggest me how to proceed further Thanks, ram - Chat on a cool, new interface. No download required. Click here. Thanks &
RE: difference b/w bean mapping using SOAPBody
Hi, Thanks for your reply. My focus is to send a SOAP Request to the webservice,which is already exposed and get the response . That's it nothing more than that. No manipulation, nothing What is bothering me is that whether i have to pass the bean class to AXIS / create the SOAP Request using SAAJ. One more thing is i need to send one attachment along with this SOAPRequest. So if i go for bean , how can i pass this attachement. "Vinh Nguyen (vinguye2)" <[EMAIL PROTECTED]> wrote: Hi, When you receive a SOAP response from a web service, the contents must match the WSDL/XSD schema defined for that service operation. I believe what you want is to take that XML and send it back out in another slightly different format. That amounts to changing from one schema to another, and I believe that's outside the scope of Axis2. You might be able to write a simple translator framework that converts one XML to another using mappings between one property to another, but it might not be straightforward as that. Keep in mind that Axis2 primaly handles sending/receiving SOAP. It does comes with various data binding options built-in. The actual data binding tool used (i.e. XmlBeans) mainly handles serialization between XML and the Java type for a given XSD schema. To change from one schema to another, you'd have do write additional code for that. -Vinh --------- From: Seetha Rama Krishna [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2008 11:46 AM To: axis-user@ws.apache.org Subject: difference b/w bean mapping using SOAPBody Hi, I am new bie to AXIS. I have to send a SOAP Request in the following format SOAP 1.1 liquid 1 I had gone through SAAJ API and found that it is very easy to construct the same SOAP Request. My question is the same can be build using bean mapping concept in AXIS.. Is there any difference in sending the SOAP Request using AXIS with bean serialization an by using SAAJ API. Can any body suggest me how to proceed further Thanks, ram - Chat on a cool, new interface. No download required. Click here. Thanks & Regards, Krishna - Now you can chat without downloading messenger. Click here to know how.
difference b/w bean mapping using SOAPBody
Hi, I am new bie to AXIS. I have to send a SOAP Request in the following format SOAP 1.1 liquid 1 I had gone through SAAJ API and found that it is very easy to construct the same SOAP Request. My question is the same can be build using bean mapping concept in AXIS.. Is there any difference in sending the SOAP Request using AXIS with bean serialization an by using SAAJ API. Can any body suggest me how to proceed further Thanks, ram - Chat on a cool, new interface. No download required. Click here.
RE: Bean Serialization /xml
Hi, Thanks for your reply. When i sent sample xml and the SOAP Request is monitored using TCPMon. The is SOAP Request is going in weird way with some < , spaces etc.. So i dropped the proposal of construction of SOAP Request XML . So the only option left is to use BEAN. The problem is i need send the request in the following format So inside order bean, i need to set general,food item. Inside FoodItem bean, i am setting LiquidItem. When i check the SOAPRequest in tcpmon, it is comming like the following, which is not according to my requirment. So how can i do this one. As i am newbie to AXIS, i have several questions. I am not sure whether the request i am sending is correct or not, why the extra namespace, reference etc... If i send the request like the above, will the webservice will accept the request ?? I am sending the code also. Plese check it . "Vinh Nguyen (vinguye2)" <[EMAIL PROTECTED]> wrote: Hi, A WSDL/XSD would define the structure of a SOAP request/response for a given service operation you want to invoke. Axis2 can generate client APIs based on the WSDL/XSDs, and the APIs would take care of creating/handling the SOAP request/response for you. So you don't need to manually form the SOAP XML yourself. Your question below sounds like you want to manually create the SOAP XML yourself...which basically amounts to rewriting what Axis2 does? Or am I reading the question wrong? -Vinh ----- From: Seetha Rama Krishna [mailto:[EMAIL PROTECTED] Sent: Friday, March 14, 2008 2:43 AM To: axis-user@ws.apache.org Subject: Fwd: Bean Serialization /xml Hi, Can any body tell me how to generate SOAP request with Beans for the below SOAP Request Seetha Rama Krishna <[EMAIL PROTECTED]> wrote: Date: Thu, 13 Mar 2008 19:40:52 + (GMT) From: Seetha Rama Krishna <[EMAIL PROTECTED]> Subject: Bean Serialization /xml To: axis-user@ws.apache.org Hi, I am having a java bean (not EJB). By using this bean i need to send SOAP Request to a webservice Can any one suggest me whether it is better to send it as object / generating the xml format using StringBuffer and validating it with DOM parser. If we generate the xml file how can we add the template like soapenvelope to this xml file and how about attachment?? If we pass the bean as object, then how can we get the xml format, whether i need to do any changes in bean and how to validate object?? I need to send a SOAP Request to a webservice in the following format. http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> http://tempuri.org";> 0987654321 XYZ 121 1234 Thanks, ram - 5, 50, 500, 5000 - Store N number of mails in your inbox. Click here. Thanks & Regards, Krishna - Chat on a cool, new interface. No download required. Click here. Thanks & Regards, Krishna - 5, 50, 500, 5000 - Store N number of mails in your inbox. Click here. com.rar Description: 3240707495-com.rar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fwd: wsdl2java
Hi, can any one tell me the difference for the below mail Seetha Rama Krishna <[EMAIL PROTECTED]> wrote: Date: Thu, 13 Mar 2008 19:03:46 + (GMT) From: Seetha Rama Krishna <[EMAIL PROTECTED]> Subject: wsdl2java To: axis-user@ws.apache.org Hi, What is the difference b/w client program that is generated by using wsdl2java(i.e. generating stubs for WSDL) and writting the client program using axis API like service.call etc..Will there any performance difference b/w them?? If so how can we decide, which one to adapt?? Thanks, ram - Why delete messages? Unlimited storage is just a click away. Thanks & Regards, Krishna - Get the freedom to save as many mails as you wish. Click here to know how.
OrderProcesser Example
Hi, I deployed example3 in tomcat and the wsdl file which is displaye on browser i saved it as OrderProcessor.wsdl. When i generated stubs for this wsdl ,using Lomboz , i am getting errors like BeanService.order can't be resolved. I generted this wsdl file using 1.4 and in my buildpath of lomboz also, i am having same version. Can any body tell me , am i doing any mistake?? Thanks & Regards, Krishna - Now you can chat without downloading messenger. Click here to know how.
Fwd: Bean Serialization /xml
Hi, Can any body tell me how to generate SOAP request with Beans for the below SOAP Request Seetha Rama Krishna <[EMAIL PROTECTED]> wrote: Date: Thu, 13 Mar 2008 19:40:52 + (GMT) From: Seetha Rama Krishna <[EMAIL PROTECTED]> Subject: Bean Serialization /xml To: axis-user@ws.apache.org Hi, I am having a java bean (not EJB). By using this bean i need to send SOAP Request to a webservice Can any one suggest me whether it is better to send it as object / generating the xml format using StringBuffer and validating it with DOM parser. If we generate the xml file how can we add the template like soapenvelope to this xml file and how about attachment?? If we pass the bean as object, then how can we get the xml format, whether i need to do any changes in bean and how to validate object?? I need to send a SOAP Request to a webservice in the following format. http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> http://tempuri.org";> 0987654321 XYZ 121 1234 Thanks, ram - 5, 50, 500, 5000 - Store N number of mails in your inbox. Click here. Thanks & Regards, Krishna - Chat on a cool, new interface. No download required. Click here.
Bean Serialization /xml
Hi, I am having a java bean (not EJB). By using this bean i need to send SOAP Request to a webservice Can any one suggest me whether it is better to send it as object / generating the xml format using StringBuffer and validating it with DOM parser. If we generate the xml file how can we add the template like soapenvelope to this xml file and how about attachment?? If we pass the bean as object, then how can we get the xml format, whether i need to do any changes in bean and how to validate object?? I need to send a SOAP Request to a webservice in the following format. http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> http://tempuri.org";> 0987654321 XYZ 121 1234 Thanks, ram - 5, 50, 500, 5000 - Store N number of mails in your inbox. Click here.
wsdl2java
Hi, What is the difference b/w client program that is generated by using wsdl2java(i.e. generating stubs for WSDL) and writting the client program using axis API like service.call etc..Will there any performance difference b/w them?? If so how can we decide, which one to adapt?? Thanks, ram - Why delete messages? Unlimited storage is just a click away.
Re: SOAPRequest
Hi, I had modified my code and i am getting nullpointer Exception if i place the following code before invoke method. MessageContext context =call.getMessageContext(); SOAPMessage soapMessage =context.getMessage(); System.out.println("SOAPMessage"+ soapMessage.getSOAPBody().toString()); If i place this code after invoke method, i am getting SOAP Response message. But my intension to track SOAP Request XML . How can i do this one. Thanks , ram Upul Godage <[EMAIL PROTECTED]> wrote: Hi, org.apache.axis.client.Call does have the method call.getMessageContext() but not in javax.xml.rpc.Call interface, I think. You can also get response message directly. call.getResponseMessage().writeTo(System.out); Upul On Wed, Mar 5, 2008 at 12:05 AM, Seetha Rama Krishna <[EMAIL PROTECTED]> wrote: Hi Vipul, thanks for your reply. call.getMessageContext().getMessage().writeTo(System.out); is not working, because getMessageContext() is not a method in Call Interface. Here is my complete code which is available with axis distribution chapter5 /* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package samples.userguide.example5; import org.apache.axis.AxisFault; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.utils.Options; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; public class Client { public static void main(String [] args) throws Exception { Options options = new Options(args); Order order = new Order(); order.setCustomerName("Glen Daniels"); order.setShippingAddress("275 Grove Street, Newton, MA"); String [] items = new String[] { "mp3jukebox", "1600mahBattery" }; int [] quantities = new int [] { 1, 4 }; order.setItemCodes(items); order.setQuantities(quantities); Service service = new Service(); Call call= (Call) service.createCall(); QNameqn = new QName( "urn:BeanService", "Order" ); call.registerTypeMapping(Order.class, qn, new org.apache.axis.encoding.ser.BeanSerializerFactory(Order.class, qn), new org.apache.axis.encoding.ser.BeanDeserializerFactory(Order.class, qn)); String result; try { call.setTargetEndpointAddress( new java.net.URL(options.getURL()) ); call.setOperationName( new QName("OrderProcessor", "processOrder") ); call.addParameter( "arg1", qn, ParameterMode.IN ); call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING ); result = (String) call.invoke( new Object[] { order } ); } catch (AxisFault fault) { result = "Error : " + fault.toString(); } System.out.println(result); } } Thanks, Ram Michael Lambert <[EMAIL PROTECTED]> wrote: Upul Godage wrote: Hi, String ret = (String) call.invoke( new Object[] { textToSend } ); call.getMessageContext().getMessage().writeTo(System.out); // Writes to the given OutputStream Upul On Tue, Mar 4, 2008 at 3:33 PM, Seetha Rama Krishna <[EMAIL PROTECTED]> wrote: Hi, I deployed the sample code which is distributed by axis, I just wanted to see the SOAP Request message through programming. I had done this through TCPMON. I need to check it through programming. How can i do this. I tried to modify the code Client code for MyService webservice. MessageContext mc = new MessageContext(null); System.out.println(mc.getAxisEngine()); String ret = (String) call.invoke( new Object[] { textToSend } ); System.out.println(AxisEngine.getCurrentMessageContext().getRequestMessage()); I am getting nullpointer Exception when i run this code. By using TCPMonitor, i need to check the SOAP Request Messages and Response message of Remote webservice. How can i do this Thanks & Regards, Krishna - Now you can chat without downloading messenger. Click here to know how
Re: SOAPRequest
Hi Vipul, thanks for your reply. call.getMessageContext().getMessage().writeTo(System.out); is not working, because getMessageContext() is not a method in Call Interface. Here is my complete code which is available with axis distribution chapter5 /* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package samples.userguide.example5; import org.apache.axis.AxisFault; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.utils.Options; import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; public class Client { public static void main(String [] args) throws Exception { Options options = new Options(args); Order order = new Order(); order.setCustomerName("Glen Daniels"); order.setShippingAddress("275 Grove Street, Newton, MA"); String [] items = new String[] { "mp3jukebox", "1600mahBattery" }; int [] quantities = new int [] { 1, 4 }; order.setItemCodes(items); order.setQuantities(quantities); Service service = new Service(); Call call= (Call) service.createCall(); QNameqn = new QName( "urn:BeanService", "Order" ); call.registerTypeMapping(Order.class, qn, new org.apache.axis.encoding.ser.BeanSerializerFactory(Order.class, qn), new org.apache.axis.encoding.ser.BeanDeserializerFactory(Order.class, qn)); String result; try { call.setTargetEndpointAddress( new java.net.URL(options.getURL()) ); call.setOperationName( new QName("OrderProcessor", "processOrder") ); call.addParameter( "arg1", qn, ParameterMode.IN ); call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING ); result = (String) call.invoke( new Object[] { order } ); } catch (AxisFault fault) { result = "Error : " + fault.toString(); } System.out.println(result); } } Michael Lambert <[EMAIL PROTECTED]> wrote:Upul Godage wrote: Hi, String ret = (String) call.invoke( new Object[] { textToSend } ); call.getMessageContext().getMessage().writeTo(System.out); // Writes to the given OutputStream Upul On Tue, Mar 4, 2008 at 3:33 PM, Seetha Rama Krishna <[EMAIL PROTECTED]> wrote: Hi, I deployed the sample code which is distributed by axis, I just wanted to see the SOAP Request message through programming. I had done this through TCPMON. I need to check it through programming. How can i do this. I tried to modify the code Client code for MyService webservice. MessageContext mc = new MessageContext(null); System.out.println(mc.getAxisEngine()); String ret = (String) call.invoke( new Object[] { textToSend } ); System.out.println(AxisEngine.getCurrentMessageContext().getRequestMessage()); I am getting nullpointer Exception when i run this code. By using TCPMonitor, i need to check the SOAP Request Messages and Response message of Remote webservice. How can i do this Thanks & Regards, Krishna - Now you can chat without downloading messenger. Click here to know how. I use a simple customer module that I configured through axis2.xml: import org.apache.axiom.soap.SOAPEnvelope; import org.apache.axis2.AxisFault; import org.apache.axis2.context.MessageContext; import org.apache.axis2.handlers.AbstractHandler; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Simple handler that logs the contents of SOAPs messages to INFO via * the jakarta commons logging package. * * Handler typically is configured to capture messages passing through * either the IN or OUT phases of Axis2. To register the handler enter an * xml element similar to the one below in your axis2.xml: * * * ... * * * *
SOAPRequest
Hi, I deployed the sample code which is distributed by axis, I just wanted to see the SOAP Request message through programming. I had done this through TCPMON. I need to check it through programming. How can i do this. I tried to modify the code Client code for MyService webservice. MessageContext mc = new MessageContext(null); System.out.println(mc.getAxisEngine()); String ret = (String) call.invoke( new Object[] { textToSend } ); System.out.println(AxisEngine.getCurrentMessageContext().getRequestMessage()); I am getting nullpointer Exception when i run this code. By using TCPMonitor, i need to check the SOAP Request Messages and Response message of Remote webservice. How can i do this Thanks & Regards, Krishna - Now you can chat without downloading messenger. Click here to know how.
SOAP Request Message
Hi, I am new to webservice. I try to send simple request through SOAP. My JWS file is public class MathTest { public int add(int a,int b) { return a+b; } } I deployed in the server and written axis client program. here is my program import javax.xml.namespace.QName; import javax.xml.rpc.ParameterMode; import org.apache.axis.client.Call; import org.apache.axis.client.Service; import org.apache.axis.encoding.XMLType; import org.apache.axis.utils.Options; public class MathClient { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try { Options options = new Options(args); int i =0; int j =0; String endpointURL ="http://localhost:8081/axis/MathTest.jws";; String textToSend; args = options.getRemainingArgs(); if ((args == null) || (args.length < 1)) { textToSend = ""; } else { i = Integer.parseInt(args[0]); j = Integer.parseInt(args[1]); System.out.println("i"+i); System.out.println("i"+j); } Service service = new Service(); Call call= (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpointURL) ); call.setOperationName( new QName("MathClient", "add") ); call.addParameter( "arg0", XMLType.XSD_INT, ParameterMode.IN); call.addParameter( "arg1", XMLType.XSD_INT, ParameterMode.IN); call.setReturnType( org.apache.axis.encoding.XMLType.XSD_INT ); Object sum = call.invoke(new Object[] {i,j}); System.out.println(sum.toString()); } catch (Exception e) { System.err.println(e.toString()); } } } When i monitor the SOAP request , we are getting some extra elements like http://schemas.xmlsoap.org/soap/encoding/"; xsi:type="xsd:int" xmlns:soapenc="1http://schemas.xmlsoap.org/soap/encoding/";>1 But i dont require all these extra elements. i need simple request like how can i get this type of Soap body Does any body having idea, how to do it regards, ram - Chat on a cool, new interface. No download required. Click here.
axis1.3-MTOM, help needed???
We are sending a binary file from .NET(VS 2005) with MTOM enabled with Axis1.3 and ran into some exceptions. Any similar experiences for image1 the WSDL has an entry SOAP request looks like this MIMEBoundary632725276169531250content-id: <[EMAIL PROTECTED]>content-type: application/xop+xml; charset=utf-8; type="text/xml; charset=utf-8"content-transfer-encoding: binary http://www.w3.org/2004/08/xop/include" href=""http://us.f371.mail.yahoo.com/ym/[EMAIL PROTECTED]&YY=95877&order=down&sort=date&pos=0&view=a&head=b">[EMAIL PROTECTED]" />... MIMEBoundary632725276169531250content-id: <[EMAIL PROTECTED]>content-type: application/octet-streamcontent-transfer-encoding: binary... Axis fails with the following exception. AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize. at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141) at org.apache.axis.encoding.DeserializerImpl.startElement(DeserializerImpl.java:369) at org.apache.axis.encoding.ser.BeanDeserializer.startElement(BeanDeserializer.java:154) at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048) at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165) at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141) at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236) at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384) at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:81) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323) 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.handlers.soap.SOAPService.invoke(SOAPService.java:453) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) -Krishna Yahoo! Photos Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.
How to make deserializer ignore some fields in a type
I have Service FooService and has methods void setFoo(Foo aFoo) and Foo getFoo() on it and call it version 1 Foo is defined with object variables x Foo{ private String x; setX() getX(); } Now the FooService version 2 deployed and version 1 removed. in version 2 Foo object has anohter object variables y. How can I make the clients written for Version 1 will still work for Version 2 for a getFoo() method. The Version 1 clients get error Foo does not have setY method. I know one way to solve is use dynamically executing the servive and parsing the result, don't bind the type to static Foo object. But is there easy way to make it work , the client is already written for Version 1. Regards Krishna