我有一個WCF服務,我可以從我的Web應用程序連接到並獲取數據。WCF上的Web引用問題
我現在添加了一個web引用這個wcf項目到一個航運公司提供的wsdl文件。意圖是得到航運報價..
我能夠訪問從此wsdl文件生成的對象,但是當我調用service.Authenticate(「DEMO」);
方法幾乎沒有任何反應。我調試並看到調試器繼續到下一行但服務參數和服務沒有變化。授權爲空..
你能帶我到我應該如何進一步調試,我應該檢查,或者如果還有,我需要確保有一個Web引用工作WCF應用
感謝
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using ShippingCalculator.com.freight.api;
namespace ShippingCalculator
{
public class ShippingService : IShippingService
{
freight_service service = new freight_service();
public string GetData(int value)
{
service.setConnectionType(".net");
service.Authenticate("DEMO");
OriginRequest origin = new OriginRequest();
origin.zip = "60101";
DestinationRequest destination = new DestinationRequest();
destination.zip = "10001";
PackageRequest package = new PackageRequest();
package.weight = "10";
ShipmentInfoRequest shipmentInfo = new ShipmentInfoRequest();
shipmentInfo.ship_date = DateTime.Now.AddDays(5);
service.setOrigin(origin);
service.setDestination(destination);
service.setPackage(package);
service.setShipmentInfo(shipmentInfo);
Quote quote = service.getQuote();
return string.Format("Quote Number: {0}<br /> ", quote.QuoteNumber);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ShippingTestApp.ShippingServiceReference;
namespace ShippingTestApp.Controllers
{
[HandleError]
public class HomeController : Controller
{
public ActionResult Index()
{
ShippingServiceClient shipClient = new ShippingServiceClient();
shipClient.GetData(0);
ViewData["Message"] = shipClient.GetData(0);
return View();
}
}
}
託運人對象是服務還是服務返回的數據? – 2009-08-27 19:26:31
其服務 – kaivalya 2009-08-27 19:27:34
你能發佈你的源代碼片段嗎? – 2009-08-27 19:29:32