This project is read-only.

Trouble importing WSDL...

Topics: Technical Questions
Mar 3, 2009 at 10:34 PM
Edited Mar 3, 2009 at 10:37 PM
When I try to import a WSDL file (from local drive, not from the service, i.e. ?WSDL), I receive the following error:

Failed to import service due to Error [Exception Information Type[ArgumentNullException] Source[Microsoft.MSE.Tools.MetadataLoader.Module] Message[ServiceOperation collection is either null or empty

Parameter name: serviceOperations] StackTrace[ at Microsoft.MSE.Tools.MetadataLoader.Module.ServiceImporter.ImportService(List`1 serviceOperations, ImportLevelType levelType)]].

The problem seems to point to no operations being recognized in the WSDL file.  During the import process, on the "Select Service" step, the schema is displayed but no resources or operations are displayed.   The WSDL is a 156K WSDL so I won't post it all but I chopped up the WSDL to a single operation and still get the same behavior.  Can someone please shed some light as to what's wrong with the WSDL file?

Here's the shortened WSDL.  Sorry for the ugliness...

Thanks!!!

 

<definitions targetNamespace="http://exacttarget.com/wsdl/partnerAPI" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://exacttarget.com/wsdl/partnerAPI">

  <types>

    <schema elementFormDefault="qualified" targetNamespace="http://exacttarget.com/wsdl/partnerAPI" version="1.0" xmlns="http://www.w3.org/2001/XMLSchema">

        <simpleType name="SaveAction">

            <restriction base="xsd:string">

                <enumeration value="AddOnly" />

                <enumeration value="Default" />

                <enumeration value="Nothing" />

                <enumeration value="UpdateAdd" />

                <enumeration value="UpdateOnly" />

            </restriction>

        </simpleType>

        <complexType name="ClientID">

            <sequence>

                <element name="ClientID" type="xsd:int" minOccurs="0" maxOccurs="1">

                    <annotation>

                        <documentation>Deprecated.  Use ID.</documentation>

                    </annotation>

                </element>

                <element name="ID" type="xsd:int" minOccurs="0" maxOccurs="1" />

                <element name="PartnerClientKey" type="xsd:string" minOccurs="0" maxOccurs="1" />

                <element name="UserID" type="xsd:int" minOccurs="0" maxOccurs="1" />

                <element name="PartnerUserKey" type="xsd:string" minOccurs="0" maxOccurs="1" />

                <element name="CreatedBy" type="xsd:int" minOccurs="0" maxOccurs="1" />

                <element name="ModifiedBy" type="xsd:int" minOccurs="0" maxOccurs="1" />

            </sequence>

        </complexType>

        <simpleType name="RespondWhen">

            <restriction base="xsd:string">

                <enumeration value="Never" />

                <enumeration value="OnError" />

                <enumeration value="Always" />

                <enumeration value="OnConversationError" />

                <enumeration value="OnConversationComplete" />

                <enumeration value="OnCallComplete" />

            </restriction>

        </simpleType>

        <simpleType name="AsyncResponseType">

            <restriction base="xsd:string">

                <enumeration value="None" />

                <enumeration value="email" />

                <enumeration value="FTP" />

                <enumeration value="HTTPPost" />

            </restriction>

        </simpleType>

        <complexType name="AsyncResponse">

            <sequence>

                <element name="ResponseType" type="tns:AsyncResponseType" minOccurs="1" maxOccurs="1" />

                <element name="ResponseAddress" type="string" minOccurs="1" maxOccurs="1" />

                <element name="RespondWhen" type="tns:RespondWhen" minOccurs="0" />

                <element name="IncludeResults" type="boolean" minOccurs="0" />

                <element name="IncludeObjects" type="boolean" minOccurs="0" />

                <element name="OnlyIncludeBase" type="boolean" minOccurs="0" />

            </sequence>

        </complexType>

        <simpleType name="RequestType">

            <restriction base="xsd:string">

                <enumeration value="Synchronous" />

                <enumeration value="Asynchronous" />

            </restriction>

        </simpleType>

        <simpleType name="Priority">

            <restriction base="xsd:string">

                <enumeration value="Low" />

                <enumeration value="Medium" />

                <enumeration value="High" />

            </restriction>

        </simpleType>

        <complexType name="SaveOption">

            <sequence>

                <element name="PropertyName" type="xsd:string" minOccurs="1" maxOccurs="1" />

                <element name="SaveAction" type="tns:SaveAction" minOccurs="1" maxOccurs="1" />

            </sequence>

        </complexType>

        <complexType abstract="true" name="Options">

            <sequence>

                <element name="Client" type="tns:ClientID" minOccurs="0" maxOccurs="1" />

                <element name="SendResponseTo" type="tns:AsyncResponse" minOccurs="0" maxOccurs="unbounded" />

                <element name="SaveOptions" minOccurs="0" maxOccurs="1">

                    <complexType>

                        <sequence>

                            <element name="SaveOption" minOccurs="0" maxOccurs="unbounded" type="tns:SaveOption" />

                        </sequence>

                    </complexType>

                </element>

                <element name="Priority" minOccurs="0" type="xsd:byte" />

                <element name="ConversationID" minOccurs="0" type="xsd:string" />

                <element name="SequenceCode" minOccurs="0" type="xsd:int" />

                <element name="CallsInConversation" minOccurs="0" type="xsd:int" />

                <element name="ScheduledTime" minOccurs="0" type="xsd:dateTime" />

                <element name="RequestType" minOccurs="0" type="tns:RequestType" />

                <element name="QueuePriority" minOccurs="0" type="tns:Priority" />

            </sequence>

        </complexType>

        <complexType name="SystemStatusOptions">

            <complexContent>

                <extension base="tns:Options" />

            </complexContent>

        </complexType>

        <element name="SystemStatusRequestMsg">

            <complexType>

                <sequence>

                    <element name="Options" type="tns:SystemStatusOptions" minOccurs="0" maxOccurs="1" />

                </sequence>

            </complexType>

        </element>

    </schema>

  </types>

  <message name="systemStatusRequest">

    <part element="tns:SystemStatusRequestMsg" name="parameters" />

  </message>

  <message name="systemStatusResponse">

    <part element="tns:SystemStatusResponseMsg" name="parameters" />

  </message>

  <portType name="Soap">

    <operation name="GetSystemStatus">

      <documentation>Get Current System Status</documentation>

      <input message="tns:systemStatusRequest" />

      <output message="tns:systemStatusResponse" />

    </operation>

  </portType>

  <binding name="SoapBinding" type="tns:Soap">

    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />

    <operation name="GetSystemStatus">

      <soap:operation soapAction="GetSystemStatus" />

      <input>

        <soap:body parts="parameters" use="literal" />

      </input>

      <output>

        <soap:body use="literal" />

      </output>

    </operation>

  </binding>

  <service name="PartnerAPI">

    <documentation>ExactTarget Partner API</documentation>

    <port binding="tns:SoapBinding" name="Soap">

      <soap:address location="https://webservice.exacttarget.com/Service.asmx" />

    </port>

  </service>

</definitions>

<!--EndFragment-->

Mar 4, 2009 at 4:04 AM
Can I ask you how you generated this WSDL? It seems that .NET metadata loaders are uanble to detect any operations.
Mar 4, 2009 at 2:47 PM
Edited Mar 4, 2009 at 2:47 PM
This is a client of mine that created this setup.  They use a master WSDL file that they write by hand (which is very similar to the one I posted but a lot longer) and then transform it using an XSL to remove certain objects based on the end point they want to use it at.  The WSDL has only a fixed set of operations in it and they simply add more objects to it by hand.  I don't know how they created the master WSDL in the first place.  It's been in use for years.  I will e-mail you the full WSDL shortly.

Thanks,
T.
Mar 30, 2009 at 12:34 PM
Did you solve this issue? We're having similar problems where the importer cannot detect any operations, or schemas for that matter. We are able to find the operations when we add a service reference in visual studio 2008, so the wsdl should be correct. This is the automatically generated WSDL by WCF btw.

Thanks in advance,
Mats
Mar 30, 2009 at 1:32 PM
Hi Mats,
The issue with the last WSDL was that it has some invalid data. Did you see any errors/warnings in the EventLog?

Regards,
Naveed
Mar 30, 2009 at 1:45 PM
Thanks for the fast reply!

I found two warnings in the eventlog:

Zero EndPoints imported from this service metadata
and
There are zero operations found in the service metadata

But I cannot find any differences from that WSDL to another that is working, atleast not when I look at the operations section.

Works:

- <wsdl:service name="AuthenticationService">
- <wsdl:port name="WSHttpBinding_AuthenticationService" binding="tns:WSHttpBinding_AuthenticationService">
  <soap12:address location="snip" />
- <wsa10:EndpointReference>
  <wsa10:Address>snip</wsa10:Address>
- <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
  <Upn>snip</Upn>
  </Identity>
  </wsa10:EndpointReference>
  </wsdl:port>
  </wsdl:service>

Doesn't work:
- <wsdl:service name="GuardianService">
- <wsdl:port name="WSHttpBinding_GuardianService" binding="tns:WSHttpBinding_GuardianService">
  <soap12:address location="snip" />
- <wsa10:EndpointReference>
  <wsa10:Address>snip</wsa10:Address>
- <Identity xmlns="http://schemas.xmlsoap.org/ws/2006/02/addressingidentity">
  <Upn>snip</Upn>
  </Identity>
  </wsa10:EndpointReference>
  </wsdl:port>
  </wsdl:service>

Best regards,
Mats
Mar 30, 2009 at 2:01 PM
By the way, it worked when I saved the wsdl to disk and loaded it from there.
Strange since I have another web service on the same server that I can load directly from the URL.

/Mats
Mar 30, 2009 at 2:23 PM

I think the issue may have to do with the security. I see that the transprot that you are using for this service is https. We have an update in works to take care of that issue. In the meantime you can use a workaround which is:

  • Download and save all teh WSDL and Schema files to disk
  • Open each of those files and goto import nodes
  • Remove any schemalocation or location attributes
  • Now load those files using the MSE WSDL importer as files  

I hope that helps.

Mar 30, 2009 at 2:36 PM
I thought so at first too. But I can succesfully load another service from the same server, also using https. I was able to add the service by loading from files, I didn't remove any schemalocations, I just loaded the files and it seemed to work.

However I'm running into some authentication issues now, 
Error in Broker delegate: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate oYGDMIGAoAMKAQGieQR3YHUGCSqGSIb3EgECAgMAfmYwZKADAgEFoQMCAR6kERgPMjAwOTAzMzAxMzI1MDVapQUCAw1Tm6YDAgEpqQ4bDE1PU1MyMDA3LlVUVqopMCegAwIBA6EgMB4bBGhvc3QbFnNydjAxMjk3Zi5tb3NzMjAwNy51dHY='.

I think I need to add a upn to the call from MSE to the instance. I created a client that talked directly to my instance and it worked. I then removed the <identity>-tag from app.config and I got the error message above.

Is there a way to add this to the configuration?

/Mats
Mar 30, 2009 at 2:49 PM
Take a look at the Security Guide.  Under Common Issues read the section titled Service Identity. There is an example of how to add a DNS identity.  You can follow the same logic for a UPN as well.

Mar 30, 2009 at 3:07 PM
Ok, so I extend the ChannelModel class and add a property called UPN?
Is this possible to do with a Policy instead?

I feel that I don't quite grasp all of the parts of the system yet, I guess I'll have to read up some more.
/Mats
Mar 30, 2009 at 7:15 PM
I'm sorry if this is more a WCF question than a MSE one but I'm curious about the answer.
Is it possible to add a UPN (or any other endpoint modifiers) from a behavior?
I tried implementing a behavior and added code in ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime behavior) but the Address property
of the endpoint is null here, and I read somewhere that you shouldn't mess around with the endpoint you should only access the client runtime here.

Isn't it possible to do this via a behavior? I think it would be nice to be able to do it with a Policy, I really like the xaml syntax. And as far as I understand I will
have to update the moniker for each resource endpoint if I create a custom ChannelModel, is this correct? I would be nice to just apply the policy to each instance that requires it.

It's a really nice engine anyways, the WCF extensabilities are great.

Best regards,
Mats
Mar 31, 2009 at 6:20 PM

You are correct that WCF Behaviors get access to the ServiceEndpoint as a reference only and an attempt to make change to it results in undefined behavior.

One option may be to do something in the Resource Binding to implement a custom IdentityVerifier:
http://msdn.microsoft.com/en-us/library/ms734778.aspx

If this works you would only need to specify it once as part of the binding used by all the resources rather than in the moniker of each resources.