I started work on a solution new to me this morning. The solution was currently in production and working fine. I had opened it up because enhancements were required to consume new web methods from a third party.
After getting the source files from the source control repository I had the usual problem of missing references to sort out. I then noticed that the solution contained a web service project with two set of web references; one pointing to the live url of the 3rd party and another pointing to a mock service on local host. My initial thought was that this was unnecessary and would confuse matters - why not just have one set of web references and set the runtime target URL in the SOAP adapter binding? I deleted one set of the web references in the proxy project, re-configured and kicked off the orchestration via a test trigger file. I received the following error in the event log:
The adapter failed to transmit message going to send port "SendGetVehicleStatusPort" with URL "http://localhost/MicroliseMockServices/Service.asmx". It will be retransmitted after the retry interval specified for this Send Port. Details:"Failed to load "class.here.localhost.Service, assembly.here.WebServiceProxy, Version=1.0.0.1, Culture=neutral, PublicKeyToken=61c3844cd3e47cf6" type.
Please verify the fully-qualified type name is valid.
Details: "System.TypeLoadException: Could not load type 'class.here.Microlise.WebServiceProxy.localhost.Service' from assembly 'assembly.here.WebServiceProxy, Version=1.0.0.1, Culture=neutral, PublicKeyToken=61c3844cd3e47cf6'.".
The type must derive from System.Web.Services.Protocols.SoapHttpClientProtocol.
The type must have the attribute System.Web.Services.WebServiceBindingAttribute. ".
To try and resolve the error I examined the SOAP adapter properties for the send port. It turns out that there's an option to specify a particular proxy assembly within the "Web Service" tab of the "SOAP Transport Properties" dialog box. The exception was being thrown because the SOAP adapter was looking for the web reference that I had deleted.
The default option for the SOAP port is to simply use the URL specified on the "General" tab of the "SOAP Transport Properties" dialog box, and this had always been the case in my experience. However, I've learned something today; the option to specify a separate proxy assembly\class\and method. However, I'm still not sure what advantage this gives you over the default behaviour, from which you can easily change the target of the web service (eg to move from test mock to live) via the bindings for "Web Service URL"?
www.biztalkers.co.uk