473,394 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Cannot map complex types in WSDL

hi

I have a java web service called "Registration service" and C# client
which is a consumer of that service

java web service running under Tomcat has following interface API
exposed

public RegistrationResponse registerDevice(RegistrationRequest regReq)
throws RemoteException

The code works like below:

1. During registering device suppose the server founds an exception
then it sets that exception inside Remote Exception and throw it.

For e,g
throw new RemoteException("Registration Web Service: " + message, e);
where e is the custom exception defined in RegistrationService on
server. For e,g "KeyNotFoundException" which drives
"DataModelException" which is again a custom exception

My WSDL file looks like below:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="RegistrationService"

targetNamespace="http://www.novell.com/zenworks/webservice/registration"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.novell.com/zenworks/webservice/registration"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<types>
<xs:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"

targetNamespace="http://www.novell.com/zenworks/webservice/registration"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xs:element name="RegistrationRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="DeviceInformation">
<xs:complexType>
<xs:sequence>
<xs:element name="GUID" type="xs:string"/>
<xs:element name="OS" type="xs:string"/>
<xs:element name="HostName" type="xs:string"/>
<xs:element name="CPU" type="xs:string"/>
<xs:element name="DNS" type="xs:string"/>
<xs:element name="Port" type="xs:int"/>
<xs:element name="NetworkAddresses">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0"
name="NetworkAddress">
<xs:complexType>
<xs:sequence>
<xs:element name="IPAddress" type="xs:string"/>
<xs:element name="SubnetMask" type="xs:string"/>
<xs:element name="MACAddress" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" name="RegistrationCode"
type="xs:string"/>
<xs:element minOccurs="0" name="DeviceType" type="xs:string"/>
<xs:element minOccurs="0" name="Password" type="xs:string"/>
<xs:element minOccurs="0" name="Location" type="xs:string"/>
<xs:element minOccurs="0" name="AssetTag" type="xs:string"/>
<xs:element minOccurs="0" name="PrimaryAddress"
type="xs:string"/>
<xs:element minOccurs="0" name="Alias" type="xs:string"/>
<xs:element minOccurs="0" name="XenType" type="xs:string"/>
<xs:element minOccurs="0" name="XenHost" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RegistrationResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="DeviceName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="DataModelException">
<xs:sequence>
<xs:element name="messageText" type="xs:string"/>
<xs:element name="resourceKey" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="KeyNotFoundException">
<xs:complexContent>
<xs:extension base="tns:DataModelException">
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<element name="string" type="xsd:string"/>
</xs:schema>
</types>
<message name="registerDeviceInput">
<part element="tns:RegistrationRequest" name="arg0"/>
</message>
<message name="registerDeviceOutput">
<part element="tns:RegistrationResponse" name="result"/>
</message>
<message name="pingInput"/>
<message name="pingOutput">
<part element="tns:string" name="result"/>
</message>
<portType name="Registration">
<operation name="registerDevice">
<input message="tns:registerDeviceInput"/>
<output message="tns:registerDeviceOutput"/>
</operation>
<operation name="ping">
<input message="tns:pingInput"/>
<output message="tns:pingOutput"/>
</operation>
</portType>
<binding name="RegistrationBinding" type="tns:Registration">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="registerDevice">
<soap:operation
soapAction="http://www.novell.com/zenworks/webservice/registration/registerDevice"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="ping">
<soap:operation
soapAction="http://www.novell.com/zenworks/webservice/registration/ping"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="RegistrationService">
<port binding="tns:RegistrationBinding" name="RegistrationPort">
<soap:address
location="http://localhost:8080/zenworks-registration/registration"/>
</port>
</service>
</definitions>
When I try to generate a C# stub by giving this wsdl file throwugh
WSDL.exe it looks like below

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be
lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Serialization;

//
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
//
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ws dl",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Web.Services.WebServiceBindingAttribute(Nam e="RegistrationBinding",
Namespace="http://www.novell.com/zenworks/webservice/registration")]
public partial class RegistrationService :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {

private System.Threading.SendOrPostCallback
registerDeviceOperationCompleted;

private System.Threading.SendOrPostCallback pingOperationCompleted;

/// <remarks/>
public RegistrationService() {
this.Url =
"http://localhost:8080/zenworks-registration/registration";
}

/// <remarks/>
public event registerDeviceCompletedEventHandler
registerDeviceCompleted;

/// <remarks/>
public event pingCompletedEventHandler pingCompleted;

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://www.novell.com/zenworks/webservice/registration/registerDevice",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Bare)]
[return:
System.Xml.Serialization.XmlElementAttribute("Regi strationResponse",
Namespace="http://www.novell.com/zenworks/webservice/registration")]
public RegistrationResponse
registerDevice([System.Xml.Serialization.XmlElementAttribute(Names pace="http://www.novell.com/zenworks/webservice/registration")]
RegistrationRequest RegistrationRequest) {
object[] results = this.Invoke("registerDevice", new object[] {
RegistrationRequest});
return ((RegistrationResponse)(results[0]));
}

/// <remarks/>
public System.IAsyncResult BeginregisterDevice(RegistrationRequest
RegistrationRequest, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("registerDevice", new object[] {
RegistrationRequest}, callback, asyncState);
}

/// <remarks/>
public RegistrationResponse EndregisterDevice(System.IAsyncResult
asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((RegistrationResponse)(results[0]));
}

/// <remarks/>
public void registerDeviceAsync(RegistrationRequest
RegistrationRequest) {
this.registerDeviceAsync(RegistrationRequest, null);
}

/// <remarks/>
public void registerDeviceAsync(RegistrationRequest
RegistrationRequest, object userState) {
if ((this.registerDeviceOperationCompleted == null)) {
this.registerDeviceOperationCompleted = new
System.Threading.SendOrPostCallback(this.Onregiste rDeviceOperationCompleted);
}
this.InvokeAsync("registerDevice", new object[] {
RegistrationRequest},
this.registerDeviceOperationCompleted, userState);
}

private void OnregisterDeviceOperationCompleted(object arg) {
if ((this.registerDeviceCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEvent Args
invokeArgs =
((System.Web.Services.Protocols.InvokeCompletedEve ntArgs)(arg));
this.registerDeviceCompleted(this, new
registerDeviceCompletedEventArgs(invokeArgs.Result s, invokeArgs.Error,
invokeArgs.Cancelled, invokeArgs.UserState));
}
}

/// <remarks/>

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://www.novell.com/zenworks/webservice/registration/ping",
Use=System.Web.Services.Description.SoapBindingUse .Literal,
ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("stri ng",
Namespace="http://www.novell.com/zenworks/webservice/registration")]
public string ping() {
object[] results = this.Invoke("ping", new object[0]);
return ((string)(results[0]));
}

/// <remarks/>
public System.IAsyncResult Beginping(System.AsyncCallback callback,
object asyncState) {
return this.BeginInvoke("ping", new object[0], callback,
asyncState);
}

/// <remarks/>
public string Endping(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}

/// <remarks/>
public void pingAsync() {
this.pingAsync(null);
}

/// <remarks/>
public void pingAsync(object userState) {
if ((this.pingOperationCompleted == null)) {
this.pingOperationCompleted = new
System.Threading.SendOrPostCallback(this.OnpingOpe rationCompleted);
}
this.InvokeAsync("ping", new object[0],
this.pingOperationCompleted, userState);
}

private void OnpingOperationCompleted(object arg) {
if ((this.pingCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEvent Args
invokeArgs =
((System.Web.Services.Protocols.InvokeCompletedEve ntArgs)(arg));
this.pingCompleted(this, new
pingCompletedEventArgs(invokeArgs.Results, invokeArgs.Error,
invokeArgs.Cancelled, invokeArgs.UserState));
}
}

/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ws dl",
"2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Anonymou sType=true)]
public partial class RegistrationRequest {

private RegistrationRequestDeviceInformation
deviceInformationField;

/// <remarks/>
public RegistrationRequestDeviceInformation DeviceInformation {
get {
return this.deviceInformationField;
}
set {
this.deviceInformationField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ws dl",
"2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Anonymou sType=true)]
public partial class RegistrationRequestDeviceInformation {

private string gUIDField;

private string osField;

private string hostNameField;

private string cPUField;

private string dNSField;

private int portField;

private RegistrationRequestDeviceInformationNetworkAddress[]
networkAddressesField;

private string registrationCodeField;

private string deviceTypeField;

private string passwordField;

private string locationField;

private string assetTagField;

private string primaryAddressField;

private string aliasField;

private string xenTypeField;

private string xenHostField;

/// <remarks/>
public string GUID {
get {
return this.gUIDField;
}
set {
this.gUIDField = value;
}
}

/// <remarks/>
public string OS {
get {
return this.osField;
}
set {
this.osField = value;
}
}

/// <remarks/>
public string HostName {
get {
return this.hostNameField;
}
set {
this.hostNameField = value;
}
}

/// <remarks/>
public string CPU {
get {
return this.cPUField;
}
set {
this.cPUField = value;
}
}

/// <remarks/>
public string DNS {
get {
return this.dNSField;
}
set {
this.dNSField = value;
}
}

/// <remarks/>
public int Port {
get {
return this.portField;
}
set {
this.portField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlArrayItemAttribute("Ne tworkAddress",
IsNullable=false)]
public RegistrationRequestDeviceInformationNetworkAddress[]
NetworkAddresses {
get {
return this.networkAddressesField;
}
set {
this.networkAddressesField = value;
}
}

/// <remarks/>
public string RegistrationCode {
get {
return this.registrationCodeField;
}
set {
this.registrationCodeField = value;
}
}

/// <remarks/>
public string DeviceType {
get {
return this.deviceTypeField;
}
set {
this.deviceTypeField = value;
}
}

/// <remarks/>
public string Password {
get {
return this.passwordField;
}
set {
this.passwordField = value;
}
}

/// <remarks/>
public string Location {
get {
return this.locationField;
}
set {
this.locationField = value;
}
}

/// <remarks/>
public string AssetTag {
get {
return this.assetTagField;
}
set {
this.assetTagField = value;
}
}

/// <remarks/>
public string PrimaryAddress {
get {
return this.primaryAddressField;
}
set {
this.primaryAddressField = value;
}
}

/// <remarks/>
public string Alias {
get {
return this.aliasField;
}
set {
this.aliasField = value;
}
}

/// <remarks/>
public string XenType {
get {
return this.xenTypeField;
}
set {
this.xenTypeField = value;
}
}

/// <remarks/>
public string XenHost {
get {
return this.xenHostField;
}
set {
this.xenHostField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ws dl",
"2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Anonymou sType=true)]
public partial class RegistrationRequestDeviceInformationNetworkAddress
{

private string iPAddressField;

private string subnetMaskField;

private string mACAddressField;

/// <remarks/>
public string IPAddress {
get {
return this.iPAddressField;
}
set {
this.iPAddressField = value;
}
}

/// <remarks/>
public string SubnetMask {
get {
return this.subnetMaskField;
}
set {
this.subnetMaskField = value;
}
}

/// <remarks/>
public string MACAddress {
get {
return this.mACAddressField;
}
set {
this.mACAddressField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ws dl",
"2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Xml.Serialization.XmlTypeAttribute(Anonymou sType=true)]
public partial class RegistrationResponse {

private string deviceNameField;

/// <remarks/>
public string DeviceName {
get {
return this.deviceNameField;
}
set {
this.deviceNameField = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ws dl",
"2.0.50727.42")]
public delegate void registerDeviceCompletedEventHandler(object sender,
registerDeviceCompletedEventArgs e);

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ws dl",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
public partial class registerDeviceCompletedEventArgs :
System.ComponentModel.AsyncCompletedEventArgs {

private object[] results;

internal registerDeviceCompletedEventArgs(object[] results,
System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}

/// <remarks/>
public RegistrationResponse Result {
get {
this.RaiseExceptionIfNecessary();
return ((RegistrationResponse)(this.results[0]));
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ws dl",
"2.0.50727.42")]
public delegate void pingCompletedEventHandler(object sender,
pingCompletedEventArgs e);

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("ws dl",
"2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
public partial class pingCompletedEventArgs :
System.ComponentModel.AsyncCompletedEventArgs {

private object[] results;

internal pingCompletedEventArgs(object[] results, System.Exception
exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}

/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
}
}
}
It does not seem to have mapping of "KeyNotFoundException" or
"DatamodelException".

so when remote exception is catch on client side and we try to print
message in it it say: "unable to serialize java.rmi.remoteException no
serializer found for "KeyNotFoundException"

Please let me know what needs to be done to handle such cases

Dec 28 '06 #1
0 3553

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: burdeen | last post by:
I've been trying to return an array with PHP5 soap. Is this not supported? or am i doing it wrong? Seems to return on the last element in the array. In my WSDL i've defined my return type as a...
0
by: David | last post by:
Hi everyone, I wonder how is it possible to make PHP SOAP extension convert the returned complex type to an instance of one of my classes. Here I give you a short example: complexTest.wsdl:...
0
by: mjcsfo | last post by:
I can't seem to find a reference nor any helpful threads on this topic. I've gotten the following error in two circumstances: 1. A complex type has nested within it another complex type, in the...
0
by: Bartas | last post by:
Hi, I'am writting a simple SOAP client in python (2.4) using SOAPpy lib. I've met with this problem: when I want to send a list of complex type using some method from WebService(java,WAS), ...
1
by: yuri | last post by:
Hello, Is it possible to create a binding that would map an input message with a part defined as a complex-type element to a url-encoded string? For example, wsdl file defines a message as ...
1
by: Marc | last post by:
Hi! I'm working with a C# client that calls a php web service. I've created a wrapper to call the service using .NET wsdl tool (adding a web reference). The call to the server works fine, it...
7
by: Nalaka | last post by:
Hi, I created a sinple web service that returns a dataSet. Then I created a client program that uses this web service (that returns the Dataset). My question is, how did the client figure...
1
by: Hennesey | last post by:
Hello all, I am developing a Visual Studio .Net 2005 application that consumes an Axis 1.3 web service. Importing the WSDL file generates an error "cannot resolve apachesoap:Map type" ...
0
by: Thomas.Koerfer | last post by:
Hey guys, I googled for nearly 3 hours - but no result... We run a web-service and want to reach that service from Access. In the following part you see the wsdl content and the automatically...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.