By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,900 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,900 IT Pros & Developers. It's quick & easy.

.NET2.0 WSDL missing type definition(Remoting over soap as webserv

P: n/a
I have simple remoting server exposing following simple method. When I try to
add webreference to this server in another project by serveraddresss?wsdl,
it gives me following error:

Custom tool error: Unable to import WebService/Schema. Unable to import
binding 'MyRemoteObjectBinding' from namespace
'http://schemas.microsoft.com/clr/nsassem/RemoteServer/RemoteServer%2C%20Version%3D1.0.0.0%2C%20Culture%3 Dneutral%2C%20PublicKeyToken%3Dnull'.
Unable to import operation 'GetEmpInfo'.
The datatype
'http://schemas.microsoft.com/clr/nsassem/Brooks.EES.Framework.DataAccess/Brooks.EES.Framework.DataStructure%2C%20Version%3D 1.0.1.1%2C%20Culture%3Dneutral%2C%20PublicKeyToken %3Dbbf6413da47c0685:EmpDetail' is missing.
After some tests, following are my observations.
case 1:
Currently EmpDetail class is defined in different namespace and different
DLL from the remoting server. In this setup, generated wsdl (using ?wsdl) is
missing the type definition of the EmpDetails, which is resulting in above
error.
Note: this works fine with .Net1.1, problem started occuring when we
upgraded to .net2.0

case 2:
If I remove get/set methods from the EmpDetail class, ?wsdl generates
correct wsdl with EmpDetalis type definition in the wsdl.

case 3:
If I define EmpDetails class in the same namesapce and same dll (no change
in the EmpDetails definition), ?wsdl generates correct wsdl with the type
definition of EmpDetail calss.

How can I instruct ?wsdl to include all type definition in the case 1
described above?

using Brooks.EES.Framework.DataAccess;
namespace RemoteServer
{
class MyRemoteObject : System.MarshalByRefObject
{
public EmpDetail GetEmpInfo()
{
return new EmpDetail();
}
}
}

namespace Brooks.EES.Framework.DataAccess
{
[Serializable]
public class EmpDetail
{
private string _Id;
private string _description;

public string Id
{
get
{
return _Id;
}
set
{
_Id = value;
}
}

public string Description
{
get
{
return _description;
}
set
{
_description = value;
}
}
}
}
Here is the wsdl snipate which is missing type definition.
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="MyRemoteObject"
targetNamespace="http://schemas.microsoft.com/clr/nsassem/RemoteServer/RemoteServer%2C%20Version%3D1.0.0.0%2C%20Culture%3 Dneutral%2C%20PublicKeyToken%3Dnull"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://schemas.microsoft.com/clr/nsassem/RemoteServer/RemoteServer%2C%20Version%3D1.0.0.0%2C%20Culture%3 Dneutral%2C%20PublicKeyToken%3Dnull"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:suds="http://www.w3.org/2000/wsdl/suds"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://schemas.microsoft.com/clr/nsassem/RemoteServer.MyRemoteObject/RemoteServer%2C%20Version%3D1.0.0.0%2C%20Culture%3 Dneutral%2C%20PublicKeyToken%3Dnull"
xmlns:ns0="http://schemas.microsoft.com/clr/nsassem/RemoteServer/RemoteServer%2C%20Version%3D1.0.0.0%2C%20Culture%3 Dneutral%2C%20PublicKeyToken%3Dnull"
xmlns:ns1="http://schemas.microsoft.com/clr/ns/System"
xmlns:ns3="http://schemas.microsoft.com/clr/nsassem/Brooks.EES.Framework.DataAccess/Brooks.EES.Framework.DataStructure%2C%20Version%3D 1.0.1.1%2C%20Culture%3Dneutral%2C%20PublicKeyToken %3Dbbf6413da47c0685"
xmlns:ns4="http://schemas.microsoft.com/clr/nsassem/Brooks.EES.Framework.DataAccess.EmpDetail/Brooks.EES.Framework.DataStructure%2C%20Version%3D 1.0.1.1%2C%20Culture%3Dneutral%2C%20PublicKeyToken %3Dbbf6413da47c0685"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">

<message name="MyRemoteObject.GetEmpInfoInput">
</message>
<message name="MyRemoteObject.GetEmpInfoOutput">
<part name="return" type="ns3:EmpDetail"/>
</message>

<portType name="MyRemoteObjectPortType">
<operation name="GetEmpInfo">
<input name="GetEmpInfoRequest"
message="tns:MyRemoteObject.GetEmpInfoInput"/>
<output name="GetEmpInfoResponse"
message="tns:MyRemoteObject.GetEmpInfoOutput"/>
</operation>
</portType>

<binding name="MyRemoteObjectBinding" type="tns:MyRemoteObjectPortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<suds:class type="ns0:MyRemoteObject" rootType="MarshalByRefObject">
</suds:class>
<operation name="GetEmpInfo">
<soap:operation
soapAction="http://schemas.microsoft.com/clr/nsassem/RemoteServer.MyRemoteObject/RemoteServer#GetEmpInfo"/>
<suds:method attributes="public"/>
<input name="GetEmpInfoRequest">
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://schemas.microsoft.com/clr/nsassem/RemoteServer.MyRemoteObject/RemoteServer"/>
</input>
<output name="GetEmpInfoResponse">
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://schemas.microsoft.com/clr/nsassem/RemoteServer.MyRemoteObject/RemoteServer"/>
</output>
</operation>
</binding>
..............................................


Here is the correct wsdl with type information:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="MyRemoteObject"
targetNamespace="http://schemas.microsoft.com/clr/nsassem/RemoteServer/RemoteServer%2C%20Version%3D1.0.0.0%2C%20Culture%3 Dneutral%2C%20PublicKeyToken%3Dnull"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://schemas.microsoft.com/clr/nsassem/RemoteServer/RemoteServer%2C%20Version%3D1.0.0.0%2C%20Culture%3 Dneutral%2C%20PublicKeyToken%3Dnull"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:suds="http://www.w3.org/2000/wsdl/suds"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://schemas.microsoft.com/clr/nsassem/RemoteServer.MyRemoteObject/RemoteServer%2C%20Version%3D1.0.0.0%2C%20Culture%3 Dneutral%2C%20PublicKeyToken%3Dnull"
xmlns:ns0="http://schemas.microsoft.com/clr/nsassem/RemoteServer/RemoteServer%2C%20Version%3D1.0.0.0%2C%20Culture%3 Dneutral%2C%20PublicKeyToken%3Dnull"
xmlns:ns1="http://schemas.microsoft.com/clr/ns/System"
xmlns:ns3="http://schemas.microsoft.com/clr/nsassem/Brooks.EES.Framework.DataAccess/Brooks.EES.Framework.DataStructure%2C%20Version%3D 1.0.1.1%2C%20Culture%3Dneutral%2C%20PublicKeyToken %3Dbbf6413da47c0685"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<schema
targetNamespace="http://schemas.microsoft.com/clr/nsassem/Brooks.EES.Framework.DataAccess/Brooks.EES.Framework.DataStructure%2C%20Version%3D 1.0.1.1%2C%20Culture%3Dneutral%2C%20PublicKeyToken %3Dbbf6413da47c0685"
xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<element name="EmpDetail" type="ns3:EmpDetail"/>
<complexType name="EmpDetail">
<all>
<element name="_Id" type="xsd:string"/>
<element name="_description" type="xsd:string"/>
</all>
</complexType>
</schema>
</types>

<message name="MyRemoteObject.GetEmpInfoInput">
</message>
<message name="MyRemoteObject.GetEmpInfoOutput">
<part name="return" type="ns3:EmpDetail"/>
</message>

<portType name="MyRemoteObjectPortType">
<operation name="GetEmpInfo">
<input name="GetEmpInfoRequest"
message="tns:MyRemoteObject.GetEmpInfoInput"/>
<output name="GetEmpInfoResponse"
message="tns:MyRemoteObject.GetEmpInfoOutput"/>
</operation>
</portType>

<binding name="MyRemoteObjectBinding" type="tns:MyRemoteObjectPortType">

Feb 23 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.