Operation Client API

2009-02-19 Thread Rutger van Eerd - Vanboxtel BV

Hello,

AFAIK Axis2/C always adds a SOAP Header element, even if there are no SOAP 
headers. In this case the Header element is empty, e.g. 
soapenv:Header/soapenv:Header.


I have to communicate to a SOAP service which appears to be broken; it 
cannot handle the SOAP Header element, even if it is empty. The best 
solution is of course to correct the service, but that is beyond my control.


So I want to remove the SOAP Header element from my SOAP message. I think I 
have to use the operation client API (instead of the service client) to do 
that. However I cannot find any examples, tutorials or documentation to get 
started. Can someone provide this? Can someone explain the basic steps for 
using the operation client?


Regards,
Rutger 



Vanboxtel BV - Kerkstraat 14 - 5427 BC Boekel - KvK 16051676



Re: Operation Client API

2009-02-19 Thread Supun Kamburugamuva
Best example of using op_client is in the svc_client code. svc_client
internally uses the op_client. So if you look at svc_client code you can
find out how to use op_client.

Thanks,
Supun.

On Thu, Feb 19, 2009 at 7:18 PM, Rutger van Eerd - Vanboxtel BV 
rve...@vanboxtel.nl wrote:

 Hello,

 AFAIK Axis2/C always adds a SOAP Header element, even if there are no SOAP
 headers. In this case the Header element is empty, e.g.
 soapenv:Header/soapenv:Header.

 I have to communicate to a SOAP service which appears to be broken; it
 cannot handle the SOAP Header element, even if it is empty. The best
 solution is of course to correct the service, but that is beyond my control.

 So I want to remove the SOAP Header element from my SOAP message. I think I
 have to use the operation client API (instead of the service client) to do
 that. However I cannot find any examples, tutorials or documentation to get
 started. Can someone provide this? Can someone explain the basic steps for
 using the operation client?

 Regards,
 Rutger

 Vanboxtel BV - Kerkstraat 14 - 5427 BC Boekel - KvK 16051676




-- 
Software Engineer, WSO2 Inc
http://wso2.org
supunk.blogspot.com


Re: Operation Client API

2009-02-19 Thread Rajika Kumarasiri
On Thu, Feb 19, 2009 at 7:48 PM, Rutger van Eerd - Vanboxtel BV 
rve...@vanboxtel.nl wrote:
hi,
Try op_client API,
http://svn.apache.org/repos/asf/webservices/axis2/trunk/c/include/axis2_op_client.h

Hello,

 AFAIK Axis2/C always adds a SOAP Header element, even if there are no SOAP
 headers. In this case the Header element is empty, e.g.
 soapenv:Header/soapenv:Header.

 I have to communicate to a SOAP service which appears to be broken; it
 cannot handle the SOAP Header element, even if it is empty. The best
 solution is of course to correct the service, but that is beyond my control.

 So I want to remove the SOAP Header element from my SOAP message. I think I
 have to use the operation client API (instead of the service client) to do
 that. However I cannot find any examples, tutorials or documentation to get
 started. Can someone provide this? Can someone explain the basic steps for
 using the operation client?

 Regards,
 Rutger

 Vanboxtel BV - Kerkstraat 14 - 5427 BC Boekel - KvK 16051676




-- 
http://wso2.org/
http://llvm.org/
http://www.osdev.org/


axis cpp client - exception handling and showing correct message ?

2009-02-19 Thread S Balaji



Hi All, 

Question : How do I do the exception handling in axis cpp client so that 
correct relevant message is printed out ? 

Detailed description below : 

I am new to Web services. I have a requirement to write C++ client to call a 
customer's web services. My client code has to run on many platforms : Win32, 
AIX, Solaris, HP-Itanium, Linux. I am playing with both gSoap and Axis C++ 
client versions on Windows first. 

I am using axis-c-1.6b-Win32-trace-bin binaries on Windows 2000 Advanced Server 
(my laptop). 

My customer's web service is written in Axis for Java. 

First I tried simple examples, and they are working fine :  Calculator, hello 
world etc. 

But when I try calling my customer's web service (real life) example with axis 
client as well as with gSoap client, I am unable to get the actual exception 
string. 

Question : How do I do the correct exception handling so that correct relevant 
message is printed out ? 

Bacause I am sending invalid business data, I get HTTP 500. But as you can see 
in the return HTTP message below, the business exception / fault string is 
TruckID EXAMPLE-5 cannot be found but instead I get Cannot deserialize with 
Axis and HTTP 500 error with gSOap.

This post is only regarding Axis, so I am not expecting any replies regarding 
gSOap.

Below, I have used MacDonalds as an example. They are not my customer :) 

Thanks a LOT in advance !!

Below is my client code : 

try
{
   CustomerService service;
   allocSvcObj.setUsername(username);
   allocSvcObj.setPassword(password);
   TruckObject * createdTruckId = service.callCustomerMethod( 
EXAMPLE-5,BBB );
}
catch(AxisException e)
{
   printf(Exception : %s\n, e.what());
}

I also tried : 
catch( SoapFaultException  e)
{   
   const char *excpCode = e.getFaultCode();
   const char *excpMessage = e.getFaultString();
   printf(Got Soap Fault : code : [%d], message : [%s]\n, excpCode, 
excpMessage); 
}
catch( AxisException e)
{   
   int iExceptionCode = e.getExceptionCode();
   const char *excpMessage = e.getMessage();
   printf(Got axis exception : code : [%d], message : [%s]\n, 
iExceptionCode, excpMessage);   
}



Below is my client run result : 

Exception : Cannot deserialize the requested element
if I print e.exceptionCode(), I get 72. 

Below is what the customer's http server returned : 



HTTP/1.1 500 Internal Server Error
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=EE7CCB1E9C3F32E1E340387CEFB3C39C; Path=/dm
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Thu, 19 Feb 2009 14:35:29 GMT
Connection: close

291
?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:Bodysoapenv:Faultfaultcodesoapenv:Server.generalException/faultcodefaultstringE20010
 TruckID EXAMPLE-5 cannot be found [R7]; nested exception is: 
com.MacDonalds.common.exceptions.RecordDeletedException: E20010 TruckID 
EXAMPLE-5 cannot be found [R7]/faultstringdetailns1:hostname 
xmlns:ns1=http://xml.apache.org/axis/;mp-srv-lin02/ns1:hostname/detail/soapenv:Fault/soapenv:Body/soapenv:Envelope



  


Re: axis cpp client - exception handling and showing correct message ?

2009-02-19 Thread Nadir Amra
I would suggest you download the latest code from SVN, build it, and try 
that instead of using binaries - the axis-c-1.6b-Win32-trace-bin binaries 
are very, very, old and are buggy. 

Hopefully, a 1.6 version will be released.  Do not know when yet. 

Nadir Amra


S Balaji ija...@yahoo.com wrote on 02/19/2009 12:10:34 PM:

 [image removed] 
 
 axis cpp client - exception handling and showing correct message ?
 
 S Balaji 
 
 to:
 
 axis-c-user
 
 02/19/2009 12:13 PM
 
 Please respond to Apache AXIS C User List
 
 
 
 
 Hi All, 
 
 Question : How do I do the exception handling in axis cpp client so 
 that correct relevant message is printed out ? 
 
 Detailed description below : 
 
 I am new to Web services. I have a requirement to write C++ client 
 to call a customer's web services. My client code has to run on many
 platforms : Win32, AIX, Solaris, HP-Itanium, Linux. I am playing 
 with both gSoap and Axis C++ client versions on Windows first. 
 
 I am using axis-c-1.6b-Win32-trace-bin binaries on Windows 2000 
 Advanced Server (my laptop). 
 
 My customer's web service is written in Axis for Java. 
 
 First I tried simple examples, and they are working fine : 
 Calculator, hello world etc. 
 
 But when I try calling my customer's web service (real life) example
 with axis client as well as with gSoap client, I am unable to get 
 the actual exception string. 
 
 Question : How do I do the correct exception handling so that 
 correct relevant message is printed out ? 
 
 Bacause I am sending invalid business data, I get HTTP 500. But as 
 you can see in the return HTTP message below, the business exception
 / fault string is TruckID EXAMPLE-5 cannot be found but instead I 
 get Cannot deserialize with Axis and HTTP 500 error with gSOap.
 
 This post is only regarding Axis, so I am not expecting any replies 
 regarding gSOap.
 
 Below, I have used MacDonalds as an example. They are not my customer :) 

 
 Thanks a LOT in advance !!
 
 Below is my client code : 
 
 try
 {
CustomerService service;
allocSvcObj.setUsername(username);
allocSvcObj.setPassword(password);
TruckObject * createdTruckId = service.callCustomerMethod( 
 EXAMPLE-5,BBB );
 } 
 catch(AxisException e)
 {
printf(Exception : %s\n, e.what());
 }
 
 I also tried : 
 catch( SoapFaultException  e)
 { 
const char *excpCode = e.getFaultCode();
const char *excpMessage = e.getFaultString();
printf(Got Soap Fault : code : [%d], message : [%s]\n, 
 excpCode, excpMessage); 
 }
 catch( AxisException e)
 { 
int iExceptionCode = e.getExceptionCode();
const char *excpMessage = e.getMessage();
printf(Got axis exception : code : [%d], message : [%s]\n, 
 iExceptionCode, excpMessage); 
 }
 
 
 
 Below is my client run result : 
 
 Exception : Cannot deserialize the requested element
 if I print e.exceptionCode(), I get 72. 
 
 Below is what the customer's http server returned : 
 
 
 
 HTTP/1.1 500 Internal Server Error
 Server: Apache-Coyote/1.1
 Set-Cookie: JSESSIONID=EE7CCB1E9C3F32E1E340387CEFB3C39C; Path=/dm
 Content-Type: text/xml;charset=utf-8
 Transfer-Encoding: chunked
 Date: Thu, 19 Feb 2009 14:35:29 GMT
 Connection: close
 
 291
 ?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:Bodysoapenv:Faultfaultcodesoapenv:Server.generalException/
 faultcodefaultstringE20010 TruckID EXAMPLE-5 cannot be found 
 [R7]; nested exception is: 
 com.MacDonalds.common.exceptions.RecordDeletedException: E20010 
 TruckID EXAMPLE-5 cannot be found [R7]/
 faultstringdetailns1:hostname xmlns:ns1=http://xml.apache.org/axis/
 mp-srv-lin02/ns1:hostname/detail/soapenv:Fault/
 soapenv:Body/soapenv:Envelope
 
 
 
 



Re: axis cpp client - exception handling and showing correct message ?

2009-02-19 Thread S Balaji


Thanks Nadir. 

Sorry but I am unable to find the correct links to download : I started from : 
http://ws.apache.org/axis/cpp/index.html - in this link, under Axis(C++) on 
the left, there is a download link which takes me to 
http://ws.apache.org/axis/cpp/download.html. All the drops here (binaries and 
source) are from Mar 2006. Nothing newer.

On another note, if you go to http://ws.apache.org/axis/cpp/index.html, on the 
left hand side, the Releases and Source Code link on the left (just above 
the Translation part on the bottom left of the page, are broken. 

Thanks.

- B

--- On Thu, 2/19/09, Nadir Amra a...@us.ibm.com wrote:

 From: Nadir Amra a...@us.ibm.com
 Subject: Re: axis cpp client - exception handling and showing correct message 
 ?
 To: Apache AXIS C User List axis-c-user@ws.apache.org
 Cc: axis-c-user@ws.apache.org
 Date: Thursday, February 19, 2009, 4:57 PM
 I would suggest you download the latest code from SVN, build
 it, and try 
 that instead of using binaries - the
 axis-c-1.6b-Win32-trace-bin binaries 
 are very, very, old and are buggy. 
 
 Hopefully, a 1.6 version will be released.  Do not know
 when yet. 
 
 Nadir Amra
 
 
 S Balaji ija...@yahoo.com wrote on 02/19/2009
 12:10:34 PM:
 
  [image removed] 
  
  axis cpp client - exception handling and showing
 correct message ?
  
  S Balaji 
  
  to:
  
  axis-c-user
  
  02/19/2009 12:13 PM
  
  Please respond to Apache AXIS C User List
  
  
  
  
  Hi All, 
  
  Question : How do I do the exception handling in axis
 cpp client so 
  that correct relevant message is printed out ? 
  
  Detailed description below : 
  
  I am new to Web services. I have a requirement to
 write C++ client 
  to call a customer's web services. My client code
 has to run on many
  platforms : Win32, AIX, Solaris, HP-Itanium, Linux. I
 am playing 
  with both gSoap and Axis C++ client versions on
 Windows first. 
  
  I am using axis-c-1.6b-Win32-trace-bin binaries on
 Windows 2000 
  Advanced Server (my laptop). 
  
  My customer's web service is written in Axis for
 Java. 
  
  First I tried simple examples, and they are working
 fine : 
  Calculator, hello world etc. 
  
  But when I try calling my customer's web service
 (real life) example
  with axis client as well as with gSoap client, I am
 unable to get 
  the actual exception string. 
  
  Question : How do I do the correct exception handling
 so that 
  correct relevant message is printed out ? 
  
  Bacause I am sending invalid business data, I get HTTP
 500. But as 
  you can see in the return HTTP message below, the
 business exception
  / fault string is TruckID EXAMPLE-5 cannot be
 found but instead I 
  get Cannot deserialize with Axis and
 HTTP 500 error with gSOap.
  
  This post is only regarding Axis, so I am not
 expecting any replies 
  regarding gSOap.
  
  Below, I have used MacDonalds as an example. They are
 not my customer :) 
 
  
  Thanks a LOT in advance !!
  
  Below is my client code :
 
  
  try
  {
 CustomerService service;
 allocSvcObj.setUsername(username);
 allocSvcObj.setPassword(password);
 TruckObject * createdTruckId =
 service.callCustomerMethod( 
  EXAMPLE-5,BBB );
  } 
  catch(AxisException e)
  {
 printf(Exception : %s\n,
 e.what());
  }
  
  I also tried : 
  catch( SoapFaultException  e)
  { 
 const char *excpCode = e.getFaultCode();
 const char *excpMessage = e.getFaultString();
 printf(Got Soap Fault : code : [%d],
 message : [%s]\n, 
  excpCode, excpMessage); 
  }
  catch( AxisException e)
  { 
 int iExceptionCode = e.getExceptionCode();
 const char *excpMessage = e.getMessage();
 printf(Got axis exception : code : [%d],
 message : [%s]\n, 
  iExceptionCode, excpMessage); 
  }
  
  
  
  Below is my client run result :
 
  
  Exception : Cannot deserialize the requested element
  if I print e.exceptionCode(), I get 72. 
  
  Below is what the customer's http server returned
 : 
  
  
  
  HTTP/1.1 500 Internal Server Error
  Server: Apache-Coyote/1.1
  Set-Cookie:
 JSESSIONID=EE7CCB1E9C3F32E1E340387CEFB3C39C; Path=/dm
  Content-Type: text/xml;charset=utf-8
  Transfer-Encoding: chunked
  Date: Thu, 19 Feb 2009 14:35:29 GMT
  Connection: close
  
  291
  ?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:Bodysoapenv:Faultfaultcodesoapenv:Server.generalException/
  faultcodefaultstringE20010 TruckID
 EXAMPLE-5 cannot be found 
  [R7]; nested exception is: 
 
 com.MacDonalds.common.exceptions.RecordDeletedException:
 E20010 
  TruckID EXAMPLE-5 cannot be found [R7]/
  faultstringdetailns1:hostname
 xmlns:ns1=http://xml.apache.org/axis/
 
 

Re: Operation Client API

2009-02-19 Thread Manjula Peiris
I am not sure about the previous Axis2/C releases but in the current svn
trunk Axis2/C does not send empty Headers. 

On Thu, 2009-02-19 at 15:18 +0100, Rutger van Eerd - Vanboxtel BV wrote:
 Hello,
 
 AFAIK Axis2/C always adds a SOAP Header element, even if there are no SOAP 
 headers. In this case the Header element is empty, e.g. 
 soapenv:Header/soapenv:Header.
 
 I have to communicate to a SOAP service which appears to be broken; it 
 cannot handle the SOAP Header element, even if it is empty. The best 
 solution is of course to correct the service, but that is beyond my control.
 
 So I want to remove the SOAP Header element from my SOAP message. I think I 
 have to use the operation client API (instead of the service client) to do 
 that. However I cannot find any examples, tutorials or documentation to get 
 started. Can someone provide this? Can someone explain the basic steps for 
 using the operation client?
 
 Regards,
 Rutger 
 
 
 Vanboxtel BV - Kerkstraat 14 - 5427 BC Boekel - KvK 16051676