Dear Sir,

Are you sure this works:

SOAPMappingRegistry smr = new SOAPMappingRegistry();
StringDeserializer sd = new StringDeserializer();
smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("", "Result"),
null, null, sd);

I can not make it work.

My code is as follows:

    OldUser     theUser = new OldUser(username, domain);
    Display     display = new Display(screenname);
    UserDetails userDetails = new UserDetails(theUser,display);
    SOAPMappingRegistry smr = new SOAPMappingRegistry();
    BeanSerializer beanSer = new BeanSerializer();
    
    // Map the types.
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,new
QName("http://service.messagevine.com/soap/ri/";,
""),UserDetails.class, beanSer, beanSer);
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,new
QName("http://service.messagevine.com/soap/ri/";,
""),OldUser.class, beanSer, beanSer);
    smr.mapTypes(Constants.NS_URI_SOAP_ENC,new
QName("http://service.messagevine.com/soap/ri/";,
""),Display.class, beanSer, beanSer);

The resulted client request is as follows:(I really want to have
the <userdetails and the <display tags without the attribute at
all, I do not know how)

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

<SOAP-ENV:Body>

<ns1:SetProfile
xmlns:ns1="http://service.messagevine.com/soap/ri/";
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>

<userdetails xsi:type="ns1:">
<user xsi:type="ns1:">
<name xsi:type="xsd:string">timuser</name>
<domain xsi:type="xsd:string">mytelusmobility.com</domain>
</user>
<display xsi:type="ns1:">
<nickname xsi:type="xsd:string">timscreen</nickname>
</display>
</userdetails>

</ns1:SetProfile>

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


--- Chris Malley <[EMAIL PROTECTED]> wrote:
> Gianpiero wrote:
> > 
> > > Can someone tell me if there is any incompatibility issue
> > > between Apache SOAP and Microsoft SOAP?
> > 
> > It's not so difficult.The Apache SOAP implementation always
> puts the
> > xsi:type elements for all the parameters in the request
> while Microsoft SOAP
> > Toolkit does not. You can handle this situation by
> instructing Apache SOAP
> > Client to not to expect the xsi:type attribute in the
> response received.
> > This is done by following lines in the client code:
> > 
> > SOAPMappingRegistry smr = new SOAPMappingRegistry();
> > StringDeserializer sd = new StringDeserializer();
> > smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName("",
> "Result"), null, null,
> > sd);
> [...]
> 
> Or you can add xsi:type attributes in MS SOAP like this:
> 
>   ISoapSerializerPtr pSerializer;  // smart pointer
>   pSerializer->startElement( "firstName", "", "NONE", "" );
>   pSerializer->SoapAttribute( "type", "", "xsd:string", "xsi"
> );
>   pSerializer->writeString( "Wallace" );
>   pSerializer->endElement();
> 
> -Chris
> 
> -- 
> Chris Malley
> PixelZoom, Inc.             Voice: +1.303.494.8849
> 835 Orman Drive             EMail: [EMAIL PROTECTED]
> Boulder CO 80303-2616


=====
Tim's home page: 
http://www.geocities.com/timwei

__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

Reply via email to