Hi
I'm pretty new to BizTalk and having an issue around how BizTalk handles envelopes. Using fiddler I can see the message below is being returned from a third party SOAP API (SalesForce) to my BizTalk 2010 server:
HTTP/1.1 200 OK
Date: Tue, 20 Jan 2015 11:05:03 GMT
Set-Cookie: BrowserId=oPAPqlH7TbmO64uWvuSduw;Path=/;Domain=.salesforce.com;Expires=Sat, 21-Mar-2015 11:05:03 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/xml;charset=UTF-8
Content-Length: 706<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns="urn:enterprise.soap.sforce.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sf="urn:sobject.enterprise.soap.sforce.com">
<soapenv:Header>
<LimitInfoHeader>
<limitInfo>
<current>54</current>
<limit>5000000</limit>
<type>API REQUESTS</type>
</limitInfo>
</LimitInfoHeader>
</soapenv:Header>
<soapenv:Body>
<queryResponse>
<result>
<done>true</done>
<queryLocator xsi:nil="true"/>
<records xsi:type="sf:Contact">
<sf:Id xsi:nil="true"/>
<sf:FirstName>Colin</sf:FirstName>
<sf:LastName>Smith</sf:LastName>
</records>
<size>1</size>
</result>
</queryResponse>
</soapenv:Body>
</soapenv:Envelope>
I'm use a Dynamic Solicit-Response Send Port in this communication as I have to set the URL from within the orchestration. You can see the envelope includes several namespaces, including xmlns:sf="urn:sobject.enterprise.soap.sforce.com". When BizTalk receives this envelope I'm guessing it does its best to extract the Body section for use in my orchestration as I can see when it errors, the message it has is:
<queryResponse xmlns="urn:enterprise.soap.sforce.com"> <result> <done>true</done> <queryLocator xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" /> <records xsi:type="sf:Contact" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <sf:Id xsi:nil="true" xmlns:sf="urn:sobject.enterprise.soap.sforce.com" /> <sf:FirstName xmlns:sf="urn:sobject.enterprise.soap.sforce.com">Colin</sf:FirstName> <sf:LastName xmlns:sf="urn:sobject.enterprise.soap.sforce.com">Smith</sf:LastName> </records> <size>1</size> </result> </queryResponse>
So for elements sf:Id, sf:FirstName and sf:LastName, BizTalk has kindly added the 'sf' namespace. Unfortunately, for the 'records' element which specifies the type sf:Contact BizTalk has not added the 'sf' namespace, so I get the error below when I try to use the message within my orchestration:
Error details: Unable to read the stream produced by the pipeline.
Details: The value 'sf:Contact' is invalid according to its schema type 'http://www.w3.org/2001/XMLSchema:QName' - 'sf' is an undeclared prefix.
Any help on how I can work around this issue would be very greatly appreciated.
Colin.
- Edited by ColinCG Tuesday, January 20, 2015 12:28 PM Improved formatting