I am trying to figure out why I am having an authentication error while attempting to do a Job Submit call. I was able to use the credentials to log into the portal without and issue, but they don't seem to be working with the API call. I got most of the code from the API guide and modified it to what I needed. Right now I'm just trying to get a job to work and have some clean up to do still. Here is the code I'm using. I also attached a screenshot of the error, and a screen shot of the request and response I grabbed in Fiddler. Any help would be greatly appreciated.
JobSubmitService EM = new JobSubmitService();
var reqAuth = new RequestAuthentication
{
Item = new XDDSAuthType
{
RequesterID = new UIDType
{
Value = GetConfigSetting("XDDSUser")
},
Password = GetConfigSetting("XDDSPw")
}
};
var messages = new List<MessageType>();
foreach (var fax in faxes)
{
messages.Add(new MessageType
{
Contents = new ContentsType
{
Part = new ContentPartType[]
{
new ContentPartType
{
Item = new DocumentType
{
Item = new DocDataType
{
format = DocEncodingFormat.base64,
Value = ReadAndEncodedFile(fax.FaxFileName)
},
Filename = EncodableString(fax.FaxFileName),
DocType = "PDF",
ItemElementName = ItemChoiceType.DocData,
@ref = "ATTACH1"
}
}
}
},
JobOptions = new JobOptionsType
{
BillingCode = EncodableString(GetConfigSetting("billingCode")),
Delivery = new DeliveryType
{
Schedule = ScheduleType.express
},
FaxOptions = new FaxOptionsType
{
FaxCoversheet = new FaxCoversheetOptionType
{
CoversheetTo = EncodableString(fax.FaxTo),
CoversheetFrom = EncodableString(GetUser()),
CoversheetAttn = EncodableString(GetConfigSetting("coversheetAttn")),
UseCoversheet = YesNo.yes
},
FaxMode = ShouldUseFine() ? FaxModeType.fine : FaxModeType.standard
},
PriorityBoost = IsHighPriority()
},
Destinations = new FaxType[]
{
new FaxType
{
Phone = fax.FaxNumber,
To = EncodableString(fax.FaxTo),
From = EncodableString(Environment.UserName)
}
}
});
}
var JS_Request = new JobSubmitRequest
{
Message = messages.ToArray(),
SubmitId = "SubmitId"
};
Set_Server_and_Proxy(EM);
EM.RequestValue = new Request
{
ReceiverKey = EM.Url,
Authentication = reqAuth,
RequestID = "RequestID"
};
EM.ResponseValue = new Response();
JobSubmitResult JS_Result = new JobSubmitResult();
try
{
JS_Result = EM.JobSubmit(JS_Request);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.Read();
}