Dynamic SOAP Ports

Home Page Forums BizTalk 2004 – BizTalk 2010 Dynamic SOAP Ports

Viewing 1 reply thread
  • Author
    Posts
    • #12306

      Since BizTalk creates the web ports for you with schemas I would think it would be difficult to call web services dynamically inside an Orchestration.

      Doing this, do you still need to have a web reference to the web service?

      I’m curious how this ends up working for you.

      • #12307

        A lot of this is a repeat of something I posted on Microsoft Community Forum.

        I’m basically trying to call a web service dynamically, i.e. I want to specify the method name in the orchestration. I made a web reference to the web service to get the web messages. I created a generic port (i.e. I did not use an existing web port type).

        We have for example a dozen methods. They all receive a refid and they all return a status code, so what I’m saying is that I should be able to use the same WSReq and WSResp message for calling any of the methods. Even the namespaces going in and out are the same.

        Jon Flanders got me on the right track with the how to specify the SOAP:// protocol (see sample code below), but now I’m getting errors regarding the AssemblyName.

        Biztalk seems to want an AssemblyName, so I thought I would give it one and make it happy. The question is what assembly does it want? And what is the form of the assembly name?

        The beautiful documentation on this page:
        http://msdn.microsoft.com/library/default.asp?url=/library/en-us/operations/htm/ebiz_ops_adapt_file_pnvv.asp

        says, and I quote:
        Soap.Assembly – Identifies the .NET type and assembly to be loaded and
        executed.

        So does it want a type name, an assembly name, or both, and in what format.

        Furthermore, what assembly is it talking about. Surely it is not the name
        of my orchestration. It is the name of some SOAP program that I’m supposed
        to know?

        Just for the fun of it, I tried my assembly name, once with the short name,
        and once with the fully qualified name, and these are the errors.

        Here’s what I have in my construct:

        mWebSvcReq.RefID =
        mOAStatus(BTS_OpenAccess_spBtsPollsOAStatus.PropertySchema.RefID);
        vMethodName = \”PrintPDF\”;
        mWebSvcReq(SOAP.MethodName) = vMethodName;
        mWebSvcReq(BTS.OutboundTransportType) = \”SOAP\”;
        mWebSvcReq(SOAP.AssemblyName) = \”BTS_Orch_Loop\”;

        Event Type: Error
        Event Source: BizTalk Server 2004
        Event Category: BizTalk Server 2004
        Event ID: 5754
        Date: 11/15/2005
        Time: 1:19:26 AM
        Description:
        The \”SOAP\” adapter is suspending an outbound message going to destination
        URL:\”SOAP://weaponws/POWebService/SubmitPOService.asmx\”. Details:\”Unable to
        load type BTS_Orch_Loop; Could not load type BTS_Orch_Loop from assembly
        Microsoft.BizTalk.SoapTransport, Version=3.0.1.0, Culture=neutral,
        PublicKeyToken=31bf3856ad364e35.\”.

        Now, if I’m reading this correctly, it is looking for a DotNet Type called
        BTS_Orch_Loop in the SoapTransport DLL. Should I open that program with
        ILDASM and try to guess what assembly name should be????

        Here’s the fully qualified assembly name I tried:
        //mWebSvcReq(SOAP.AssemblyName) = \”BTS_Orch_Loop, Version=1.0.0.0,
        Culture=neutral, PublicKeyToken=0489e02e6191cecf\”;

        [by the way my assembly type name is orBTS_Orch_Loop]

        and the corresponding error:

        Event Type: Error
        Event Source: BizTalk Server 2004
        Event Category: BizTalk Server 2004
        Event ID: 5754
        Date: 11/15/2005
        Time: 1:11:00 AM

        Description:
        The \”SOAP\” adapter is suspending an outbound message going to destination
        URL:\”SOAP://weaponws/POWebService/SubmitPOService.asmx\”. Details:\”Unable to
        load type BTS_Orch_Loop, Version=1.0.0.0, Culture=neutral,
        PublicKeyToken=0489e02e6191cecf; Assembly Version=1.0.0.0 not found.\”.

        Thanks again, I’m really flustered by this.

        Neal Walters
        htttp://Biztalk-Training.com

        • #17420

          Neal, did you get to the bottom of this, I am trying to do exactly the same thing and um unsure of the format for specifying the assembly and the type name

          Dino

          • #18950

            Hi, 

            I finally managed to get a dynamic send to a SOAP web service working. For what it’s worth here are my findings:

            1) I created a simple web service and then generated a proxy class using wsdl.exe. I then added the proxy to its own project and built this as a strong named assembly, deployed to the GAC.

            2) I didn’t need to use a soap:// prefix on the URI. Simply setting the Microsoft.XLANGs.BaseTypes.TransportType property on the send port to “SOAP” did the job of directing the request to the SOAP adapter.

            3) The request would fail if I did not populate the SOAP.TypeName property. This should be set to the Namespace.Class of the proxy.

            4) The SOAP.AssemblyName property should be set to the Namespace.Class, Assembly, Version, Culture, PublicKeyToken. e.g.
            msgSendRequest(SOAP.AssemblyName) = “BtsTest.CalcWebServiceProxy.CalcService,CalcWebServiceProxy, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b713f1108bae3109”;

            5) The Operation on the dynamic Send Port needs to use the same name as the WebMethod being called.

            6) The method signature of the WebMethod should be public XmlNode MyMethod(XmlNode Message)

            I’ve described what worked for me a little more formally on my blog. Hope this helps.

    • #12305

      Neal:
      I have been stuggling a lot along these lines (to create a fully dynamic port to call web services from an orchestration) with little success. I agree with Stephen that it is hard to achieve that level of flexibility.

      When you add a web reference to your BizTalk project, vs.net along with other stuff creates a Reference.odx file under the Reference.map in the web reference folder. If you open that file with the HTML/XML editor, you will see a module defined at the very end of the file. This module basically defines your in and out messages (input paramters to the web service and the return) for calling the web service. When you get the AssemblyName error, basically, the SOAP adapter is looking for that assembly name. If you set the type of your dynamic port to that web port type (which is created automatically) then this error goes away. But to me it defeats the purpose of having a true dynamic port to call any webservice. I personally, instead of setting all the SOAP based context properties of the message, used the web port type and set the address of the dynamic port address in the message assignment shape. Like this:

      MyDynPort(Microsoft.XLANGs.BaseTypes.Address) = \”http://localhost/Bank.CreditCardGateway/CreditCard.asmx\”;

      This doesn’t allow me to call any web service, but it allows me to call the same web service with configurable address that I can set from within orchestration.

      HTH,

      Inam Haq
      Ravian Consulting Inc.
      http://www.RavianConsulting.com

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.