Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Problem adding soap header
- This topic has 2 replies, 1 voice, and was last updated 9 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
November 13, 2009 at 7:08 AM #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″ xmlns=”http://ProjectName.Schemas.SoapHeader” targetNamespace=”http://schemas.microsoft.com/BizTalk/2003/SOAPHeader” xmlns:xs=”http://www.w3.org/2001/XMLSchema”>
<xs:annotation>
<xs:appinfo>
<b:schemaInfo schema_type=”property” xmlns:b=”http://schemas.microsoft.com/BizTalk/2003″ />
</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/SOAPHeaderI 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?
-
November 13, 2009 at 7:45 PM #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.
-
November 16, 2009 at 2:18 AM #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
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.