axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gerrit Quast <>
Subject A Solution: Complex types consumed by .NET
Date Tue, 16 Jul 2002 12:26:50 GMT
Here I'm answering the question I asked in several newsgroups:


The problem was, that it wasn't possible to deserialize a complex type
in .NET, which was sent by AXIS. I either got an InvalidCastException
or an error in the XML-Document.

A Solution:

When sending a complex type, the wsdl-file has to contain a schema 
definition of this type. Let's take a UserInfo-Bean with two simple strings:

  <schema targetNamespace="" xmlns="">
   <complexType name="UserInfo">
    	<element name="firstname" type="xsd:string"/>
    	<element name="lastname" type="xsd:string"/>

When deploying this service, you have to provide a beanMapping:

<service name="TestService" provider="java:RPC">
    <parameter value="com.webapplic.service.TestService" name="className"/>
    <parameter value="*" name="allowedMethods"/>
    <beanMapping qname="nq:UserInfo" xmlns:nq="" languageSpecificType="java:com.webapplic.service.UserInfo"/>

When generating the client stub in .NET Visual Studio, a proxy is gene-
rated and a class, which has two public strings: firstname and lastname.

/// <remarks/>
    [System.Xml.Serialization.SoapTypeAttribute("UserInfo", "")]
    public class SECAuthorizedApplication {
        /// <remarks/>
        public string firstname;
        /// <remarks/>
        public string lastname;

Now the service should work!

The mistake was, that targetNamesapce from WSDL and the xmlns:qn in
deploy.wsdd didn't match.

Thought, would be nice to share this info, since i only found quesitons
about this topic in the newsgroups and didn't get any response anywhere.

Have a nice day, Gerrit


Gerrit Quast                  
CEO Research & Development

WebApplic GmbH                v: 0700 - WebApplic
Wegländer Strasse 24          g: 0711 - 78 23 91 - 40
70563 Stuttgart

Rosenbergstrasse 128          p: 0711 - 3 05 65 26
70193 Stuttgart               m: 0178 - 4 72 47 73    
WEB.DE MyPage - Ultimatives Kommunikationstool! Ihre Message sofort
online! Domain aenderbar!

View raw message