Re: Custom Soap Header

Home Page Forums BizTalk 2004 – BizTalk 2010 Custom Soap Header Re: Custom Soap Header

#20812

No, you don’t need a schema for the request (if you were using the mapping method you would, but it sounds like you’re using the XmlDocument method).  

For example, assume your web service takes 2 parameters named param1 and param2.  You would create two string variables in orchestration view and call them strParam1 and strParam2.  Then you would assign to them using xpath().  Then you would build them into the XML string you are loading.  Your code would look something like this:

strParam1 = xpath(Request, “//*[local-name()=’param1′]”);

strParam2 = xpath(Request, “//*[local-name()=’param2′]”);

WebRequestXml = new System.Xml.XmlDocument();

WebRequestXml.LoadXml(“<WebMethodName xmlns=’http://www.tempuri.org’><param1>&#8221; + strParam1 + “</param1><param2>” + strParam2 + “</param2></WebMethodName>”);

To get the web request XML format right, you should generate an instance of the _tempuri schema.  Use the generated schema as a template for the XML string that you load in the LoadXml method.