RE: problems using getAnyObject() -- please help
Just the client code Nadir K. Amra "Aggarwal, Vineet" <[EMAIL PROTECTED]> wrote on 10/26/2007 10:10:25 AM: > Nadir, > > Thanks for your message. I actually am using 1.6b and not the latest > code from SVN. Unfortunately, I can't seem to compile a version myself > that works, so I've been using the pre-compiled binary for Linux (when I > do a build myself, it builds fine, but seg faults when I try to run > anything, including just the simple_axis_server). > > My application is quite large, so I'm not sure I'll be able to build a > small program to reproduce the problem, but I will certainly try. > Perhaps I can modify the Calculator example to break (it currently works > fine for me). What exactly do you need, just the client code, or all > the code involved? > > Thanks again, > Vineet > > -Original Message- > From: Nadir Amra [mailto:[EMAIL PROTECTED] > Sent: Friday, October 26, 2007 10:48 AM > To: Apache AXIS C User List > Subject: Re: problems using getAnyObject() -- please help > > Vineet, > > First I want to make sure you are using the latest code from SVN and not > > 1.6b. > > I have a lot on my plate but I can take a look sometime next week. > > Assuming you are, and to expedite the debugging I will need to do, > please > attach a complete simple client examplesince you already showed the > a > SOAP response I do not need that. > > > Nadir K. Amra > > > "Aggarwal, Vineet" <[EMAIL PROTECTED]> wrote on 10/26/2007 > 09:29:49 AM: > > > Hi all, > > > > I have been struggling with this for days. I?ve finally reached the > > point where I can?t get any further and need to reach out for help. > > > > I need to be able to work directly with the XML contents of the SOAP > > request rather than going through one of the objects created in the > > server side stubs. The only way I?ve discovered to be able to do > > this is by using IWrapperSoapDeSerializer::getAnyObject(). I > > thought this was the appropriate method because of the comments in > > the header: ?Will deserialize the next available SOAP element and > > all child elements.? > > > > I will walk through some examples of what I?ve tried in an attempt > > to properly explain the issues I am running into. Note that these > > are just code snippets, I am leaving some of the obvious code out, > > and you can pretty much assume that I?ve set things up properly. > > Here is what I did with my first attempt at printing out the XML: > > > > AnyType *pV0 = pIHSDZ->getAnyObject(); > > for (int i = 0; i < pV0->_size; i++) > > { > > cout << pV0->_array[i]; > > } > > > > This only printed out part of the XML. As such, I realized that I > > needed to make multiple calls to getAnyObject() in order to get the > > next elements, so I tried this: > > > > AnyType *pV0 = pIHSDZ->getAnyObject(); > > while (pV0 != NULL) > > { > > for (int i = 0; i < pV0->_size; i++) > > { > > cout << pV0->_array[i]; > > } > > pV0 = pIHSDZ->getAnyObject(); > > } > > > > This resulted in a segmentation fault, which after reading multiple > > posts online, I discovered that it was because getAnyObject() will > > never return NULL, so we end up making calls to it even after no > > further objects remain, resulting in the segmentation fault. This > > is where my confusion comes in. If I ended up getting all the XML > > and then made a call to getAnyObect() and it then seg faulted, I > > would completely understand. However, it seg faults after I only > > get part of the XML (leading me to believe that further calls to > > getAnyObect() actually SHOULD return something). > > > > Let me illustrate this with an example. Say the XML contents of the > > SOAP message is the following: > > > > > > > xmlns:mantas="http://namespaces.mantas.com/MAD"; > > xmlns:action="http://namespaces.mantas.com/MAD/Action"; > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > > xsi:schemaLocation="http://namespaces.mantas.com/MAD > MantasAlertData.xsd" > > > > > > > > > EN > > > > > > > > > > > > EXTERNAL_ENTITY > > Matched > > > >> type="string">NM > > > > > > > > > > > > > > > > > > If you run my above code, this is what will get output to the > > consoled before the segmentation fault: > > > > > > > xmlns:mantas="http://namespaces.mantas.com/MAD"; > > xmlns:action="http://namespaces.mantas.com/MAD/Action"; > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > > xsi:schemaLocation="http://namespaces.mantas.com/MAD > MantasAlertData.xsd" > > > > > > > > > EN > > > > > > > > > > > > EXTERNAL_ENTITY > > Matched > > > > > > Note that there a few things wrong with this. First of all, why > > doesn?t the rest get printed out? If there is
RE: problems using getAnyObject() -- please help
Nadir, Thanks for your message. I actually am using 1.6b and not the latest code from SVN. Unfortunately, I can't seem to compile a version myself that works, so I've been using the pre-compiled binary for Linux (when I do a build myself, it builds fine, but seg faults when I try to run anything, including just the simple_axis_server). My application is quite large, so I'm not sure I'll be able to build a small program to reproduce the problem, but I will certainly try. Perhaps I can modify the Calculator example to break (it currently works fine for me). What exactly do you need, just the client code, or all the code involved? Thanks again, Vineet -Original Message- From: Nadir Amra [mailto:[EMAIL PROTECTED] Sent: Friday, October 26, 2007 10:48 AM To: Apache AXIS C User List Subject: Re: problems using getAnyObject() -- please help Vineet, First I want to make sure you are using the latest code from SVN and not 1.6b. I have a lot on my plate but I can take a look sometime next week. Assuming you are, and to expedite the debugging I will need to do, please attach a complete simple client examplesince you already showed the a SOAP response I do not need that. Nadir K. Amra "Aggarwal, Vineet" <[EMAIL PROTECTED]> wrote on 10/26/2007 09:29:49 AM: > Hi all, > > I have been struggling with this for days. I?ve finally reached the > point where I can?t get any further and need to reach out for help. > > I need to be able to work directly with the XML contents of the SOAP > request rather than going through one of the objects created in the > server side stubs. The only way I?ve discovered to be able to do > this is by using IWrapperSoapDeSerializer::getAnyObject(). I > thought this was the appropriate method because of the comments in > the header: ?Will deserialize the next available SOAP element and > all child elements.? > > I will walk through some examples of what I?ve tried in an attempt > to properly explain the issues I am running into. Note that these > are just code snippets, I am leaving some of the obvious code out, > and you can pretty much assume that I?ve set things up properly. > Here is what I did with my first attempt at printing out the XML: > > AnyType *pV0 = pIHSDZ->getAnyObject(); > for (int i = 0; i < pV0->_size; i++) > { > cout << pV0->_array[i]; > } > > This only printed out part of the XML. As such, I realized that I > needed to make multiple calls to getAnyObject() in order to get the > next elements, so I tried this: > > AnyType *pV0 = pIHSDZ->getAnyObject(); > while (pV0 != NULL) > { > for (int i = 0; i < pV0->_size; i++) > { > cout << pV0->_array[i]; > } > pV0 = pIHSDZ->getAnyObject(); > } > > This resulted in a segmentation fault, which after reading multiple > posts online, I discovered that it was because getAnyObject() will > never return NULL, so we end up making calls to it even after no > further objects remain, resulting in the segmentation fault. This > is where my confusion comes in. If I ended up getting all the XML > and then made a call to getAnyObect() and it then seg faulted, I > would completely understand. However, it seg faults after I only > get part of the XML (leading me to believe that further calls to > getAnyObect() actually SHOULD return something). > > Let me illustrate this with an example. Say the XML contents of the > SOAP message is the following: > > >xmlns:mantas="http://namespaces.mantas.com/MAD"; > xmlns:action="http://namespaces.mantas.com/MAD/Action"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://namespaces.mantas.com/MAD MantasAlertData.xsd" > > > > > EN > > > > > > EXTERNAL_ENTITY > Matched > >type="string">NM > > > > > > > > > If you run my above code, this is what will get output to the > consoled before the segmentation fault: > > >xmlns:mantas="http://namespaces.mantas.com/MAD"; > xmlns:action="http://namespaces.mantas.com/MAD/Action"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://namespaces.mantas.com/MAD MantasAlertData.xsd" > > > > > EN > > > > > > EXTERNAL_ENTITY > Matched > > > Note that there a few things wrong with this. First of all, why > doesn?t the rest get printed out? If there is more data, why does > it seg fault? I even put in a counter to check how many times I go > through the loop before it seg faults, and limited the loop to that > number?that solves the seg fault issue, but I still don?t get all > the data. Secondly, the data is somewhat corrupted: I don?t know > where the extra slashes have come from (e.g. instead > of ). The same happens with the reverse situation as
Re: problems using getAnyObject() -- please help
Vineet, First I want to make sure you are using the latest code from SVN and not 1.6b. I have a lot on my plate but I can take a look sometime next week. Assuming you are, and to expedite the debugging I will need to do, please attach a complete simple client examplesince you already showed the a SOAP response I do not need that. Nadir K. Amra "Aggarwal, Vineet" <[EMAIL PROTECTED]> wrote on 10/26/2007 09:29:49 AM: > Hi all, > > I have been struggling with this for days. I?ve finally reached the > point where I can?t get any further and need to reach out for help. > > I need to be able to work directly with the XML contents of the SOAP > request rather than going through one of the objects created in the > server side stubs. The only way I?ve discovered to be able to do > this is by using IWrapperSoapDeSerializer::getAnyObject(). I > thought this was the appropriate method because of the comments in > the header: ?Will deserialize the next available SOAP element and > all child elements.? > > I will walk through some examples of what I?ve tried in an attempt > to properly explain the issues I am running into. Note that these > are just code snippets, I am leaving some of the obvious code out, > and you can pretty much assume that I?ve set things up properly. > Here is what I did with my first attempt at printing out the XML: > > AnyType *pV0 = pIHSDZ->getAnyObject(); > for (int i = 0; i < pV0->_size; i++) > { > cout << pV0->_array[i]; > } > > This only printed out part of the XML. As such, I realized that I > needed to make multiple calls to getAnyObject() in order to get the > next elements, so I tried this: > > AnyType *pV0 = pIHSDZ->getAnyObject(); > while (pV0 != NULL) > { > for (int i = 0; i < pV0->_size; i++) > { > cout << pV0->_array[i]; > } > pV0 = pIHSDZ->getAnyObject(); > } > > This resulted in a segmentation fault, which after reading multiple > posts online, I discovered that it was because getAnyObject() will > never return NULL, so we end up making calls to it even after no > further objects remain, resulting in the segmentation fault. This > is where my confusion comes in. If I ended up getting all the XML > and then made a call to getAnyObect() and it then seg faulted, I > would completely understand. However, it seg faults after I only > get part of the XML (leading me to believe that further calls to > getAnyObect() actually SHOULD return something). > > Let me illustrate this with an example. Say the XML contents of the > SOAP message is the following: > > >xmlns:mantas="http://namespaces.mantas.com/MAD"; > xmlns:action="http://namespaces.mantas.com/MAD/Action"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://namespaces.mantas.com/MAD MantasAlertData.xsd" > > > > > EN > > > > > > EXTERNAL_ENTITY > Matched > >type="string">NM > > > > > > > > > If you run my above code, this is what will get output to the > consoled before the segmentation fault: > > >xmlns:mantas="http://namespaces.mantas.com/MAD"; > xmlns:action="http://namespaces.mantas.com/MAD/Action"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://namespaces.mantas.com/MAD MantasAlertData.xsd" > > > > > EN > > > > > > EXTERNAL_ENTITY > Matched > > > Note that there a few things wrong with this. First of all, why > doesn?t the rest get printed out? If there is more data, why does > it seg fault? I even put in a counter to check how many times I go > through the loop before it seg faults, and limited the loop to that > number?that solves the seg fault issue, but I still don?t get all > the data. Secondly, the data is somewhat corrupted: I don?t know > where the extra slashes have come from (e.g. instead > of ). The same happens with the reverse situation as > well. That is, if I try to feed some XML through an AnyType object > back into the response, it also gets corrupted. For example, the > following code: > > pIWSSZ->createSoapMethod("PrioritizeAlertResponse","http://namespaces.tech.com > "); > try > { > AnyType *pAny = new AnyType(); > pAny->_size = 1; > pAny->_array = new char*[1]; > pAny->_array[0] = ""; > > return pIWSSZ->addOutputAnyObject(pAny); > } > > Produces the following response: > > http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3. > org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> > > http://namespaces.mantas.com";> > > > > > Whereas I am expecting: > > http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3. > org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> > > http://nam
problems using getAnyObject() -- please help
Hi all, I have been struggling with this for days. I've finally reached the point where I can't get any further and need to reach out for help. I need to be able to work directly with the XML contents of the SOAP request rather than going through one of the objects created in the server side stubs. The only way I've discovered to be able to do this is by using IWrapperSoapDeSerializer::getAnyObject(). I thought this was the appropriate method because of the comments in the header: "Will deserialize the next available SOAP element and all child elements." I will walk through some examples of what I've tried in an attempt to properly explain the issues I am running into. Note that these are just code snippets, I am leaving some of the obvious code out, and you can pretty much assume that I've set things up properly. Here is what I did with my first attempt at printing out the XML: AnyType *pV0 = pIHSDZ->getAnyObject(); for (int i = 0; i < pV0->_size; i++) { cout << pV0->_array[i]; } This only printed out part of the XML. As such, I realized that I needed to make multiple calls to getAnyObject() in order to get the next elements, so I tried this: AnyType *pV0 = pIHSDZ->getAnyObject(); while (pV0 != NULL) { for (int i = 0; i < pV0->_size; i++) { cout << pV0->_array[i]; } pV0 = pIHSDZ->getAnyObject(); } This resulted in a segmentation fault, which after reading multiple posts online, I discovered that it was because getAnyObject() will never return NULL, so we end up making calls to it even after no further objects remain, resulting in the segmentation fault. This is where my confusion comes in. If I ended up getting all the XML and then made a call to getAnyObect() and it then seg faulted, I would completely understand. However, it seg faults after I only get part of the XML (leading me to believe that further calls to getAnyObect() actually SHOULD return something). Let me illustrate this with an example. Say the XML contents of the SOAP message is the following: http://namespaces.mantas.com/MAD"; xmlns:action="http://namespaces.mantas.com/MAD/Action"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://namespaces.mantas.com/MAD MantasAlertData.xsd" > EN EXTERNAL_ENTITY Matched NM If you run my above code, this is what will get output to the consoled before the segmentation fault: http://namespaces.mantas.com/MAD"; xmlns:action="http://namespaces.mantas.com/MAD/Action"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://namespaces.mantas.com/MAD MantasAlertData.xsd" > EN EXTERNAL_ENTITY Matched Note that there a few things wrong with this. First of all, why doesn't the rest get printed out? If there is more data, why does it seg fault? I even put in a counter to check how many times I go through the loop before it seg faults, and limited the loop to that number...that solves the seg fault issue, but I still don't get all the data. Secondly, the data is somewhat corrupted: I don't know where the extra slashes have come from (e.g. instead of ). The same happens with the reverse situation as well. That is, if I try to feed some XML through an AnyType object back into the response, it also gets corrupted. For example, the following code: pIWSSZ->createSoapMethod("PrioritizeAlertResponse","http://namespaces.te ch.com"); try { AnyType *pAny = new AnyType(); pAny->_size = 1; pAny->_array = new char*[1]; pAny->_array[0] = ""; return pIWSSZ->addOutputAnyObject(pAny); } Produces the following response: http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> http://namespaces.mantas.com";> Whereas I am expecting: http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> http://namespaces.mantas.com";> Does anybody have any idea why I am experiencing the above issues? If not, is there any other way to directly access the XML? I know this is a lot to digest, but I could REALLY use some help. I am working on a solution for which I centered the web services around Axis for C++, and if I can't get it to work, I am basically screwed. I'm not sure I have the time to rearchitect some other solution (i.e. using Axis for Java and calling the C++ code through JNI or something). Thanks in advance for any help, it is much appreciated! Vineet
Re: AXIS2C: Does WSDL2C support xml:lang?
Hi Michael, I just sent a mail in the dev list for the proposed type map for codegen. Please check whether this fulfill your requirement.. Here is a copy and paste of the mail. The following is a map of xml schema data types and the axis2/c data types to used in the codegen. Currently most of them are not implemented correctly and should be finished before the interop tests. 3.2 Primitive datatypes[1] 3.2.1 string - axis2_char_t * 3.2.2 boolean - axis2_bool_t 3.2.3 decimal - double 3.2.4 float - float 3.2.5 double - double 3.2.6 duration - axutil_duration_t* 3.2.7 dateTime - axutil_date_time_t* 3.2.8 time - axutil_date_time_t* Should use serialize/deserialize_time 3.2.9 date - axutil_date_time_t* Should use serialize/deserialize_date 3.2.10 gYearMonth - axutil_date_time_t* We may need to add serialize/deserialize_year_month for axutil_date_time, any suggestions? 3.2.11 gYear - int (not important) should it be axutil_date_time_t* since it may (optionally) contain timezone as postfix 3.2.12 gMonthDay -axutil_date_time_t* We may need to add serialize/deserialize_month_day for axutil_date_time, any suggestions? 3.2.13 gDay - int same issue in gYear 3.2.14 gMonth - int same issue in gMonth 3.2.15 hexBinary - axiom_node_t* 3.2.16 base64Binary -axutil_base_binary_t* 3.2.17 anyURI -axutil_uri_t * 3.2.18 QName -axutil_qname_t * Currently not interoperable with qname, for { http://somewhere.somdomain , myname } Qname Java generates: http://somewhere.somedomain";>s1:myname C generates myname|http://somewhere.somedomain 3.2.19 NOTATION -? 3.3 Derived datatypes 3.3.1 normalizedString - axis2_char_t* 3.3.2 token - axis2_char_t* 3.3.3 language - axis2_char_t* 3.3.4 NMTOKEN - axis2_char_t* 3.3.5 NMTOKENS - axis2_char_t* or (axutil_array_list_t) 3.3.6 Name - axis2_char_t* 3.3.7 NCName - axis2_char_t* 3.3.8 ID - axis2_char_t* 3.3.9 IDREF - axis2_char_t* 3.3.10 IDREFS - axis2_char_t* 3.3.11 ENTITY - axis2_char_t* 3.3.12 ENTITIES - axis2_char_t* 3.3.13 integer - int 3.3.14 nonPositiveInteger -int 3.3.15 negativeInteger -int 3.3.16 long - long 3.3.17 int - int 3.3.18 short -short 3.3.19 byte - axis2_byte_t 3.3.20 nonNegativeInteger - int 3.3.21 unsignedLong - unsigned long 3.3.22 unsignedInt - unsigned int 3.3.23 unsignedShort - unsigned short 3.3.24 unsignedByte - axis2_byte_t 3.3.25 positiveInteger - unsigned int And should we use typedefs to define strange types to axis2/c? It may improve the readability. REFERENCE [1] http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/ Thanks Dimuthu On 10/23/07, Michael Mole <[EMAIL PROTECTED]> wrote: > > > Well, let me answer my own question. The answer looks like no. When > looking at org.apache.axis2.wsdl.codegen.emitter.CTypeInfo, I can see the > line for xml:lang is commented out. I'll open up a JIRA for implementing > this. > > Thanks, > Mike > > Michael J Molé > Software Engineer > IBM Software Group - Rational > (781)676-2710 > > > *Michael Mole/Lexington/[EMAIL PROTECTED] > > 10/23/2007 11:17 AM Please respond to > "Apache AXIS C User List" > > To > "Apache AXIS C User List" cc > > Subject > AXIS2C: Does WSDL2C support xml:lang? > > > > > > > > Is the "xml:lang" attribute supported by the WSDL2C tool? My schema > definition contains a reference to this, but the generated struct is empty. > > Thanks, > Mike > > Michael J Molé > Software Engineer > IBM Software Group - Rational > (781)676-2710 >