You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Brendan Reekie <br...@sandvine.com> on 2007/05/22 20:35:17 UTC
Java2Wsdl with DataHandler method
Hi,
I'm trying to generate a WSDL from an existing Bean class that has a
method that returns a complex response with a DataHandler element. From
what I understand the Java2Wsdl utility should map this into a
base64Binary type to handle an attachment. In my WSDL it's generating a
xsd:anytype without any attachment information.
Is it possible to go from Java code to WSDL in this fashion? All the
examples I've seen assume that you're starting from a WSDL to generate
both your server and client code from.
Thanks in advance,
Brendan
Re: Java2Wsdl with DataHandler method
Posted by Thilina Gunarathne <cs...@gmail.com>.
> Is the wsdl ->
> server code the approach that we should be taking?
WSDL first is the most recomended approach.. But you can also live
with what you are doing..
As I said earlier DataHandler should be mapped to a base64Binary typed
element.. AFAIK Axis2 is doing it correctly in the 1.2 release..
> </inputString><sampleAttachment
> xmlns="http://support.testservice.sandvine.com/xsd"><xop:Include
> href="cid:1.urn:uuid:856198AF79288FB4B21180005720146@apache.org"
> xmlns:xop="http://www.w3.org/2004/08/xop/include"
> /></sampleAttachment>
Please check whether the OMElement you are getting is the
sampleAttachment element..
If so you will be able find the attachment as a DataHandler in the
OMText child of that element..
Hopefully you will get a better experience than the above if you
move to axis2 1.2..
Thanks,
Thilina
--
Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: Java2Wsdl with DataHandler method
Posted by Brendan Reekie <br...@sandvine.com>.
Hi Thilina,
We've been trying to go from server code -> wsdl using the Java2Wsdl
tool. All the working examples we've seen are going from wsdl -> server
code which you can then specify the base64Binary type. Is the wsdl ->
server code the approach that we should be taking?
Thanks for all of the support, it's much appreciated!
Here's a TCPMON snapshot of the request/response.
POST /axis2/services/TestWebService HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "urn:complexType"
User-Agent: Axis2
Host: 127.0.0.1:8081
Transfer-Encoding: chunked
1d9
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body>
<ns2:complexType
xmlns:ns2="http://ws.testservice.sandvine.com/xsd"><ns2:inputBean><s1:in
putInt
xmlns:s1="http://support.testservice.sandvine.com/xsd">123</s1:inputInt>
<s2:inputString
xmlns:s2="http://support.testservice.sandvine.com/xsd">Test ComplexType
call</s2:inputString></ns2:inputBean></ns2:complexType></soapenv:Body></
soapenv:Envelope>
0
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: multipart/related;
boundary=MIMEBoundaryurn_uuid_856198AF79288FB4B21180005720144;
type="application/xop+xml";
start="<0....@apache.org>";
start-info="text/xml";charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 24 May 2007 11:22:00 GMT
427
--MIMEBoundaryurn_uuid_856198AF79288FB4B21180005720144
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0....@apache.org>
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body>
<ns:complexTypeResponse
xmlns:ns="http://ws.testservice.sandvine.com/xsd"><ns:return><address
xmlns="http://support.testservice.sandvine.com/xsd"><city>Waterloo</city
><postalcode>N2N 3C3</postalcode><street>Phillip
Street</street></address><inputInt
xmlns="http://support.testservice.sandvine.com/xsd">123</inputInt><input
String xmlns="http://support.testservice.sandvine.com/xsd">Test
ComplexType call</inputString><sampleAttachment
xmlns="http://support.testservice.sandvine.com/xsd"><xop:Include
href="cid:1.urn:uuid:856198AF79288FB4B21180005720146@apache.org"
xmlns:xop="http://www.w3.org/2004/08/xop/include"
/></sampleAttachment></ns:return></ns:complexTypeResponse></soapenv:Body
></soapenv:Envelope>
38
--MIMEBoundaryurn_uuid_856198AF79288FB4B21180005720144
162
Content-Type: text/plain
Content-Transfer-Encoding: binary
Content-ID: <1....@apache.org>
************************************************************************
***************
THIS IS THE ATTACHMENT
************************************************************************
***************
38
--MIMEBoundaryurn_uuid_856198AF79288FB4B21180005720144
2
--
0
-----Original Message-----
From: Thilina Gunarathne [mailto:csethil@gmail.com]
Sent: Thursday, May 24, 2007 7:00 AM
To: axis-user@ws.apache.org
Subject: Re: Java2Wsdl with DataHandler method
> Is it correct than for Java2Wsdl to map a DataHandler to xsd:anytype
> versus the other examples of using base64Binary?
It should map a DataHandler to base64Binary..
> The issue we're experiencing is we are sending a file attachment from
> the server to the client. We can see the Soap attachment (we're using
> MTOM) via TCPMON. On the client side we're now trying to retrieve the
> attachment but without any luck. The client side mapped the attachment
> into an OMElement.
This is because you had xsd:anyType generated for the attachment..
Axis2 would have figured the attachment correctly if it would have
been base64Binary..
> The examples we've seen refer to getFirstOMChild()
> off the OMElement, but in my example it does not contain any children.
> Any ideas on how to get the attachment out of the OMElement?
If possible please post a message snapshot taken using tcpmon...
Normally and MTOM attachment should map to an OMText object..
Thanks,
Thilina
>
> Thanks in advance,
>
> Brendan
>
> -----Original Message-----
> From: Deepal Jayasinghe [mailto:deepal@opensource.lk]
> Sent: Thursday, May 24, 2007 5:40 AM
> To: axis-user@ws.apache.org
> Subject: Re: Java2Wsdl with DataHandler method
>
> Hi Brendan ,
>
> We had that issue in Axis2 1.1.1 , but in Axis2 1.2 release we have
> fixed that.
>
> Thanks
> Deepal
> >
> > Hi,
> >
> > I'm trying to generate a WSDL from an existing Bean class that has a
> > method that returns a complex response with a DataHandler element.
> > From what I understand the Java2Wsdl utility should map this into a
> > base64Binary type to handle an attachment. In my WSDL it's
generating
> > a xsd:anytype without any attachment information.
> >
> > Is it possible to go from Java code to WSDL in this fashion? All the
> > examples I've seen assume that you're starting from a WSDL to
generate
> > both your server and client code from.
> >
> > Thanks in advance,
> >
> > Brendan
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
Thilina Gunarathne - http://www.wso2.com -
http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Java2Wsdl with DataHandler method
Posted by Thilina Gunarathne <cs...@gmail.com>.
> Is it correct than for Java2Wsdl to map a DataHandler to xsd:anytype
> versus the other examples of using base64Binary?
It should map a DataHandler to base64Binary..
> The issue we're experiencing is we are sending a file attachment from
> the server to the client. We can see the Soap attachment (we're using
> MTOM) via TCPMON. On the client side we're now trying to retrieve the
> attachment but without any luck. The client side mapped the attachment
> into an OMElement.
This is because you had xsd:anyType generated for the attachment..
Axis2 would have figured the attachment correctly if it would have
been base64Binary..
> The examples we've seen refer to getFirstOMChild()
> off the OMElement, but in my example it does not contain any children.
> Any ideas on how to get the attachment out of the OMElement?
If possible please post a message snapshot taken using tcpmon...
Normally and MTOM attachment should map to an OMText object..
Thanks,
Thilina
>
> Thanks in advance,
>
> Brendan
>
> -----Original Message-----
> From: Deepal Jayasinghe [mailto:deepal@opensource.lk]
> Sent: Thursday, May 24, 2007 5:40 AM
> To: axis-user@ws.apache.org
> Subject: Re: Java2Wsdl with DataHandler method
>
> Hi Brendan ,
>
> We had that issue in Axis2 1.1.1 , but in Axis2 1.2 release we have
> fixed that.
>
> Thanks
> Deepal
> >
> > Hi,
> >
> > I'm trying to generate a WSDL from an existing Bean class that has a
> > method that returns a complex response with a DataHandler element.
> > From what I understand the Java2Wsdl utility should map this into a
> > base64Binary type to handle an attachment. In my WSDL it's generating
> > a xsd:anytype without any attachment information.
> >
> > Is it possible to go from Java code to WSDL in this fashion? All the
> > examples I've seen assume that you're starting from a WSDL to generate
> > both your server and client code from.
> >
> > Thanks in advance,
> >
> > Brendan
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
Thilina Gunarathne - http://www.wso2.com - http://thilinag.blogspot.com
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
RE: Java2Wsdl with DataHandler method
Posted by Brendan Reekie <br...@sandvine.com>.
Hi Deepal,
Is it correct than for Java2Wsdl to map a DataHandler to xsd:anytype
versus the other examples of using base64Binary?
The issue we're experiencing is we are sending a file attachment from
the server to the client. We can see the Soap attachment (we're using
MTOM) via TCPMON. On the client side we're now trying to retrieve the
attachment but without any luck. The client side mapped the attachment
into an OMElement. The examples we've seen refer to getFirstOMChild()
off the OMElement, but in my example it does not contain any children.
Any ideas on how to get the attachment out of the OMElement?
Thanks in advance,
Brendan
-----Original Message-----
From: Deepal Jayasinghe [mailto:deepal@opensource.lk]
Sent: Thursday, May 24, 2007 5:40 AM
To: axis-user@ws.apache.org
Subject: Re: Java2Wsdl with DataHandler method
Hi Brendan ,
We had that issue in Axis2 1.1.1 , but in Axis2 1.2 release we have
fixed that.
Thanks
Deepal
>
> Hi,
>
> I'm trying to generate a WSDL from an existing Bean class that has a
> method that returns a complex response with a DataHandler element.
> From what I understand the Java2Wsdl utility should map this into a
> base64Binary type to handle an attachment. In my WSDL it's generating
> a xsd:anytype without any attachment information.
>
> Is it possible to go from Java code to WSDL in this fashion? All the
> examples I've seen assume that you're starting from a WSDL to generate
> both your server and client code from.
>
> Thanks in advance,
>
> Brendan
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Java2Wsdl with DataHandler method
Posted by AJ81 <aj...@gmail.com>.
Hello Deepal,
How do I send an array of Datahandlers from a client .
I have a class which has a getter , setter for DataHandler [] arr - but in
the wsdl the type is "xsd:anytype"
Thanks
AJ
Deepal Jayasinghe wrote:
>
> Hi Brendan ,
>
> We had that issue in Axis2 1.1.1 , but in Axis2 1.2 release we have
> fixed that.
>
> Thanks
> Deepal
>>
>> Hi,
>>
>> I’m trying to generate a WSDL from an existing Bean class that has a
>> method that returns a complex response with a DataHandler element.
>> From what I understand the Java2Wsdl utility should map this into a
>> base64Binary type to handle an attachment. In my WSDL it’s generating
>> a xsd:anytype without any attachment information.
>>
>> Is it possible to go from Java code to WSDL in this fashion? All the
>> examples I’ve seen assume that you’re starting from a WSDL to generate
>> both your server and client code from.
>>
>> Thanks in advance,
>>
>> Brendan
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/Java2Wsdl-with-DataHandler-method-tp10745046p25531254.html
Sent from the Axis - User mailing list archive at Nabble.com.
Re: Java2Wsdl with DataHandler method
Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Brendan ,
We had that issue in Axis2 1.1.1 , but in Axis2 1.2 release we have
fixed that.
Thanks
Deepal
>
> Hi,
>
> I’m trying to generate a WSDL from an existing Bean class that has a
> method that returns a complex response with a DataHandler element.
> From what I understand the Java2Wsdl utility should map this into a
> base64Binary type to handle an attachment. In my WSDL it’s generating
> a xsd:anytype without any attachment information.
>
> Is it possible to go from Java code to WSDL in this fashion? All the
> examples I’ve seen assume that you’re starting from a WSDL to generate
> both your server and client code from.
>
> Thanks in advance,
>
> Brendan
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org