Moving Managed C/C++ project from 1.1 to 2.0 and beyond

by merickson 7/30/2008 8:49:24 AM

I had to move a managed C/C++ project from 1.1 to 2.0 (ok, 3.5) and found that as soon as I tried to build the project in Visual Studio 2008 it would no longer link properly.  There are also a few more language restrictions, so I had to change the code a bit to make it even compile.

I was getting linker errors like the following:

Error    5    error LNK2028: unresolved token (0A000009) "extern "C" void __clrcall ___CxxCallUnwindDtor(void (__clrcall*)(void *),void *)" (?___CxxCallUnwindDtor@@$$J0YMXP6MXPAX@Z0@Z) referenced in function "public: virtual __thiscall std::logic_error::~logic_error(void)" (??1logic_error@std@@$$FUAE@XZ)    TracingHelper.obj    AQLib

Error    19    error LNK2028: unresolved token (0A0002B9) "void __clrcall `eh vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void *))" (??_M@$$FYMXPAXIHP6MX0@Z@Z) referenced in function "public: virtual void * __thiscall std::logic_error::`vector deleting destructor'(unsigned int)" (??_Elogic_error@std@@$$FUAEPAXI@Z)    AQObjectDetail.obj    AQLib

Error    23    error LNK2001: unresolved external symbol "?.cctor@@$$FYMXXZ" (?.cctor@@$$FYMXXZ)    AQTools.obj    AQLib

After a TON of Google searches, I found a simple, very simple answer to my issue.  In the Configuration options for the C/C++ project, under C/C++-->Command Line, I found an option (/Zl (capital Z lower case L)) which removes the default-library name from the object file.  Click here to see the MSDN definition.

Anyway, remove this option and the project links fine!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

WCF Web Service as an Integration

by merickson 7/24/2008 3:27:14 PM

My current assignment has me creating a web service to accomplish an near-real-time integration between two systems, SalesForce.com and HP's Quality Center (used to be Mercury's Quality Center).  SalesForce.com is Software as a Service (SAAS) and is extremely easy to integrate with.  All of the integration points are WS-I 1.1 compliant web services and you can even create your own triggers and classes using their Java-like language called APEX.  Each of these custom triggers/classes are also exposed as web services.  The custom APEX trigger and APEX classes can also consume web services for outbound integrations.

On the other side of the wall is HP's Quality Center.  The integration points with this system are simply a set of COM based API's.  The API looks to be good for getting data into Quality Center, but not so good for detecting changes and getting the data out.  So instead it looks like I am going to utilize Advanced Queuing (AQ) in the Oracle database, let it notify a windows service there is a new message and then the windows service will process the message and then call the web service to finish the integration.

Some of the more interesting (at least to me) aspects of this project is that the integration will require guaranteed delivery of the integration data.  So I will be trying an asynchronous web service or possibly a simple queuing solution, not sure yet.

Look for updates as I will try to conquer processing an Oracle AQ from a C# windows service.  I will be putting together a POC sample so I will most likely post that when it's done.  I will also be trying my hand at writing APEX classes and triggers for SalesForce.com.

Let the fun begin!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

OneNote 2007

by merickson 7/24/2008 3:23:15 PM

Maybe it's because I'm new to it.  Maybe it's because I'm never really all that organized.  But, I've been using OneNote 2007 for my current assignment and I have to say it's pretty cool.  Being able to keep research, documents, links, screen shots, emails, links to documents, meeting notes, just about anything all in one place organized by project......well for right now it's pretty cool!

There is a cool feature for drawing.  Basically it allows you to draw out your ideas (not presentation quality mind you!) and you can keep those in your notebook.  You can do freehand (which kinda sucks when using a mouse) or you can draw shapes for quick flow diagrams etc... 

I'm trying to be diligent and keep everything together using OneNote 2007 and trying to use as many features as I can.  Right now it seems usable and has some value, but we'll see how it holds up as I go through this project.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Going Bald

by merickson 6/8/2008 9:21:22 AM

I want to try and keep this blog as technical as possible.  However, I had such an experience buying tires the other day, I just had to share.  There are advertisements ALL over the place for tire companies.  Nitrogen inflation, everything is included, free gas, immortality, you name it.  So I went to Big O tires, Got a price for 4 decent tires with alignment (have to ask for that)  $622.  A little out of the range I wanted to pay, so I asked for a card so I could write that down, then I got a "deal".  "$581 is you do it today"

Then I want to Tire Discounters, asked for the same tires.  "$622 installed with alignment, oh wait, there is $40 off (from the manufacturer) if you buy 4".   Interesting, Big O didn't mention that until I was walking out the door.  So when I told the guy at Tire Discounters about the same deal at Big O, he started to brag about all of the other little "services" that come free etc..., but they were the same as Big O, just packed differently.

Basically, unless you know someone who knows someone in the tire biz, it pretty much doesn't matter where you go.  Nothing is "FREE".

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

WCF Web Service Missing XML Declaration

by merickson 5/23/2008 10:41:39 AM

My current project has posed some very interesting challenges.  The first challenge was to write a web service using an existing WSDL.  A vendor has created a "standard" WSDL by which all other companies that wish to implement the service must adhere to.  What really made it a challenge was the choice we made to build this in WCF.  So how do you implement a WCF web service using an existing WSDL?  You could try to use the SVCUTIL.EXE tool to create the service, however I've found there are limitations with regards to the complexity of the existing WSDL or Schema.  If the schema(s) found in the WSDL are too complex the SVCUTIL.EXE will not work for you.  So my next option was to use WSDL.EXE from 2.0.  Using WSDL.EXE with the /serviceInterface option will create the interface class and the data classes.  The interface and data classes will be decorated using ASMX style attributes.  For the data classes, keep them that way.  For the interface class you will want to remove the ASMX style attributes and replace them with WCF style attributes as shown below.

Output from WSDL.EXE using the /serviceInterface parameter

using System.ServiceModel;
using System.ServiceModel.Activation;

namespace Marks.WebService
{
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")]
    [System.Web.Services.WebServiceBindingAttribute(Name = "VerifyServiceSoap",
        Namespace = "http://www.iicmva.com/CoverageVerification
    public interface IVerifyServiceSoap
    {
        /// <remarks/>
        [System.Web.Services.WebMethodAttribute()]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/VerifyInsurance",
            RequestElementName = "CoverageRequest",
            RequestNamespace = "http://www.iicmva.com/CoverageVerification/",
            ResponseElementName = "CoverageResponse",
            ResponseNamespace = "http://www.iicmva.com/CoverageVerification/",
            Use = System.Web.Services.Description.SoapBindingUse.Literal,
            ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("Detail")]
        CoverageResponseDetail[] VerifyInsurance(ref RequestorInformationModule RequestorInformation,
            CoverageRequestDetail Detail);
    }
}

 

For a WCF web service remove the attributes and replace them with ServiceContract and OperationContract attributes.  Note you can define the Action and ReplyAction in the operation contract.  Also note, if you use the data classes decorated with ASMX style attributes you will need to use the XmlSerializerFormat attribute on the interface.  This will correctly serialize the data classes.

 

using System.ServiceModel;
using System.ServiceModel.Activation;

namespace Marks.WebService
{
    /// <remarks/>
    [ServiceContract(Namespace = "http://www.iicmva.com/CoverageVerification/", Name = "VerifyServiceSoap")]
    [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)]
    public interface IVerifyServiceSoap
    {
        /// <remarks/>
        [OperationContract(Action = "http://tempuri.org/VerifyInsurance",
				   ReplyAction = "http://tempuri.org/VerifyInsurance")]
        CoverageResponseDetail[] VerifyInsurance(ref RequestorInformationModule RequestorInformation,
                                                    CoverageRequestDetail Detail);
    }
}

This is all good and fine, but there is one little gotcha if your clients are expecting the XML declaration <?xml version="1.0" encoding="utf-8" ?> at the beginning of the response.  The default text encoder has the smarts to detect if redundant information is being written to the response.  Because the XML declaration most likely contains default values, the encoder does not write the XML declaration out.  This is not something you can configure and from what I'm seeing in the blogs and a few emails back and forth to Microsoft, this continues to be a nuisance, they feel our pain and are trying to get this into a configurable option for the next release.

So, in the meantime, I will need to write a Custom Text Message Encoder which will write the XML Declaration out ALL of the time.  Once I complete that, I will update this post with the results.

 

Update:  Well, I downloaded the custom text message encoder example, made the modifications to the WriteMessage method as recommended and now I am faced with a content type issue (HTTP 415) when I try to post a message to the service.  I tried various settings for ContentType but to no avail.  So at this time, due to time constraints, I am forced to go back to a ASMX web service.

I was able to revert to the ASMX web service in about 10 minutes and the XML declaration was there, no problems.  I would think, something as simple as a XML declaration at the beginning of a response message should be something configurable within the WCF web service to allow for backwards compatibility/interoperability. 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

WCF | Web Services

Documenting Software - Sparx Enterprise Architect

by merickson 5/9/2008 10:08:16 PM

One of my colleagues introduced me to a piece of software that in my humble opinion makes documenting software projects quite a bit easier.  Sparx Enterprise Architect 7.1 (I'm using the Corporate edition) has been a breeze to use and creates project artifacts all in one easy to navigate product.  I'm using this on my current project so we'll see how the domain classes generate to code and the data model generates to script.  You can even link documents to UML objects or diagrams.  Again, this makes the documentation very easy to get to.  There is a ton more, but I'll say this, it's not bad for a little over $200

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Powered by BlogEngine.NET 1.3.1.0
Theme by Mads Kristensen

About the author

Name of author Mark Erickson
I am a software developer in the Dayton and Cincinnati Ohio area.
View Mark Erickson's profile on LinkedIn
E-mail me Send mail

Calendar

<<  August 2008  >>
MoTuWeThFrSaSu
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

View posts in large calendar

Pages

Recent posts

Recent comments

Authors

Tags

Don't show

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008

    Sign in