Now Available: Aaron’s new Service Factory article on MSDN


Steven just told me that Aaron Skonnard's latest Service Factory article about the December release was just published through his Service Station column in the MSDN Magazine. Talk about timing ... sweet. 


Even though it was written and finished before we locked down the code, it is still very accurate and comprehensive. I mean, it's Aaron ... what else would you expect?! There a few minor places where we changed the code out from under him so if you have a question about anything in it, feel free to leave a comment here and I'll field it.


Oh, and if you're building ASMX services, be sure to check out his first Service Factory article about the July (ASMX) release.


Great job Aaron!

Comments (8)
  1. Hameer Saleem says:

    I installed the Web Service Software Factory December 2006 version on my PC. I also installed the Guidance Entensions. I observed, for visual studio that Web Service Software Factory (Data Access) guidance package was not enabled by default. I tried to enable it but got the following error.

    Message: Cannot Load package Web Service Software Factory (Data Access)

    Details:

    System.TypeLoadException: Microsoft.Practices.RecipeFramework.Library.Actions.CreateUnboundReferenceAction, Microsoft.Practices.RecipeFramework.Library —> System.IO.FileNotFoundException: Couldn’t find assembly Microsoft.Practices.RecipeFramework.Library.

      at Microsoft.Practices.Common.Services.TypeResolutionService.GetAssembly(AssemblyName assemblyName, Boolean throwOnError)

      at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)

      — End of inner exception stack trace —

      at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)

      at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)

      at Microsoft.Practices.Common.Services.AliasResolutionService.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)

      at Microsoft.Practices.Common.Services.TypeResolutionService.GetType(String typeName, Boolean throwOnError)

      at Microsoft.Practices.RecipeFramework.Recipe.GetInstance[T](ITypeResolutionService resolution, String concreteType)

      at Microsoft.Practices.RecipeFramework.Recipe.LoadActionsFromConfiguration(ITypeResolutionService resolution)

      at Microsoft.Practices.RecipeFramework.Recipe.ExecuteActions(IDictionaryService readOnlyArguments, IDictionaryService arguments, ITypeResolutionService resolution)

      at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)

      at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)

      at Microsoft.Practices.RecipeFramework.RecipeManager.Add(IComponent component, String name)

      at System.ComponentModel.Container.Add(IComponent component)

      at Microsoft.Practices.RecipeFramework.RecipeManager.EnablePackage(XmlReader configuration)

      at Microsoft.Practices.RecipeFramework.RecipeManager.EnablePackage(String packageName)

      at Microsoft.Practices.RecipeFramework.PackageManagement.EnableDisablePackages.OnOkClick(Object sender, EventArgs e)

    Can you please tell me whats going wrong.

  2. Mark H says:

    HELP! When I have completed the service creation and attempt to view the service in IE I am getting the foillowing message:

    "This web service does not conform to WS-I Basic Profile v1.1"

    "R2105: All xsd:schema elements contained in a wsdl:types element of a DESCRIPTION MUST have a targetNamespace attribute with a valid and non-null value, UNLESS the xsd:schema element has xsd:import and/or xsd:annotation as its only child element(s).

    – schema from service description with targetNamespace=’http://BeaconWS.ServiceContracts/2007/03‘.

    "

  3. LockSmithDon says:

    Be sure you defined a namespace when you created the DataContracts. The targetNamespace you’ve listed is for the WSDL document. From that IE page, click on the "service description" link so you can see the actual WSDL document. Inside that doc, look for the element <wsdl:description><wsdl:types><xs:schema> and make sure it has a targetNamespace attribute that is something other than "". As the error states, your wsdl:types section might be using an xs:import that is causing it to break compliance. Hope this helps.

  4. Mark H says:

    I found it.  I figured out what you meant with the datatypes.  All of them had a NameSpace="".

    Thank you very much for your help.

  5. Mark H says:

    It worked once before so I’m going to the well once again 🙂

    I have a DataType (Trip) defined that has a DataType (Months) array as one of its properties.  An array of Trips is returned to the client, and each Trip should contain one or more Months.  When I debug the code, the Month array is getting populated and retains its elements up to and including the return statement that returns the Trips to the client.  Yet, in the client, although the Trip array is populated, its child Months array is not.  It contains no elements.

    I am wondering if I have the declaration wrong with regard to XML decoration/attributes.  The response definition appears below.

    HTTP/1.1 200 OK

    Content-Type: text/xml; charset=utf-8

    Content-Length: length

    <?xml version="1.0" encoding="utf-8"?>

    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;

     <soap:Body>

       <TripListByCompanyRS xmlns="http://Myco.MyApp.ServiceContracts/2007/03"&gt;

         <Status>string</Status>

         <Trips>

           <Trip>

             <tripID xmlns="">int</tripID>

             <tripName xmlns="">string</tripName>

             <tripCode xmlns="">string</tripCode>

             <tripTypeID xmlns="">int</tripTypeID>

             <tripDuration xmlns="">string</tripDuration>

             <tripNotes xmlns="">string</tripNotes>

             <tripFrequency xmlns="">string</tripFrequency>

             <tripDescription xmlns="">string</tripDescription>

             <tripNumDays xmlns="">short</tripNumDays>

             <tripURL xmlns="">string</tripURL>

             <tripPrice xmlns="">decimal</tripPrice>

             <tripPriceDescription xmlns="">string</tripPriceDescription>

             <companyID xmlns="">int</companyID>

             <Months xmlns="">

               <monthNumber>int</monthNumber>

               <monthName>string</monthName>

             </Months>

             <Months xmlns="">

               <monthNumber>int</monthNumber>

               <monthName>string</monthName>

             </Months>

             <Departures xmlns="">

               <tripDepartureID>int</tripDepartureID>

               <tripID>int</tripID>

               <tripDepartureStartDate>dateTime</tripDepartureStartDate>

               <tripDepartureMaxPassengers>short</tripDepartureMaxPassengers>

               <tripDepartureComments>string</tripDepartureComments>

               <tripDepartureEndDate>dateTime</tripDepartureEndDate>

               <tripDepartureLength>int</tripDepartureLength>

               <tripDepartureMinPassengers>short</tripDepartureMinPassengers>

               <tripDepartureCode>string</tripDepartureCode>

             </Departures>

             <Departures xmlns="">

               <tripDepartureID>int</tripDepartureID>

               <tripID>int</tripID>

               <tripDepartureStartDate>dateTime</tripDepartureStartDate>

               <tripDepartureMaxPassengers>short</tripDepartureMaxPassengers>

               <tripDepartureComments>string</tripDepartureComments>

               <tripDepartureEndDate>dateTime</tripDepartureEndDate>

               <tripDepartureLength>int</tripDepartureLength>

               <tripDepartureMinPassengers>short</tripDepartureMinPassengers>

               <tripDepartureCode>string</tripDepartureCode>

             </Departures>

           </Trip>

           <Trip>

             <tripID xmlns="">int</tripID>

             <tripName xmlns="">string</tripName>

             <tripCode xmlns="">string</tripCode>

             <tripTypeID xmlns="">int</tripTypeID>

             <tripDuration xmlns="">string</tripDuration>

             <tripNotes xmlns="">string</tripNotes>

             <tripFrequency xmlns="">string</tripFrequency>

             <tripDescription xmlns="">string</tripDescription>

             <tripNumDays xmlns="">short</tripNumDays>

             <tripURL xmlns="">string</tripURL>

             <tripPrice xmlns="">decimal</tripPrice>

             <tripPriceDescription xmlns="">string</tripPriceDescription>

             <companyID xmlns="">int</companyID>

             <Months xmlns="">

               <monthNumber>int</monthNumber>

               <monthName>string</monthName>

             </Months>

             <Months xmlns="">

               <monthNumber>int</monthNumber>

               <monthName>string</monthName>

             </Months>

             <Departures xmlns="">

               <tripDepartureID>int</tripDepartureID>

               <tripID>int</tripID>

               <tripDepartureStartDate>dateTime</tripDepartureStartDate>

               <tripDepartureMaxPassengers>short</tripDepartureMaxPassengers>

               <tripDepartureComments>string</tripDepartureComments>

               <tripDepartureEndDate>dateTime</tripDepartureEndDate>

               <tripDepartureLength>int</tripDepartureLength>

               <tripDepartureMinPassengers>short</tripDepartureMinPassengers>

               <tripDepartureCode>string</tripDepartureCode>

             </Departures>

             <Departures xmlns="">

               <tripDepartureID>int</tripDepartureID>

               <tripID>int</tripID>

               <tripDepartureStartDate>dateTime</tripDepartureStartDate>

               <tripDepartureMaxPassengers>short</tripDepartureMaxPassengers>

               <tripDepartureComments>string</tripDepartureComments>

               <tripDepartureEndDate>dateTime</tripDepartureEndDate>

               <tripDepartureLength>int</tripDepartureLength>

               <tripDepartureMinPassengers>short</tripDepartureMinPassengers>

               <tripDepartureCode>string</tripDepartureCode>

             </Departures>

           </Trip>

         </Trips>

       </TripListByCompanyRS>

     </soap:Body>

    </soap:Envelope>

  6. Mark H says:

    I have a little more info now.  I wrote a test stub to return only one trip object, instead of an array.  The months do appear in the response, but they are appearing incorrectly.  They should be <Months><month></month><month></month><Months>, but instead look like the following.

     <?xml version="1.0" encoding="utf-8" ?>

    – <TripByTripIDRS xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns="http://MyCo.MyService.ServiceContracts/2007/03"&gt;

     <Status>Status_Ok</Status>

    – <Trip>

     <tripName xmlns="">Super Trip</tripName>

     <tripCode xmlns="">ST12345</tripCode>

     <tripDuration xmlns="">365</tripDuration>

     <tripNotes xmlns="" />

     <tripFrequency xmlns="">Every Day</tripFrequency>

     <tripDescription xmlns="" />

     <tripURL xmlns="" />

     <tripPriceDescription xmlns="">Because</tripPriceDescription>

     <companyID xmlns="">0</companyID>

    – <Months xmlns="">

     <monthNumber>4</monthNumber>

     <monthName>April</monthName>

     </Months>

    – <Months xmlns="">

     <monthNumber>5</monthNumber>

     <monthName>May</monthName>

     </Months>

    – <Months xmlns="">

     <monthNumber>6</monthNumber>

     <monthName>June</monthName>

     </Months>

     </Trip>

     </TripByTripIDRS>

  7. Mark H says:

    Thanks for letting think this through on your blog.  I got it.  Unfortunately, I’m not really sure what combination of things did the trick.  I just changed [System.Xml.Serialization.XmlElementAttribute("Months", Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] to [System.Xml.Serialization.XmlArray()] on my Months array property declaration in my trip class and bingo.

Comments are closed.

Skip to main content