Problem adding soap header

Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Problem adding soap header

Viewing 1 reply thread
  • Author
    Posts
    • #23769

      I’m trying to add a soapheader to a (3rd party) webservice request.
      The wsdl file contains this:

      <s:element name=”Security” type=”tns:SecurityHeader” />
            <s:complexType name=”SecurityHeader”>
              <s:sequence>
                <s:element minOccurs=”0″ maxOccurs=”1″ name=”ClientID” type=”s:string” />
                <s:element minOccurs=”0″ maxOccurs=”1″ name=”Checksum” type=”s:string” />
              </s:sequence>
            </s:complexType>

      I added a SoapHeader.xsd file containing this:

      <?xml version=”1.0″ encoding=”utf-16″?>
      <xs:schema xmlns:b=”http://schemas.microsoft.com/BizTalk/2003&#8243; xmlns=”http://ProjectName.Schemas.SoapHeader&#8221; targetNamespace=”http://schemas.microsoft.com/BizTalk/2003/SOAPHeader&#8221; xmlns:xs=”http://www.w3.org/2001/XMLSchema”&gt;
        <xs:annotation>
          <xs:appinfo>
            <b:schemaInfo schema_type=”property” xmlns:b=”http://schemas.microsoft.com/BizTalk/2003&#8243; />
          </xs:appinfo>
        </xs:annotation>
        <xs:element name=”Security” type=”xs:string”>
          <xs:annotation>
            <xs:appinfo>
              <b:fieldInfo propertyGuid=”3945ff09-65a5-4bbd-8689-103ef958ba31″ propSchFieldBase=”MessageContextPropertyBase” />
            </xs:appinfo>
          </xs:annotation>
        </xs:element>
      </xs:schema>

      I try to set the soap header in a messege assignment shape:

      GetGroupByNameRequestMessage(ProjectName.Schemas.Security) = “<?xml version=\”1.0\” encoding=\”utf-8\” ?><Security xmlns= \”http://questionmark.com/QMWISE/\”><ClientID>manager</ClientID><Checksum>removed</Checksum></Security>”;
      I think the namespace isn’t right, but I don’t know what namespace I need to use. I also tried the namespaces http://ProjectName.Schemas.SoapHeader and http://schemas.microsoft.com/BizTalk/2003/SOAPHeader

      I get this error:

      The adapter failed to transmit message going to send port “SendPortQMP” with URL removed. It will be retransmitted after the retry interval specified for this Send Port. Details:”Failed to initialize the SOAP header field or property “Security”.
       Details: “System.InvalidOperationException: There is an error in XML document (1, 41).”.
       Possible reasons are:
       1) MemberName property of System.Web.Services.Protocol.SoapHeaderAttribute does not map to a field or property in the type.
       2) The message context property value associated with the header cannot be converted to the target header type.
       3) The target field or property is read-only or cannot be modified. “.

       

      Any ideas about what I’m doing wrong?

    • #23773

      Hi Bart,

       

         Check the following BizTalkGurus thread on adding custom Soap header:

      http://www.biztalkgurus.com/forums/t/10739.aspx

       

         Basically, you can use WCF-BasicHttp adapter to connect to the web service and do what is described in this MSDN article:

      http://msdn.microsoft.com/en-us/library/bb246026(BTS.20).aspx

       

         Hope this helps.

       

         Daniel.

       

      • #23777

        Hi Daniel,

        Thanks for your answer. I’m currently using Biztalk 2006, not Biztalk 2006 R2. Maybe I should upgrade to Biztalk 2006 R2, but I prefer not to upgrade at the moment.

        Regards,

        Bart

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