Re: Question about Axis xsd__ types

2005-10-19 Thread Kevin Rogers


Adrian Dick wrote:


Hi,

I think you have mis-understood the API for Arrays here.

Because we need to handle nil (or NULL) elements within arrays, we can't
simply use a NULL terminated array.  Therefore we have a small class to
hold the array, of the following structure (using xsd__string example):
 class xsd__string_Array
 {
   public:
 xsd__string * m_Array;
 int m_Size; // Size of array (inc. NULL or empty elements)
 };

Which you would use something like:
 xsd__string_Array arrayInput;
 arrayInput.m_Array = new xsd__string[2];
 arrayInput.m_Size = 2;
 webServiceStub->methodWithArrayInput(arrayInput);
 





Thank you for your help, greatly appreciated. =)

I am having some issues with the serialization of these arrays , 
however. I'm handling the xsd__string_Array objects just as described:


---

// already defined:
std::vector aVector;
xsd__string_Array aXsdArray;

//then do something like:

aXsdArray.m_Size = aVector.size();

char* theArr[aXsdArray.m_Size + 1]; // + 1 for the NULL terminator (is 
this needed?)


int i = 0;

for (std::vector::iterator p = aVector.begin(); 
p!=aVector.end(); p++)

{
std::string theStr = *p;

theArr[i] = const_cast(theStr.c_str());
i++;
}

theArr[i] = NULL;

aXsdArray.m_Array = theArr;

---

I've stepped through this with gdb and it seems to be doing just what I 
would like (aside from the NULL termination, which I don't know whether 
or not is needed).


From my previous email, these xsd__string_Array objects are elements of 
a complex type:



   
 
   ...some other elements...
   


When I call the service, the output from TCPMon is below. All of the 
xsd__string_Array elements seem to have one incorrect entry (I was 
anticipating multiple entries for each array element containing the 
distinct values - is that correct?).


thanks,
~kevin


--
SOAP request:
--

POST /nile/services/LevelsService HTTP/1.1
Host: denial:2000
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 1296


xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>


http://www.dreamworks.com/nile/schema/";>
MAD
some level name pattern
FX
true
Some note
some note pattern
p���
p���
p���
p���
p���
p���
some seqname pattern
p���
p���
some shotname pattern
p���
false
p���
some shotprior pattern
krogers





--
SOAP response:
--

HTTP/1.1 500 Internal Server Error
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Wed, 19 Oct 2005 20:57:42 GMT
Server: Apache-Coyote/1.1
Connection: close

21e
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:Server.userExceptionjava.io.UTFDataFormatException: 
Invalid byte 1 of 1-byte UTF-8 
sequence.xmlns:ns1="http://xml.apache.org/axis/";>denial.pdi.com 


0

--
Kevin Rogers
PDI / Dreamworks
ext.29163 | 650.562.9163
[EMAIL PROTECTED]



errors in generated codes

2005-10-19 Thread Dushshantha Chandradasa








HI All,

 

I notice some error in generated codes for complex types. 

 

compileService:

 [copy] Copying 1 file to
C:\obj\test\generated\server\cpp\SimpleTypeArray

   [cc] 5 total files to
be compiled.

   [cc]
SimpleTypeArrayWSService.cpp

   [cc]
AxisServiceException.cpp

   [cc]
SimpleTypeArrayWS.cpp

   [cc]
SimpleTypeArrayWSWrapper.cpp

   [cc] Type.cpp

   [cc]
C:\obj\test\generated\server\cpp\SimpleTypeArray\Type.cpp(80) : erro

r C2039: 'reset' : is not a member of 'Type'

  
[cc]
C:\obj\test\generated\server\cpp\SimpleTypeArray\Type.hpp(32

) : see declaration of 'Type'

   [cc]
C:\obj\test\generated\server\cpp\SimpleTypeArray\Type.cpp(121) : err

or C2039: 'reset' : is not a member of 'Type'

  
[cc]
C:\obj\test\generated\server\cpp\SimpleTypeArray\Type.hpp(32

) : see declaration of 'Type'

   [cc]
C:\obj\test\generated\server\cpp\SimpleTypeArray\Type.cpp(122) : err

or C2373: 'reset' : redefinition; different type modifiers

   [cc]
C:\obj\test\generated\server\cpp\SimpleTypeArray\Type.cpp(125) : err

or C2065: 'item' : undeclared identifier

   [cc]
C:\obj\test\generated\server\cpp\SimpleTypeArray\Type.cpp(125) : err

or C2228: left of '.m_Array' must have class/struct/union
type

   [cc]
C:\obj\test\generated\server\cpp\SimpleTypeArray\Type.cpp(126) : err

or C2228: left of '.m_Size' must have class/struct/union
type

   [cc] Generating Code...

   [cc]
C:\obj\test\generated\server\cpp\SimpleTypeArray\SimpleTypeArrayWSWr

apper.cpp(88) : warning C4715:
'SimpleTypeArrayWSWrapper::getInput' : not all co

ntrol paths return a value

   [cc] cl failed with
return code 2

 

 

 

Marcus Dushshantha Chandradasa

Team Virtusa

[EMAIL PROTECTED]