电信提供发送的传真接口,现在我只需要把网页文件通过某一事件的执行,就把这个网页上的内容发送出去,请问谁知道怎么实现?比如网页上有内容,也有相关的接口参数,还有一个执行按妞,我只需要点击这个按妞,就可以把这份传真发送出去,请问这个怎么实现?
我的意思是先把网页转成Doc格式,然后再发送,但是到底是不是这样实现的?哪个朋友做过,麻烦指点一下
我的意思是先把网页转成Doc格式,然后再发送,但是到底是不是这样实现的?哪个朋友做过,麻烦指点一下
kkun_3yue3 ~~直接拼成普通的字符串?就可以吗?多谢你的指点
---------------------------------------------------------
拼成标准html,如果其中用了图片,要用物理路径,否则传真机不识别,如"c:\\images\\a.jpg"这样的
{ this.faxProperty.ToFaxCode = this.CheckFaxCode();
if(null == this.faxProperty.ToFaxCode)
return false; try
{
Etmc.EtmcBo.localhost.FaxService fs=new Etmc.EtmcBo.localhost.FaxService();
EmployeeDTO emp = this.GetOneEmployee(); //取出登陆人的用户名字和密码
string token=fs.Login ("etmc","etmc",false); //调用登陆接口
string sendfax_restr=fs.SendFax (token,GetFaxXML());
this.faxProperty.SendUserName = emp.name; //插入发送传真历史记录到表ET_Order_SendFax
Etmc.App.Ticket.DataAccess.FaxSend faxsend=new Etmc.App.Ticket.DataAccess.FaxSend();
faxsend.ORDER_ID = this.faxProperty.OrderId;
faxsend.FAX_ID= this.faxProperty.FaxId;
faxsend.FAX_TYPE = this.faxProperty.SendType;
faxsend.COMPANY_NAME = this.faxProperty.HotelName;
faxsend.ORDER_STATUS =this.faxProperty.OrderStatus; //Convert.ToInt32(dr["orderstatus"]);
faxsend.FAX = this.faxProperty.ToFaxCode;//FaxCodeOk;
faxsend.USER_NAME = this.faxProperty.SendUserName;
faxsend.SEND_TIME=System.DateTime.Now;
faxsend.InsertOneSendFax();
//调用退出接口
fs.Logout (token);
return true;
}
catch(Exception e)
{
throw e;
}
}以上仅供参考,如果你要用的话,可能改动也小不了,看看思路就行了,具体部署还要改的,
我在调用此方法时,
protected void btnSendFax_Click(object sender,System.EventArgs e)
{
this.GetFaxAccess(); string urlPath = this.Request.UrlReferrer.AbsoluteUri + "&type=Send&fax=Send";
string responseString = CommUtil.WebRequestGetString(urlPath);
SendFaxProperty sendProperty = new SendFaxProperty();
sendProperty.FaxId = 1;
sendProperty.SenderUserId = 1;
sendProperty.SendHtml = responseString; sendProperty.HotelName = this.hotelInfo.HotelName;
sendProperty.OrderId = Convert.ToInt32(this.orderInfo.OrderId);
sendProperty.OrderStatus = 0;
sendProperty.SendType = 1;
//sendProperty.SendTime = DateTime.Now;
sendProperty.ToFaxCode = this.hotelInfo.SaleFax;
this.Response.Write(responseString);
SendFaxOperator sendOperator = new SendFaxOperator(sendProperty);
bool sendResult = sendOperator.Invoke();
if(sendResult)
{
CommUtil.Alert("发送成功!",this.Request.RawUrl);
}
else
{
CommUtil.Alert("发送失败");
}
}
----------------------------------
其中string responseString = CommUtil.WebRequestGetString(urlPath);
就是标准的html字符串,并将该字符串传给发送传真的类的SendHtml属性中,
sendProperty.SendHtml = responseString;
public string SendFax(string tokenId, string sendFaxList) {
object[] results = this.Invoke("SendFax", new object[] {
tokenId,
sendFaxList});
return ((string)(results[0]));
}
以上是string sendfax_restr=fs.SendFax (token,GetFaxXML());
中SendFax方法的定义