3

I'm trying to use WCF for the first time. Here's what I did:

  1. Created a console .NET 4 project in VS 2010
  2. Added a WSDL file as a service reference.

However, I can't seem to be able to use the service, because no classes were created. The service reference is just an empty namespace.

What am I missing?

Here is the WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by Christophe Duquesne (DRYADE SA) -->
<!-- edited with XMLSpy v2007 rel. 3 U (http://www.altova.com) by Nick js Knowles (Kizoom) -->
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:siriWS="http://new.webservice.namespace" xmlns:siri="http://www.siri.org.uk/siri" xmlns:ns="http://datex2.eu/schema/1_0/1_0" xmlns:ns1="http://www.ifopt.org.uk/acsb" xmlns:ns2="http://www.ifopt.org.uk/ifopt" targetNamespace="http://new.webservice.namespace">
  <types>
        <xsd:schema targetNamespace="http://new.webservice.namespace">
            <xsd:import schemaLocation="siri.xsd" namespace="http://www.siri.org.uk/siri"/>
        </xsd:schema>
    </types>
    <message name="StopMonitoringServiceRequest">
        <part name="Request" type="siri:ServiceRequestStructure"/>
    </message>
    <message name="StopMonitoringServiceDelivery">
        <part name="Answer" type="siri:ServiceDeliveryStructure"/>
    </message>
    <portType name="SOAP-Port">
        <operation name="GetStopMonitoringService">
            <input message="siriWS:StopMonitoringServiceRequest"/>
            <output message="siriWS:StopMonitoringServiceDelivery"/>
        </operation>
    </portType>
    <binding name="SiriSOAPBinding" type="siriWS:SOAP-Port">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <!-- ====general  services ===== -->
        <!-- ====SIRI services ===== -->
        <operation name="GetStopMonitoringService">
            <soap:operation soapAction="GetStopMonitoringService"/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="SiriServices">
        <port name="SiriWSPort" binding="siriWS:SiriSOAPBinding">
            <soap:address location="http://www.siri-service-location.com"/>
        </port>
    </service>
    <!--General messages-->
    <!--SIRI Functional services-->
    <!--Capabilities-->
    <xsd:annotation>
        <xsd:appinfo xmlns:gms="http://www.govtalk.gov.uk/CM/gms">
            <Metadata xmlns="http://www.govtalk.gov.uk/CM/gms-xs">
                <Aggregation>main schema</Aggregation>
                <Audience>e-service developers</Audience>
                <Contributor>Nicholas Knowles, KIZOOM LTD., London EC4A 1LT</Contributor>
                <Coverage>Europe</Coverage>
                <Creator>>Drafted for version 1.0, by  Cen TC278 WG3 SG7 Christophe Duquesne DRYADE SA mailto:[email protected]</Creator>
                <Date>
                    <Created>2005-03-01</Created>
                </Date>
                <Date>
                    <Modified>2005-05-11</Modified>
                </Date>
                <Date>
                    <Modified>2007-01-30</Modified>
                </Date>
                <Date>
                    <Modified>2007-04-17</Modified>
                    <!-- Name Space changes -->
                </Date>
                <Date>
                    <Modified>2008-02-12</Modified>
                    <!-- Situation  Exchnages -->
                </Date>
                <Date>
                    <Modified>2007-04-17</Modified>
                    <!-- Name Space correction  -->
                    <!-- Add  StopMonitoringMultipleRequest  -->
                </Date>
                <Description>
                    <p>SIRI is a European CEN standard for the exchange of real time information. This describes WSDL Server binding</p>
                </Description>
                <Format>
                    <MediaType>text/xml</MediaType>
                    <Syntax>http://www.w3.org/2001/XMLSchema</Syntax>
                    <Description>XML schema, W3C Recommendation 2001</Description>
                </Format>
                <Identifier>{http://www.siri.org.uk/schemas/1.3/siri}siri_wsProducer.wsdl</Identifier>
                <Language>[ISO 639-2/B] ENG</Language>
                <Publisher>Kizoom, 109-123 Clifton Street, London EC4A 4LD </Publisher>
                <Rights>Unclassified
                             <Copyright>CEN, VDV, RTIG 2005-2008</Copyright>
                </Rights>
                <Source>
                    <ul>
                        <li>SIRI is derived from the VDV, RTIGXML and Trident standards.</li>
                    </ul>
                </Source>
                <Status>Version 1.0 Draft for approval</Status>
                <Subject>
                    <Category>Arts, recreation and travel, Tourism, Travel (tourism), Transport,
 Air transport, Airports,
 Ports and maritime transport, Ferries (marine),
 Public transport, Bus services, Coach services, Bus stops and stations,
 Rail transport, Railway stations and track, Train services, Underground trains,
 Business and industry, Transport, Air transport , Ports and maritime transport, Public transport,
 Rail transport, Roads and road transport
 </Category>
                    <Project>Cen TC278 WG3 SG7</Project>
                </Subject>
                <Title>SIRI XML schema. WSDL Server binding. </Title>
                <Type>Standard</Type>
            </Metadata>
        </xsd:appinfo>
    </xsd:annotation>
    <!-- ======== All the structures are comming from siri.xsd ========= -->
    <!-- ======== Descritions of request parameters (requests and answers) ========= -->
    <!-- ========Service Requests ========= -->
    <!-- ====StopMonitoring== -->
    <!-- ====PORTS ================ -->
    <!-- ====BINDINGS  ================ -->
</definitions>
2
  • what kind of function did you use to import your wsdl. Did you use 'Add service Reference' on your project? Commented Nov 5, 2012 at 10:18
  • Exactly, "Add Service Reference". Commented Nov 5, 2012 at 10:20

2 Answers 2

2

Apparently there were errors importing the schemas, I should have looked in the Error List window.

Sign up to request clarification or add additional context in comments.

1 Comment

Hey Ilya! You've found out where the error is with importing the WSDL, but did you manage to fix it? If so, can you please answer my question here: stackoverflow.com/questions/32510797/…
1

Try run the command tool wsdl.exe instead. I tried it with your wsdl and there were some errors. Save the wsdl to a file(here service.wsdl) and try to run:

wsdl service.wsdl /language:CS

A file called something like Service.cs should be created that you can include in your project.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.