You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by "Chinthana C. Dinapala" <CD...@virtusa.com> on 2005/07/01 04:37:29 UTC

RE: getting attributes from the SoapResponse

Hi Krishna,

>1.   Does there exist an API for setting an attribute of an element on
>the server side?

>2.   Does there exist an API for getting the attribute of a particular 
>element from the SoapMessage?

This is a pending stuff still. As in AXISCPP-634 client side is have
implemented but to implement in server side its more than simple patch.
This is taking some time. 

>3.   Does the axis client process ref tag ( previously href tag on its 
>own? )

Also ref support also is pending right now. AXISCPP-111 and AXISCPP-631.
And if you can send WSDL file and you client and server implementation I
would able to test and address better way to you questions. 

Thanks


Chinthana 

-----Original Message-----
From: krishna [mailto:krishna@lac.uic.edu] 
Sent: Thursday, June 30, 2005 11:10 PM
To: axis-c-user@ws.apache.org
Subject: getting attributes from the SoapResponse

Hi All

I have a few questions ( some are clarifications ) regarding Axis API 
and behavior.

1.   Does there exist an API for setting an attribute of an element on 
the server side? 
      
2.   Does there exist an API for getting the attribute of a particular 
element from the SoapMessage?
      
       Notes:
       I found a function called getElementForAttributes and 
getAttributeAsString in the SoapDeSerializer class.
       I notice that the function 
SoapDeSerializer::getElementForAttributes gets only the next token ( 
element ) and exits.
       How does one access an token which is part of another token

       To make things more clearer. Can I access the ref attribute of 
the intItemArray tag in the SOAP-RESPONSE shown below>

> HTTP/1.1 200 OK
> Date: Thu, 30 Jun 2005 15:36:05 GMT
> Server: Apache/1.3.33 (Debian GNU/Linux)
> Transfer-Encoding: chunked
> Content-Type: text/xml
>  
> 2c0
> <?xml version='1.0' encoding='utf-8' ?>
> <SOAP-ENV:Envelope 
> 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">
> <SOAP-ENV:Body>
> <ns1:echoIntArrayResponse xmlns:ns1="http://soapinterop.org/">
> <intArrayType xsi:type="ns2:intArrayType" 
> xmlns:ns2="http://soapinterop.org/xsd"><intItemArray 
> ref="http://www.studentserv.lac.uic.edu/streamdata.txt" 
> xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
> enc:arrayType="xsd:int[0]"></intItemArray>intArrayType 
> xsi:type="ns2:intArrayType" 
>
xmlns:ns2="http://soapinterop.org/xsd"></intArrayType></ns1:echoIntArray
Response>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
>  
> 0


3.   Does the axis client process ref tag ( previously href tag on its 
own? )


Thanks
Krishna
      

Re: getting attributes from the SoapResponse

Posted by krishna <kr...@lac.uic.edu>.
Hi Chinthana / All

I am trying to get the server to return me a URI in the SOAP-RESPONSE as 
a ref attribute of a complex type.
The service which I selected was the array example using RPC_ENC ( I 
beleive in the latest build on the CVS it has shifted to DOC_LIT ).

SERVER STUB MODIFICATIONS

I have modified the stubs in the server code (intArrayType.cpp) by 
passing the ref tag to the serialize function ( A very inappropriate way 
of doing it but it was supposed to be a makeshift till Axis C++ supports 
the functionality of setting attributes on the server side)

I have also modified the server stub to dump the result onto a file 
instead of returning it in the SOAP-RESPONSE(ie. The array of integers 
is dumped onto a file). The URL returned by the ref tag points to this 
result. So the service is also returning a 0 length array in the 
SOAP-RESPONSE
and the client side is expected to fetch the file from the URL. My 
motivation is to eliminate the time taken to serialize / deserialize 
data for very large amount of data ( in GB ). This is a part of a bigger 
project which I am trying to implement.

CLIENT STUB MODIFICATIONS

I am now trying to modify the client stub code to ensure that the ref 
tag can be extracted from the soap response.
Please see the ref tag as an attribute of intItemArray in the 
SOAP_RESPONSE below.

Please find the ( modified server side and unmodified client ) stub 
files attached.

Thanks
Krishna

>HTTP/1.1 200 OK
>Date: Thu, 30 Jun 2005 15:36:05 GMT
>Server: Apache/1.3.33 (Debian GNU/Linux)
>Transfer-Encoding: chunked
>Content-Type: text/xml
> 
>2c0
><?xml version='1.0' encoding='utf-8' ?>
><SOAP-ENV:Envelope 
>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">
><SOAP-ENV:Body>
><ns1:echoIntArrayResponse xmlns:ns1="http://soapinterop.org/">
><intArrayType xsi:type="ns2:intArrayType" 
>xmlns:ns2="http://soapinterop.org/xsd"><intItemArray 
>ref="http://www.studentserv.lac.uic.edu/streamdata.txt" 
>xmlns:enc="http://www.w3.org/2001/06/soap-encoding" 
>enc:arrayType="xsd:int[0]"></intItemArray>intArrayType 
>xsi:type="ns2:intArrayType" 
>
>  
>
xmlns:ns2="http://soapinterop.org/xsd"></intArrayType></ns1:echoIntArray
Response>

</SOAP-ENV:Body>
</SOAP-ENV:Envelope>