WSDL missing type definition (Remoting-soap as webservice)

J

Jigar.Patel

I have simple remoting server exposing following simple method. When I try to
add webreference to this server in another project,
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/ns...1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Unable to import operation 'GetEmpInfo'.
The datatype
'http://schemas.microsoft.com/clr/ns...al, PublicKeyToken=bbf6413da47c0685:EmpDetail' is missing.


After some tests, following are my findings.
1. Currently EmpDetail class is defined in different namespace and different
DLL from the remoting server.
2. In this setup, ?wsdl generates wsdl which is missing the type definition
of the EmpDetails, which is resulting in above error.

3. If I remove get/set methods from the EmpDetail class, ?wsdl generates
correct wsdl with EmpDetalis type definition in the wsdl.
4. 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.

Im I missing something? or How can I instruct ?wsdl to include all type
definition.



----------------------------------------------------------------------------
Example Code: RemoteServer
----------------------------------------------------------------------------
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/ns...1.0.0.0, Culture=neutral, PublicKeyToken=null"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://schemas.microsoft.com/clr/ns...1.0.0.0, Culture=neutral, PublicKeyToken=null"
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/ns...1.0.0.0, Culture=neutral, PublicKeyToken=null"
xmlns:ns0="http://schemas.microsoft.com/clr/ns...1.0.0.0, Culture=neutral, PublicKeyToken=null"
xmlns:ns1="http://schemas.microsoft.com/clr/ns/System"
xmlns:ns3="http://schemas.microsoft.com/clr/ns...ture=neutral, PublicKeyToken=bbf6413da47c0685"
xmlns:ns4="http://schemas.microsoft.com/clr/ns...ture=neutral, PublicKeyToken=bbf6413da47c0685"
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:eek:peration
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>

<message name="EmpDetail.get_IdInput">
</message>
<message name="EmpDetail.get_IdOutput">
<part name="return" type="xsd:string"/>
</message>

<message name="EmpDetail.set_IdInput">
<part name="value" type="xsd:string"/>
</message>
<message name="EmpDetail.set_IdOutput">
</message>

<message name="EmpDetail.get_DescriptionInput">
</message>
<message name="EmpDetail.get_DescriptionOutput">
<part name="return" type="xsd:string"/>
</message>

<message name="EmpDetail.set_DescriptionInput">
<part name="value" type="xsd:string"/>
</message>
<message name="EmpDetail.set_DescriptionOutput">
</message>

<portType name="EmpDetailPortType">
<operation name="get_Id">
<input name="get_IdRequest" message="tns:EmpDetail.get_IdInput"/>
<output name="get_IdResponse"
message="tns:EmpDetail.get_IdOutput"/>
</operation>
<operation name="set_Id" parameterOrder="value">
<input name="set_IdRequest" message="tns:EmpDetail.set_IdInput"/>
<output name="set_IdResponse"
message="tns:EmpDetail.set_IdOutput"/>
</operation>
<operation name="get_Description">
<input name="get_DescriptionRequest"
message="tns:EmpDetail.get_DescriptionInput"/>
<output name="get_DescriptionResponse"
message="tns:EmpDetail.get_DescriptionOutput"/>
</operation>
<operation name="set_Description" parameterOrder="value">
<input name="set_DescriptionRequest"
message="tns:EmpDetail.set_DescriptionInput"/>
<output name="set_DescriptionResponse"
message="tns:EmpDetail.set_DescriptionOutput"/>
</operation>
</portType>

<binding name="EmpDetailBinding" type="tns:EmpDetailPortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<suds:class type="ns3:EmpDetail">
</suds:class>
<operation name="get_Id">
<soap:eek:peration
soapAction="http://schemas.microsoft.com/clr/ns...ail/Brooks.EES.Framework.DataStructure#get_Id"/>
<suds:method attributes="public"/>
<input name="get_IdRequest">
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://schemas.microsoft.com/clr/ns....EmpDetail/Brooks.EES.Framework.DataStructure"/>
</input>
<output name="get_IdResponse">
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://schemas.microsoft.com/clr/ns....EmpDetail/Brooks.EES.Framework.DataStructure"/>
</output>
</operation>
<operation name="set_Id">
<soap:eek:peration
soapAction="http://schemas.microsoft.com/clr/ns...ail/Brooks.EES.Framework.DataStructure#set_Id"/>
<suds:method attributes="public"/>
<input name="set_IdRequest">
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://schemas.microsoft.com/clr/ns....EmpDetail/Brooks.EES.Framework.DataStructure"/>
</input>
<output name="set_IdResponse">
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://schemas.microsoft.com/clr/ns....EmpDetail/Brooks.EES.Framework.DataStructure"/>
</output>
</operation>
<operation name="get_Description">
<soap:eek:peration
soapAction="http://schemas.microsoft.com/clr/ns...s.EES.Framework.DataStructure#get_Description"/>
<suds:method attributes="public"/>
<input name="get_DescriptionRequest">
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://schemas.microsoft.com/clr/ns....EmpDetail/Brooks.EES.Framework.DataStructure"/>
</input>
<output name="get_DescriptionResponse">
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://schemas.microsoft.com/clr/ns....EmpDetail/Brooks.EES.Framework.DataStructure"/>
</output>
</operation>
<operation name="set_Description">
<soap:eek:peration
soapAction="http://schemas.microsoft.com/clr/ns...s.EES.Framework.DataStructure#set_Description"/>
<suds:method attributes="public"/>
<input name="set_DescriptionRequest">
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://schemas.microsoft.com/clr/ns....EmpDetail/Brooks.EES.Framework.DataStructure"/>
</input>
<output name="set_DescriptionResponse">
<soap:body use="encoded"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://schemas.microsoft.com/clr/ns....EmpDetail/Brooks.EES.Framework.DataStructure"/>
</output>
</operation>
</binding>

<service name="MyRemoteObjectService">
<port name="MyRemoteObjectPort" binding="tns:MyRemoteObjectBinding">
<soap:address location="http://localhost:8086/x.MyTest"/>
</port>
</service>
</definitions>







-----------------------------------------------------------------
Here is the correct wsdl with type information:
------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="MyRemoteObject"
targetNamespace="http://schemas.microsoft.com/clr/ns...1.0.0.0, Culture=neutral, PublicKeyToken=null"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://schemas.microsoft.com/clr/ns...1.0.0.0, Culture=neutral, PublicKeyToken=null"
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/ns...1.0.0.0, Culture=neutral, PublicKeyToken=null"
xmlns:ns0="http://schemas.microsoft.com/clr/ns...1.0.0.0, Culture=neutral, PublicKeyToken=null"
xmlns:ns1="http://schemas.microsoft.com/clr/ns/System"
xmlns:ns3="http://schemas.microsoft.com/clr/ns...ture=neutral, PublicKeyToken=bbf6413da47c0685"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<schema
targetNamespace="http://schemas.microsoft.com/clr/ns...ture=neutral, PublicKeyToken=bbf6413da47c0685"
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">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<suds:class type="ns0:MyRemoteObject" rootType="MarshalByRefObject">
</suds:class>
<operation name="GetEmpInfo">
<soap:eek:peration
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>

<portType name="EmpDetailPortType">
</portType>

<binding name="EmpDetailBinding" type="tns:EmpDetailPortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<suds:class type="ns3:EmpDetail">
</suds:class>
</binding>

<service name="MyRemoteObjectService">
<port name="MyRemoteObjectPort" binding="tns:MyRemoteObjectBinding">
<soap:address location="http://localhost:8086/x.MyTest"/>
</port>
</service>
</definitions>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top