cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liu, Jervis" <j...@iona.com>
Subject RE: Client returns empty string!
Date Thu, 01 Nov 2007 03:29:04 GMT
Hi, using JAX-WS Dispatch APIs should be easier than using SAAJ directly. Actually, the problem
you ran into has been discussed in thread [1] [2]. Note, if you use Dispatch, make sure you
set the mode to MESSAGE.  In this case it is very similar to using SAAJ directly, once you
get back the SoapMessage object, it is up to you how to parse the response message from Soap
body. I found Article [3] is very helpful to understand what kind of response you can expect
from SOAP encoded. I would say it is unlikely that you can convert the payload wrapped inside
Soap body to a JAXB element. For example, not sure how a response payload like below can be
handled by JAXB:

<soapenv:Body>
        <ns1:balanceEnquiryResponse
soapenv:encodingStyle="http://schemas.xmlsoap .org/soap/encoding/"
xmlns:ns1="urn:BalanceEnquiry">
            <balanceEnquiryReturn href="#id0" />
        </ns1:balanceEnquiryResponse>
        <multiRef id="id0" soapenc:root="0 "
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:BalanceEnquiryRspsInfo"
xmlns:soapenc="http://schemas.xmlsoap.org/so ap/encoding/"
xmlns:ns2="http://wsvalueobj.BalanceEnquiry.prepaid.webservices.cortex.com">
            <messageID xsi:type="xsd:int">235894</messageID>
            <instCode xs="xs" i:type="soapenc:string">IDT</instCode>
            <txnType xsi:type="soapenc:string">3</txnType>
            <PAN xsi:type="soapenc:string">5274421040719276</PAN>
            <localDate xs="xs" i:type="xsd:date">2007-09-28</localDate>
            <localTime xsi:type="xsd:long">134206</localTime>
            <avlBal xsi:type="xsd:double">9.0</avlBal>
            <blkAmt xsi:type="x sd:double">0.0</blkAmt>
            <currCode xsi:type="soapenc:string">GBP</currCode>
            <loginID xsi:type="soapenc:string" xsi:nil="true" />
            <sysDate xsi:type="xsd:dat e">2007-10-18</sysDate>
            <actionCode xsi:type="soapenc:string">000</actionCode>
        </multiRef>
    </soapenv:Body>

This is also the reason why PAYLOAD mode might not work well with SOAP encoded,  CXF dispatch
client wont know how to convert the content wrapped in soapbody to a DOMSource or JAXB element
appropriately if the soap body contains more than one child elements.

[1]. http://www.nabble.com/Dispatch-Client-%2B-JaxB-tf4717372.html
[2]. http://www.nabble.com/empty-response-object-tf4706733.html
[3]. http://msdn2.microsoft.com/en-us/library/ms995710.aspx

Jervis

> -----Original Message-----
> From: Glen Mazza [mailto:glen.mazza@verizon.net]
> Sent: 2007?11?1? 6:42
> To: cxf-user@incubator.apache.org
> Subject: Re: Client returns empty string!
> 
> 
> Yes.  I'm doing so right now.
> 
> (Truth be told, you don't even need CXF or any other web 
> services stack
> if you use SAAJ -- it has a SOAPConnection object that will 
> do what you
> want.  But we try to keep that fact a secret so people keep using our
> product.)
> 
> Glen
> 
> Am Mittwoch, den 31.10.2007, 15:31 -0700 schrieb Bashar Jawad:
> > I found this article:
> > 
> > http://www.ibm.com/developerworks/xml/library/x-jaxmsoap/
> > 
> > However this doesn't use cxf. Is it possible to use cxf to 
> receive SOAP 
> > messages with SAAJ ?
> > 
> > Thanks,
> > 
> > Bashar
> > 
> > Glen Mazza wrote:
> > > Am Mittwoch, den 31.10.2007, 14:35 -0700 schrieb Bashar Jawad:
> > >   
> > >> I have been banging my head against the wall on this 
> problem, so I will 
> > >> really appreciate any help.  I am going to simplify the 
> problem as much 
> > >> as possible.
> > >>     
> > >
> > >   
> > >> 
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:B
ody><get_ip_for_stationResponse 
> > >> xmlns="http://iiws.vmsinfo.com/WSVDMStationInfo/"><s-gensym3 
> > >> 
> xsi:type="xsd:string">216.169.138.213</s-gensym3></get_ip_for_
stationResponse></soap:Body></soap:Envelope>
> > >>     
> > >   ^^^^^^^^
> > >
> > > I think you're using an rpc/encoded web service (if it 
> were a phonograph
> > > record, it would be a 78), which is not JAX-WS supported. 
>  No big deal,
> > > you'll just need to use Dispatch objects and SAAJ to get 
> your service to
> > > work.  Googling a bit may help.
> > >
> > > Glen
> > >
> > >
> > >   
> > 
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Mime
View raw message