ClientBase classes are not available in Reference.cs file - c#

I added a service reference in Visual Studio 2010 using following wsdl. It is added successfully. This is a wsdl generated from schema xsd files; not from actual service code. Any idea why this is not generating the required class and methods in Reference.cs file?
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:import0="urn:thinktecture-com:demos:restaurantservice:messages:v1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:import1="urn:thinktecture-com:demos:restaurantservice:data:v1" xmlns:tns="urn:lijo:demos:multiplyservice:calculation:v1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="CalculationService" targetNamespace="urn:lijo:demos:multiplyservice:calculation:v1" xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
<types>
<xsd:schema>
<xsd:import schemaLocation="C:\toolbox\LijosServiceApp\NewService\RestaurantMessages.xsd" namespace="urn:thinktecture-com:demos:restaurantservice:messages:v1" />
<xsd:import schemaLocation="C:\toolbox\LijosServiceApp\NewService\RestaurantData.xsd" namespace="urn:thinktecture-com:demos:restaurantservice:data:v1" />
</xsd:schema>
</types>
<message name="getMultipliedIn">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
<part name="parameters" element="import0:getMultiplied" />
</message>
<message name="getMultipliedOut">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
<part name="parameters" element="import0:getMultipliedResponse" />
</message>
<portType name="CalculationServiceInterface">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
<operation name="getMultiplied">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
<input message="tns:getMultipliedIn" />
<output message="tns:getMultipliedOut" />
</operation>
</portType>
<binding name="BasicHttpBinding_CalculationServiceInterface" type="tns:CalculationServiceInterface">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="getMultiplied">
<soap:operation soapAction="urn:lijo:demos:multiplyservice:calculation:v1:getMultipliedIn" style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="CalculationServicePort">
<port name="CalculationServicePort" binding="tns:BasicHttpBinding_CalculationServiceInterface">
<soap:address location="http://localhost/CalculationService" />
</port>
</service>
</definitions>

The issue was with incorrect xml namespace used by the tool. Please see the corrected wsdl in 400 Bad Request Exception: Simple SOAP WCF service with small data

Related

wsdl.exe - The element attribute is required for headers when Use=Literal

I'm using MS wsdl.exe to generate C# file from a WSDL file, but get a error describes that "the element attribute is required for headers when Use=Literal"
How can I get rid of this? Is there any other tools to generate C# from wsdl?
<message name="SomeHeader">
<part name="Version" type="xsd:string"/>
</message>
....
<operation name="xxxxx">
<soap:operation soapAction="xxxx"/>
<input>
<soap:header use="literal" message="SomeHeader" part="Version" />
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
I finally resolved this issue by replace "type" with "element".
Modified above wsdl to
<wsdl:types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://tempuri.org/"
elementFormDefault="qualified">
<xsd:element name="Version" type="xsd:string"/>
....
....
</xsd:schema>
</wsdl:types>
<message name="SomeHeader">
<part name="Version" element="tns:Version"/>
</message>

Error generating Proxy Class from WSDL document

Following is the WSDL file and I am unable to generate the Proxy class for this WSDL file.
<?xml version ='1.0' encoding ='ISO-8859-1' ?>
<definitions name='SunesisService' targetNamespace='https://exg.sunesis.uk.net/' xmlns:tns='https://exg.sunesis.uk.net/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<wsdl:types>
<xsd:schema targetNamespace="https://exg.sunesis.uk.net/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="destinyXML">
<xsd:complexType name="mimeXmlType" use="required">
<xsd:sequence>
<xsd:any/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<message name='receiveILRRequest'>
<part name='receiveILRRequest_username' type='xsd:string' />
<part name='receiveILRRequest_password' type='xsd:string' />
<part name='receiveILRRequest_destinyXMLFileName' type='xsd:string' />
<part name='receiveILRRequest_destinyXML' type='mimeXmlType' />
</message>
<message name='receiveILRResponse'>
<part name='receiveILRResponse_Result' type='xsd:string' />
</message>
<portType name='DestinyReceipt'>
<operation name='acceptEXG'>
<input message='tns:receiveILRRequest'/>
<output message='tns:receiveILRResponse'/>
</operation>
</portType>
<binding name='SunesisBinding' type='tns:DestinyReceipt'>
<soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http' />
<operation name='acceptEXG'>
<soap:operation soapAction='urn:localhost-catalog#acceptILR'/>
<input>
<soap:body use='encoded' namespace='urn:localhost-catalog' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' />
</input>
<output>
<soap:body use='encoded' namespace='urn:localhost-catalog' encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' />
</output>
</operation>
</binding>
<service name='SunesisService'>
<port name='SunesisPort' binding='SunesisBinding'>
<soap:address location='https://exg.sunesis.uk.net/module_soap/sunesis.php' />
</port>
</service>
You must close your definitions node in the end of your document
try with this format
<definitions name='SunesisService' targetNamespace='https://exg.sunesis.uk.net/' xmlns:tns='https://exg.sunesis.uk.net/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
..........
<service name='SunesisService'>
<port name='SunesisPort' binding='SunesisBinding'>
<soap:address location='https://exg.sunesis.uk.net/module_soap/sunesis.php' />
</port>
</service>
</definitions>

Cannot import WSDL service "targetNamespace 'urn:webservice' not found'

The last couple of hours I've been struggling with importing a WSDL webservice into Visual Studio 2010. Slowly I've been struggling through my WSDL, solving other problems untill I encountered this one:
Warning 1 Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension:
System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: Schema with target namespace 'urn:WebService' could not be found.
XPath to Error Source:
//wsdl:definitions[#targetNamespace='urn:WebService']/wsdl:portType[#name='DataPort']
C:\* blablabla *\WeGotchaService\Reference.svcmap 1 1 Gotcha!
I've tried every tiny little thing Google could provide me with including:
Disable 'Reuse types in referenced assemblies'
Set Collection type to system.collections.generic.list
Changing a large part of the attributes back and forth.
Copying a WSDL file from someone else, just to see if it would work (it didn't)
Here is my .wsdl file:
<?xml version="1.0"?>
<definitions
name="WebService"
targetNamespace="urn:WebService"
xmlns:tns="urn:WebService"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="GetData">
<xsd:element name="getCustomerID" type="xsd:int" />
<xsd:element name="DataResponse" type="xsd:string" />
</xsd:schema>
</types>
<message name="doGetCustomerID">
<part name="ID" type="tns:getCustomerID" />
</message>
<message name="doDataResponse">
<part name="return" type="tns:DataResponse" />
</message>
<portType name="DataPort">
<operation name="getData">
<input message="tns:doGetCustomerID" />
<output message="tns:doDataResponse" />
</operation>
</portType>
<binding name="DataBinding" type="tns:DataPort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="getData">
<soap:operation soapAction="urn:getDataAction" />
<input>
<soap:body use="encoded" namespace="urn:GetData" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input>
<output>
<soap:body use="encoded" namespace="urn:GetData" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output>
</operation>
</binding>
<service name="WeGotchaService">
<port name="DataPort" binding="tns:DataBinding">
<soap:address location="http://localhost/weGotcha/servicehandler.php" />
</port>
</service>
</definitions>
Servicehandler.php
<?php
if(!extension_loaded("soap"))
{
dl("php_soap.dll");
}
ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("getPersonen.wsdl");
function getData($persoon_id)
{
mysql_connect("localhost", "root", "");
mysql_select_db('gotcha_dbtemplate');
$sql = "SELECT * FROM lessen";
$sql = mysql_query($sql);
while($row = mysql_fetch_array($sql))
{
$result[] = $row;
}
mysql_close();
return $result;
}
$server->addFunction("getData");
$server->handle();
?>
I don't know how to fix this. There are some other errors but these are due to the fact that it has trouble importing the portType (binding import error because portType is not okay, port error because dependant on binding)
I hope someone knows what the problem is, I don't :(
Thanks.
Update: my test.php does work okay and it does output the results from the getData method.
I've changed so much I can't exactly remember, now it works:
<?xml version="1.0"?>
<definitions xmlns:tns="http://localhost/weGotcha/servicehandler/wsdl_service.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" name="WebService" targetNamespace="http://localhost/weGotcha/servicehandler/wsdl_service.wsdl">
<types>
<xs:schema elementFormDefault="qualified" targetNamespace="http://localhost/weGotcha/servicehandler/wsdl_service.wsdl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://localhost/weGotcha/servicehandler/wsdl_service.wsdl">
<xsd:element name="getCustomerID" type="xsd:int"/>
<xs:complexType name="Persoon">
<xs:sequence>
<xs:element name="ID" type="xsd:int"/>
<xs:element name="Voornaam" type="xsd:string"/>
<xs:element name="Achternaam" type="xsd:string"/>
<xs:element name="Adres" type="xsd:string"/>
<xs:element name="Postcode" type="xsd:string"/>
<xs:element name="Woonplaats" type="xsd:string"/>
<xs:element name="Email_adres" type="xsd:string"/>
<xs:element name="Telefoonnummer" type="xsd:string"/>
<xs:element name="CBR_Kandidaatnummer" type="xsd:string"/>
<xs:element name="Rijbewijs" type="xsd:int"/>
<xs:element name="Laatste_keer_bewerkt" type="xsd:dateTime"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PersoonList">
<xs:complexContent>
<xs:restriction base="soapenc:Array">
<xs:sequence>
<xs:element name="Persoon" type="tns:Persoon" maxOccurs="unbounded"/>
</xs:sequence>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:schema>
</types>
<message name="doGetCustomerID">
<part name="CustomerID" type="xsd:int"/>
</message>
<message name="doGetPersoonDataResponse">
<part name="return" type="tns:PersoonList"/>
</message>
<portType name="DataPort">
<operation name="getPersoonData">
<input message="tns:doGetCustomerID"/>
<output message="tns:doGetPersoonDataResponse"/>
</operation>
</portType>
<binding name="DataBinding" type="tns:DataPort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getPersoonData">
<soap:operation soapAction="urn:getDataAction"/>
<input>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:GetData"/>
</input>
<output>
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:GetData"/>
</output>
</operation>
</binding>
<service name="WeGotchaService">
<port name="DataPort" binding="tns:DataBinding">
<soap:address location="http://localhost/weGotcha/servicehandler/servicehandler.php"/>
</port>
</service>

SoapSender & SoapEnvelope

enter code here I am trying to call a web service from a c# client. I found out that we can use SoapSender and SoapReceiver classes. please refer below for web service's WSDL
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://test/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WelcomeService" targetNamespace="http://test/">
<types>
<xs:schema xmlns:tns="http://test/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://test/" version="1.0">
<xs:element name="WelcomeMessage" type="tns:WelcomeMessage"/>
<xs:element name="WelcomeMessageResponse" type="tns:WelcomeMessageResponse"/>
<xs:complexType name="WelcomeMessage">
<xs:sequence>
<xs:element minOccurs="0" name="message" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="WelcomeMessageResponse">
<xs:sequence/>
</xs:complexType>
</xs:schema>
</types>
<message name="Welcome_WelcomeMessageResponse">
<part element="tns:WelcomeMessageResponse" name="WelcomeMessageResponse"/>
</message>
<message name="Welcome_WelcomeMessage">
<part element="tns:WelcomeMessage" name="WelcomeMessage"/>
</message>
<portType name="Welcome">
<operation name="WelcomeMessage" parameterOrder="WelcomeMessage">
<input message="tns:Welcome_WelcomeMessage"/>
<output message="tns:Welcome_WelcomeMessageResponse"/>
</operation>
</portType>
<binding name="WelcomeBinding" type="tns:Welcome">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="WelcomeMessage">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="WelcomeService">
<port binding="tns:WelcomeBinding" name="WelcomePort">
<soap:address location="http://127.0.0.1:8080/SoapSeam/Welcome"/>
</port>
</service>
</definitions>
I am having hard time to figure out how to populate Soap envelope object.
You must have found old or bad information on the web. See How to Consume a Web Service for current information.
Also, see wcf. WCF is the technology you should use to work with SOAP web services.

Warning: The optional WSDL extension element 'body' from namespace 'http://schemas.xmlsoap.org/wsdl/soap/' was not handled

I'm using Visual Studio 2010, .Net4, Silverlight(4.0.50826.0).
I created a WCF service and I`m trying to create a proxy with SlSvcUtil like:
SlSvcUtil.exe /serializer:DataContractSerializer http://192.128.09.26:8080/Server?wsdl /out:C:\Projets\Client\dService.cs /config:C:\Projets\Client\ServiceReferences.ClientConfig
When I add some methods with customer type and also they have some attributes I got this msg:
Warning: The optional WSDL extension element 'body' from namespace
'http://schemas.xmlsoap.org/wsdl/soap/' was not handled.
XPath:
//wsdl:definitions[#targetNamespace='http://tempuri.org/']/wsdl:binding[#
name='BasicHttpBinding_IService']/wsdl:operation[#name='GetDefinitionsHavingFre']/wsdl:output
If I ignore the warning and I try to use the class I get a NullException error when I call any method.
If I change the option /Serializer:XmlSerializer or any other option Its possible create the proxy correctly but I get a lot of null references in the visual studio, so Its necessary to add the correct .dll.
If I add: System.ServiceModel from Silverlight -the xmlserializerformatattribute doesn't exist System.ServiceModel from .NET -the ChannelBase doesn't exist
If I didn't use the customer method my service works fine, so my question is has silverlight some limit when use customer types or methods with attributes ?
Someone has some clue what could be done to solve this ?
Thanks,
WSDL:
<?xml version="1.0" encoding="utf-8" ?>
- <wsdl:definitions name="TestService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
- <wsdl:types>
- <xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd0" namespace="http://tempuri.org/" />
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd10" namespace="http://schemas.datacontract.org/2004/07/DataCompany.Data.Faults" />
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/DataCompany.Data.PortalModel" />
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd3" namespace="http://schemas.datacontract.org/2004/07/System.Data.Objects.DataClasses" />
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd4" namespace="http://schemas.datacontract.org/2004/07/System.Data" />
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd5" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" />
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd6" namespace="http://schemas.datacontract.org/2004/07/DataCompany.Data.Components" />
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd7" namespace="http://schemas.datacontract.org/2004/07/System" />
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd8" namespace="http://schemas.datacontract.org/2004/07/DataCompany.Data" />
<xsd:import schemaLocation="http://192.128.09.26:8080/Server?xsd=xsd9" namespace="http://schemas.datacontract.org/2004/07/DataCompany.Data.LocalizationManagement" />
</xsd:schema>
</wsdl:types>
- <wsdl:message name="ITestService_StatusService_InputMessage">
<wsdl:part name="parameters" element="tns:StatusService" />
</wsdl:message>
- <wsdl:message name="ITestService_StatusService_OutputMessage">
<wsdl:part name="parameters" element="tns:StatusServiceResponse" />
</wsdl:message>
- <wsdl:message name="ITestService_getData_InputMessage">
<wsdl:part name="parameters" element="tns:getData" />
</wsdl:message>
- <wsdl:message name="ITestService_getData_OutputMessage">
<wsdl:part name="parameters" element="tns:getDataResponse" />
</wsdl:message>
- <wsdl:message name="ITestService_getTime_InputMessage">
<wsdl:part name="parameters" element="tns:getTime" />
</wsdl:message>
- <wsdl:message name="ITestService_getTime_OutputMessage">
<wsdl:part name="parameters" element="tns:getTimeResponse" />
</wsdl:message>
- <wsdl:message name="ITestService_getText_InputMessage">
<wsdl:part name="parameters" element="tns:getText" />
</wsdl:message>
- <wsdl:message name="ITestService_getText_OutputMessage">
<wsdl:part name="parameters" element="tns:getTextResponse" />
</wsdl:message>
- <wsdl:message name="ITestService_SaveEntity_InputMessage">
<wsdl:part name="parameters" element="tns:SaveEntity" />
</wsdl:message>
- <wsdl:message name="ITestService_SaveEntity_OutputMessage">
<wsdl:part name="parameters" element="tns:SaveEntityResponse" />
</wsdl:message>
- <wsdl:message name="ITestService_SaveEntity_DatabaseFaultFault_FaultMessage">
<wsdl:part name="detail" element="q1:DatabaseFault" xmlns:q1="http://schemas.datacontract.org/2004/07/DataCompany.Data.Faults" />
</wsdl:message>
- <wsdl:portType name="ITestService">
- <wsdl:operation name="StatusService">
<wsdl:input wsaw:Action="http://tempuri.org/ITestService/StatusService" message="tns:ITestService_StatusService_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/ITestService/StatusServiceResponse" message="tns:ITestService_StatusService_OutputMessage" />
</wsdl:operation>
- <wsdl:operation name="getData">
<wsdl:input wsaw:Action="http://tempuri.org/ITestService/getData" message="tns:ITestService_getData_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/ITestService/getDataResponse" message="tns:ITestService_getData_OutputMessage" />
</wsdl:operation>
- <wsdl:operation name="getTime">
<wsdl:input wsaw:Action="http://tempuri.org/ITestService/getTime" message="tns:ITestService_getTime_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/ITestService/getTimeResponse" message="tns:ITestService_getTime_OutputMessage" />
</wsdl:operation>
- <wsdl:operation name="getText">
<wsdl:input wsaw:Action="http://tempuri.org/ITestService/getText" message="tns:ITestService_getText_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/ITestService/getTextResponse" message="tns:ITestService_getText_OutputMessage" />
</wsdl:operation>
- <wsdl:operation name="SaveEntity">
<wsdl:input wsaw:Action="http://tempuri.org/ITestService/SaveEntity" message="tns:ITestService_SaveEntity_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/ITestService/SaveEntityResponse" message="tns:ITestService_SaveEntity_OutputMessage" />
<wsdl:fault wsaw:Action="http://tempuri.org/ITestService/SaveEntityDatabaseFaultFault" name="DatabaseFaultFault" message="tns:ITestService_SaveEntity_DatabaseFaultFault_FaultMessage" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="BasicHttpBinding_ITestService" type="tns:ITestService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="StatusService">
<soap:operation soapAction="http://tempuri.org/ITestService/StatusService" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getData">
<soap:operation soapAction="http://tempuri.org/ITestService/getData" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getTime">
<soap:operation soapAction="http://tempuri.org/ITestService/getTime" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="getText">
<soap:operation soapAction="http://tempuri.org/ITestService/getText" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
- <wsdl:operation name="SaveEntity">
<soap:operation soapAction="http://tempuri.org/ITestService/SaveEntity" style="document" />
- <wsdl:input>
<soap:body use="literal" />
</wsdl:input>
- <wsdl:output>
<soap:body use="literal" />
</wsdl:output>
- <wsdl:fault name="DatabaseFaultFault">
<soap:fault name="DatabaseFaultFault" use="literal" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="TestService">
- <wsdl:port name="BasicHttpBinding_ITestService" binding="tns:BasicHttpBinding_ITestService">
<soap:address location="http://192.128.09.26:8080/Server" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I Found the problem.
After creating the proxy with SlSvcUtil and adding the .cs in my project in Visual Studio I got this error:
The type or namespace name 'XmlSerializerFormatAttributeAttribute' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?)
First of all I tried change the System.Service.Model from the Silverlight version to the .Net version, but I got other errors.
So I found somewhere that was necessary, use /serializer:DataContractSerializer in the SlSvcUtil; after that this error was solved. However I got a WSDL warning when the proxy is generated.
SOLUTION
I created the proxy using the following command:
SlSvcUtil.exe http://192.128.09.26:8080/Server /out:C:\Projets\Client\dService.cs /config:C:\Projets\Client\ServiceReferences.ClientConfig
Then the I got this error in Visual Studio:
The type or namespace name 'XmlSerializerFormatAttributeAttribute' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?)
I added the following dll:
System.Xml.Serialization.dll - (Runtime Version v2.0.50727)
Conclusion
Visual Studio wasn't able to find the reference inside the ServiceModel.dll and the ServiceModel was there so I never thought to add another .dll because the correct dll was already added.
Just yesterday I tried add the System.Xml.Serialization.dll and now everthing works fine.

Categories

Resources