移动provision接口技术疑问?急

xxh365 2005-06-28 10:42:05
我打算用C#写Provision接口,现在不明白我的web service服务如何接收移动MISC的数据包。如何发送数据包。
技术思路有问题,以前没有使用过。
有简单的代码就更好了,谢谢!!
...全文
94 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiri07 2005-06-29
  • 打赏
  • 举报
回复
C#:
dsmp.asmx
-------------
<%@ WebService Language="c#" Codebehind="dsmp.asmx.cs" Class="Provision.Provision" %>


==============
dsmp.asmx.cs
-------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.IO;
using System.Text;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Web.SessionState;
using System.Web.Services.Protocols;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using System.Web.Services.Description;

namespace Provision
{
/// <summary>
/// dsmp 的摘要说明。
/// </summary>
[WebService(Namespace="http://www.monternet.com/dsmp/schemas/")]
public class Provision : System.Web.Services.WebService
{
public Provision()
{
InitializeComponent();
}

#region 组件设计器生成的代码

//Web 服务设计器所必需的
private IContainer components = null;

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
}

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}

#endregion

public TransactionID transID;

[WebMethod]
[SoapHeader("transID", Direction=SoapHeaderDirection.InOut)]
[SoapDocumentMethod("sim.SyncOrderRelation",RequestElementName="SyncOrderRelationReq",ResponseElementName="SyncOrderRelationResp",Use=System.Web.Services.Description.SoapBindingUse.Literal)]
[return: System.Xml.Serialization.SoapElementAttribute("return")]
public void SyncOrderRelation(
[XmlElement(Form=XmlSchemaForm.Unqualified)]
ref string Version ,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
ref string MsgType,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
AddressInfo Send_Address,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
AddressInfo Dest_Address,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
UserID FeeUser_ID,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
UserID DestUser_ID,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
string LinkID,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
int ActionID,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
int ActionReasonID,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
string SPID,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
string SPServiceID,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
int AccessMode,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
byte[] FeatureStr,
[XmlElement(Form=XmlSchemaForm.Unqualified)]
out int hRet
)
{
Version="1.5.0";
hRet = 0;
MsgType = "SynOrderRelationReq";
}
}

[XmlRoot(Namespace="http://www.monternet.com/dsmp/schemas/")]
public class TransactionID: SoapHeader
{
[XmlText(typeof(string))]
public string ID;
}

public class UserID
{
[XmlElement(Form=XmlSchemaForm.Unqualified)]
public int UserIDType;
[XmlElement(Form=XmlSchemaForm.Unqualified)]
public string MSISDN;
[XmlElement(Form=XmlSchemaForm.Unqualified)]
public byte[] PseudoCode;
}

public class AddressInfo
{
[XmlElement(Form=XmlSchemaForm.Unqualified)]
public int DeviceType;
[XmlElement(Form=XmlSchemaForm.Unqualified)]
public string DeviceID;
}
}


@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
人約黃昏後(詞牌:生查子)
詞 歐陽修(宋) 曲 翁清溪 編 東 尼

去年元夜時 花市燈如晝 月到柳梢頭 人約黃昏後
今年元夜時 月與燈依舊 不見去年人 淚濕春衫袖
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
yes4pierce 2005-06-28
  • 打赏
  • 举报
回复
最好使用WebService,不过我还不太明白WebService;
可以使用HttpRequest和HttpResponse来同Misc交互,代码网上很多,可以搜一下。
也可以使用Socket,只是比较费事。
Tomgus 2005-06-28
  • 打赏
  • 举报
回复
移动的Provision的xml,在.net的Web Services 里不好用。

建义用asp.net来处理,在aspx页面接受post过来的xml数据,然后解析他
生成他所要求的xml格式,并Response返回给他。

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧