atul phatak

atul phatak

  • NA
  • 4
  • 1.4k

Getting an error "The provided XML in the SOAP attachment is

Feb 16 2015 2:24 AM
I have added web reference and also authenticate it while adding.Following is web request in xml format
 
POST https://abc.taleo.net/orion/soap?ServiceName=IntegrationManagementService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/related; type="application/xop+xml"; start="<[email protected]>"; start-info="text/xml"; boundary="----=_Part_0_29587830.1410368065144"
SOAPAction: "http://www.taleo.com/ws/integration/toolkit/2011/05/management/IntegrationManagementService#submitLargeDocument"
Authorization: Basic aW50Z191bmlsZXZlcjohbnRnXzg2Nw==
MIME-Version: 1.0
Content-Length: 21450
Host: abc.taleo.net
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
------=_Part_0_29587830.1410368065144
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <[email protected]>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:add="http://www.w3.org/2005/03/addressing" xmlns:man="http://www.taleo.com/ws/integration/toolkit/2011/05/management">
<soapenv:Header>
<add:Action>http://www.taleo.com/ws/integration/toolkit/2005/07/action/export</add:Action>
<add:ReplyTo>
<add:Address>http://www.taleo.com/ws/integration/toolkit/2005/07/addressing/queue</add:Address>
</add:ReplyTo>
<add:MessageID>SP-profile-specific-employee</add:MessageID>
</soapenv:Header>
<soapenv:Body>
<man:submitLargeDocument>
<man:Document>cid:abc-profile-specific-employee-send-request-attachment.xml</man:Document>
</man:submitLargeDocument>
</soapenv:Body>
</soapenv:Envelope>
 
Following is c# code
public ActionResult Index()
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(Settings.Default.NewTaleoIntegration_IntegrationManagementServiceWebReference_IntegrationManagementService);
IntegrationManagementService imsClient = new IntegrationManagementService();
imsClient.submitLargeDocumentCompleted += new submitLargeDocumentCompletedEventHandler(imsClient_submitLargeDocumentCompleted);
imsClient.Credentials = new NetworkCredential(UserName, PassWord);
imsClient.PreAuthenticate = false;
imsClient.submitLargeDocumentAsync(GetProfileSendRequestResult());
return View();
}
private byte[] GetProfileSendRequestResult()
{
string filePath = @"D:\request.xml";
FileStream fileContents = System.IO.File.OpenRead(filePath);
string contents;
using (var sr = new StreamReader(fileContents))
{
contents = sr.ReadToEnd();
}
byte[] sdf = Encoding.Default.GetBytes(contents);
return sdf;
}