views:

62

answers:

1

Hi All, A client provided us with schemas and a wsdl for a service they would like developed. When I jumped on the project, there was already a service implementation in place. When I pull up the svc file in IE, it shows the normal svcutil command etc.. When I drill down and I look at the schemas being imported by the wsdl we're using, I notice that the MessageContracts are not showing up in the schema. What can I do to make the MessageContracts show up so the schemas will be idetentical?

For instance, the customer gave us this,

<xs:schema elementFormDefault="qualified" targetNamespace="http://ws.tcore.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.tcore.com"&gt;
<xs:import schemaLocation="ATISDataContracts.xsd" namespace="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 
<xs:import schemaLocation="Serialization.xsd" namespace="http://schemas.microsoft.com/2003/10/Serialization/" /> 
<xs:element name="ASICDetectorInventoryRequestMC">
 <xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="DetectorInventoryRequest" nillable="true" type="q1:DetectorInventoryRequestDC" xmlns:q1="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 
 </xs:sequence>
 </xs:complexType>
 </xs:element>
  <xs:element name="ConnectionRequest" nillable="true" type="q2:ConnectionRequestDC" xmlns:q2="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 

but when I drill down to the wsdl from my svc, and I copy/paste the schema import, I notice the message contract are missing, although the "q1:" etc.. are correct. My schema looks like this.

  <xs:schema elementFormDefault="qualified" targetNamespace="http://ws.tcore.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.tcore.com"&gt;
<xs:import schemaLocation="http://localhost:9305/mex?xsd=xsd1" namespace="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 
<xs:import schemaLocation="http://localhost:9305/mex?xsd=xsd0" namespace="http://schemas.microsoft.com/2003/10/Serialization/" /> 
<xs:element name="DetectorInventoryRequest" nillable="true" type="q1:DetectorInventoryRequestDC" xmlns:q1="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 
<xs:element name="ConnectionRequest" nillable="true" type="q2:ConnectionRequestDC" xmlns:q2="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 

For the most part it looks the same. How can I get my MessageContract elements to appear in the schema?

Here is a sample of a message contract c# code

namespace tcore.ATISDataContracts
{
  [MessageContract(IsWrapped = false)]
  public class ASICDetectorInventoryRequestMC
  {
      [MessageHeader]
      public ConnectionRequestDC ConnectionRequest;

      [MessageBodyMember]
      public DetectorInventoryRequestDC DetectorInventoryRequest;
  }
}

Their schema shows the complex type, but my derived schema only show the element and not the complex type. What am I doing wrong here? Any help or tips is appreciated.

Thanks for the help,
~ck in San Diego

+1  A: 

By default when your WSDL files are generated parts of the schema are split up into other import files, which will not likely correspond with imports that may have been used originally (in the client-provided WSDL file, for example). If you navigate to the imported XSD files (http://localhost:9305/mex?xsd=xsd1, for instance) you should find some of the elements you seem to be missing.

Brian Driscoll