Re: second parameter is null when using wsdl with wsdlsoap:binding style="document"

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Re: second parameter is null when using wsdl with wsdlsoap:binding style="document"

thanks for your help. I'll try to regenerate and rebuild my service with the WRAPPED style.
I think i write my experiences to a little quick start and post it to the subject "[CO] writing a tutorial".

Best Regards

[hidden email] schrieb am 04.05.05 06:14:58:

> When using document style, you don't specify "parameters" in the
> <message> definition. Instead you have one message <part>, and that
> part points to a wrapped element. The wrapper element should be
> defined as a sequence of elements -- which are your parameters.
> If you want to create a parameterized interface, then you want to use
> the "wrapped" style. (which is what .NET uses by default)
> Anne
> On 5/3/05, [hidden email] <[hidden email]> wrote:
> > Hi,
> > in a futher message I read about a similar problem and it's solution.
> >
> > posted solution: change wsdlsoap:binding style="document" to wsdlsoap:binding style="rpc"
> >
> > But the solution posted there is not applicable to me. My little webservice has to be used in a IIS
> > from MS. And the developer suite of MS has problems with WSDL files that use rpc style.
> >
> > Has anyone a idea to solve this?
> >
> > I am using tomcat 5.5.9 with java 1.5.0_02-b09 on windows xp.
> > My axis release is 1.2 from yesterday evening (02.05.2005 18:12)
> >
> > Thanks
> > Harri
> > __________________________________________________________
> > Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
> > weltweit telefonieren!
> >
> >

Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren!

Reply | Threaded
Open this post in threaded view

R: HashMap of HashMaps

Claudia Mavilio

Hello Everybody,

I have the same Lyndon's problem, because I deploy a java webservice
that incapsulate response data into a Hashmap (whose name is "dati",
please see below) using a wsdd file.
The kind of response data into the Hashmap is of type "Costruttore" and
doesn't appear in wsdl file, so the generation of stub and
deserialization classes fails.
Follow a snippet of mi wsdl file and a copy of the wsdd file.
Thanks in advance for any help!!!



<service name="Costruttori" provider="java:RPC">
  <parameter name="className"
  <parameter name="allowedMethods" value="*"/>
        <beanMapping qname="coc:BaseObject" xmlns:coc="urn:coc"
        <beanMapping qname="coc:Costruttore" xmlns:coc="urn:coc"
        <beanMapping qname="coc:IDOperatore" xmlns:coc="urn:coc"
        <beanMapping qname="coc:Esito" xmlns:coc="urn:coc"
        <beanMapping qname="coc:RisultatoOperazione" xmlns:coc="urn:coc"
        <beanMapping qname="coc:Locale" xmlns:coc="urn:coc"
  <parameter name="wsdlServiceElement" value="CostruttoriService"/>
  <parameter name="wsdlServicePort" value="Costruttori"/>
  <parameter name="wsdlPortType" value="Costruttori"/>

complexType name="Esito">

- <sequence>

  <element name="dati" nillable="true" type="apachesoap:Map" />

  <element name="risultatoOperazione" nillable="true"
type="tns1:RisultatoOperazione" />






Subject:    HashMap of HashMaps
From:       Lyndon Tiu <ltiu () alumni ! sfu ! ca>
Date:       2004-11-23 22:03:12
Message-ID: <200411232203.iANM3CO2010215 () rm-rstar ! sfu ! ca>
[Download message RAW]


I have a custom object I am trying to pass across the wire using AXIS
wrapped style \
document-literal service.

The complex object contains a HashMap of HashMaps (that is, the values
of the \
HashMap, are HashMaps themselves).  For reference, I have called this
complex object \

I have used the Java2WSDL tool to generate the WSDL for this class by
supplying the \
Interface.  Of course, the Interface does not specify that the HashMap's
values will \
contain HashMaps, so it seems that the WSDL generated declares that the
"type" of the \
value components of my HashMap will contain an "xsd:string".  A portion
of the WSDL \

<schema targetNamespace=""  \
xmlns=""> <complexType name="mapItem">
    <element name="key" nillable="true" type="xsd:string" />
    <element name="value" nillable="true" type="xsd:string" />
<complexType name="Map">
      <element maxOccurs="unbounded" minOccurs="0" name="item" \
type="apachesoap:mapItem" />   </sequence>
<schema targetNamespace="" \
xmlns="">  <complexType
      <element name="data" nillable="true" type="apachesoap:Map" />

I then used the WSDL2Java tool to generate the client stubs, server
skeletons and \
bindings, and the .wsdd files.  When I make a request to my webservice
(which should \
return my complex object), I construct the HashMap of HashMaps in the
Web Service \
implementation class.  The response is serialized correctly as follows:
<soapenv:Envelope .....>  <soapenv:Body>
    <getDataResponse xmlns="my.namespace">
      <getDataReturn xmlns="">
xmlns:soapenc="" \
xmlns:nsl="">  <key>123</key>

The problem is, that the client side does not seem to be able to
deserialize my \
ojbect correctly.  Perhaps it is expecting a string as the values of the
HashMap as \
opposed to HashMaps.

It is giving me this error:
org.xml.sax.SAXException: SimpleDeserializer encountered a child
element, which is \
NOT expected, in something it was trying to deserialize.

My question is: Why can this object be seeminly serialized correctly if
it can not be \
deserialized?   Is deserializing multidimentional HashMaps a limitation
of the Axis \

Any suggestions would be appreciated.

Thanks for your time.

Lyndon Tiu

=== Start-of Internet E-mail Confidentiality Footer ===

L'uso non autorizzato di questo messaggio o dei suoi allegati e' vietato e potrebbe costituire reato.
Se ha ricevuto per errore questo messaggio, La preghiamo di informarci e di distruggerlo immediatamente coi suoi allegati.
Le dichiarazioni contenute in questo messaggio o nei suoi allegati non impegnano SECETI S.p.A. nei confronti del destinatario o di terzi.
SECETI S.p.A. non si assume alcuna responsabilita' per eventuali intercettazioni, modifiche o danneggiamenti del presente messaggio.

Any unauthorized use of this e-mail or any of its attachments is prohibited and could constitute an offence.
If you are not the intended addressee please advise immediately the sender and destroy the message and its attachments.
The contents of this message shall be understood as neither given nor endorsed by SECETI S.p.A.
SECETI S.p.A. does not accept liability for corruption, interception or amendment, if any, or the consequences thereof.