Attachement using SAAJ

2008-03-16 Thread Seetha Rama Krishna
Hi,
   I am trying to send two attachements along with request . i need to send 
this in the followig format
   
   
 order
   item/item
   size/size
   attachments
xyz
 image/liquid
 data/data
  /xyz
xyz1
 image/image
 data/data
  /xyz1
  /attachements
/order
   
 how can i send attachements in the above format 



  Thanks  Regards,
  Krishna


   
-
 Save all your chat conversations. Find them online.

RE: difference b/w bean mapping using SOAPBody

2008-03-15 Thread Seetha Rama Krishna
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 
  general
 itemSOAP/item
version1.1/version
  /general
  item
foodItem
   typeliquid/type
   quantity1/quantity
 /fooditem
   /item
   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.

Re: difference b/w bean mapping using SOAPBody

2008-03-15 Thread Seetha Rama Krishna
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 
  general
 itemSOAP/item
version1.1/version
  /general
  item
foodItem
   typeliquid/type
   quantity1/quantity
 /fooditem
   /item
   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

Re: difference b/w bean mapping using SOAPBody

2008-03-15 Thread Seetha Rama Krishna
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. 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

RE: wsdl2java

2008-03-15 Thread Seetha Rama Krishna
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.

SAAJ Jar

2008-03-15 Thread Seetha Rama Krishna
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

OrderProcesser Example

2008-03-14 Thread Seetha Rama Krishna
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: wsdl2java

2008-03-14 Thread Seetha Rama Krishna

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.

Fwd: Bean Serialization /xml

2008-03-14 Thread Seetha Rama Krishna
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.
   
   
  ?xml version=1.0  encoding=UTF-8?
soapenv:Envelope
 xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
soapenv:Body
request xsi:type=ns1:requestType xmlns=
xmlns:ns1=http://tempuri.org;
general
 id0987654321/id
itemXYZ/item
/general
private
xyz
life_id1/life_id
price21/price
/xyz
 /private
attachments
abc
name1234/name
image/image
/abc
   
/abc
/attachments
/request
 /soapenv:Body
/soapenv:Envelope
   
  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.

RE: Bean Serialization /xml

2008-03-14 Thread Seetha Rama Krishna
  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 lt 
, 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
  order
  general
  item/item
  quantity/quantity
  /general
  FoodItem
  LiquidItem
  type/type
  quantity/quantity
  /LiquidItem
  /FoodItem
  /order
   
  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.
   
   
  ?xml version=1.0 encoding=UTF-8?
soapenv:Envelope
 xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
soapenv:Body
request xsi:type=ns1:requestType xmlns=
xmlns:ns1=http://tempuri.org;
general
id0987654321/id
itemXYZ/item
/general
private
xyz
life_id1/life_id
price21/price
/xyz
/private
attachments
abc
name1234/name
image/image
/abc
   
/abc
/attachments
/request
/soapenv:Body
/soapenv:Envelope
   
  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]

difference b/w bean mapping using SOAPBody

2008-03-14 Thread Seetha Rama Krishna
Hi,
   I am new bie to AXIS.  I have to send a SOAP Request in the following 
format 
  general
 itemSOAP/item
version1.1/version
  /general
  item
foodItem
   typeliquid/type
   quantity1/quantity
 /fooditem
   /item
   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.

wsdl2java

2008-03-13 Thread Seetha Rama Krishna
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.

Bean Serialization /xml

2008-03-13 Thread Seetha Rama Krishna
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.
   
   
  ?xml version=1.0 encoding=UTF-8?
soapenv:Envelope
 xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
xmlns:xsd=http://www.w3.org/2001/XMLSchema;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
soapenv:Body
request xsi:type=ns1:requestType xmlns=
xmlns:ns1=http://tempuri.org;
general
id0987654321/id
itemXYZ/item
/general
private
xyz
life_id1/life_id
price21/price
/xyz
/private
attachments
abc
name1234/name
image/image
/abc
   
/abc
/attachments
/request
/soapenv:Body
/soapenv:Envelope
   
  Thanks,
  ram

   
-
 5, 50, 500, 5000 - Store N number of mails in your inbox. Click here.

Re: SOAPRequest

2008-03-10 Thread Seetha Rama Krishna
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. 

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

Re: SOAPRequest

2008-03-05 Thread Seetha Rama Krishna
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:
  * 
  * phaseOrder type=InFlow
  *  ...
  *phase name=userMonitorPhase
  *handler name=SOAPSniffer
  *class=com.fry.axis2.module.SOAPSnifferHandler
  *order phase=userMonitorPhase

SOAPRequest

2008-03-04 Thread Seetha Rama Krishna
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

2008-02-25 Thread Seetha Rama Krishna
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 = nothing;
} 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 
   multiRef id=id0 soapenc:root=0 
soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/; 
xsi:type=xsd:int 
xmlns:soapenc=1http://schemas.xmlsoap.org/soap/encoding/;1/multiRef
   
But i dont require all these extra elements. i need simple 
request like
   add
 integer /integer
  integer /integer
   /add
   
   
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.