Web References And Types

Home Page Forums BizTalk 2004 – BizTalk 2010 Web References And Types

Viewing 1 reply thread
  • Author
    Posts
    • #14332

      I have a .NET web service of the following signature:
      [code:1:a8be557c6a]
      class c0 {
      public r0[] m0();
      public bool m1(string s0, string s1, DateTime d0);
      public r1[] m2(string s0, string s1, DateTime d1, string[] arr);
      }
      [/code:1:a8be557c6a]
      The return types r0 and r1 are defined as follows:
      [code:1:a8be557c6a]
      class r0 { public string s0, s1; }
      class r1 { public string s; public double d; }
      [/code:1:a8be557c6a]
      I’m trying to consume this web service from BizTalk (I have 2006 beta 2).
      The problem I have is that when I try to construct the message used to call the methods m1 and m2 by Tranform, they don’t appear in the Destination dropdown.
      I have a message for each Request and Response linked to the corresponding types on the web port:
      [list:a8be557c6a]m0_request, m0_response, m1_request, m1_response, m2_reqeust, m2_response[/list:u:a8be557c6a]
      There are also 6 Multi-part Message Types automatically generated. In the dialog where I choose the Source and Destination for the transform, there’s a Variable Name dropdown. I can see [list:a8be557c6a]m0_request, m0_response and m2_response[/list:u:a8be557c6a] but not the other 3.
      Am I doing something wrong?

    • #14333

      The problem is the way you are passing parameters
      If you cannot change the web service then you cannot use a transform to create the multipart requests for m1 and m2.
      Instead you need to use a MessageAssignment shape
      [code:1:61ff75d332]m1_request.s0 = \"string\";
      m1_request.s1 = \"string\";
      m1_request.d0 = System.DateTime.Now;
      //same for m2_request
      [/code:1:61ff75d332]
      The reason for this is the message parts are simple types and do not generate an Xml schema, therefore you cannot use a map.

      Alternatively you can change the web service
      [code:1:61ff75d332]class c0 {
      public r0[] m0();
      public bool m1(p1 parameter);
      public r1[] m2(p2 parameter);
      } [/code:1:61ff75d332]

      And add the following classes:
      [code:1:61ff75d332]class p1 {string s0, string s1, DateTime d0;}
      class p2 {string s0, string s1, DateTime d1, string[] arr;}
      class r0 { public string s0, s1; }
      class r1 { public string s; public double d; } [/code:1:61ff75d332]

      The request messages are now complex types and will generate an Xml schema and can be used in a map.

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