ASP调用WebService的问题,谢谢

chenou851123 2008-11-21 10:25:26
对方就提供了一个wsdl文件 我已经编译成.CS文件,在VS2005里面增加.CS文件后是正常的方法都可以出来。

但是现在要在ASP里面调用,下面是WSDL文件,请问下各位我要在ASP里面怎么调用,对方的系统要我传递传输过去,谢谢


<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="MI_OS_02HR147Request" targetNamespace="http://cgnpc.com.cn/XI" xmlns:p1="http://cgnpc.com.cn/XI" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><wsdl:types><xsd:schema targetNamespace="http://cgnpc.com.cn/XI" xmlns="http://cgnpc.com.cn/XI" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:element name="MT_Z_02HR_147_Return" type="DT_Z_02HR_147_Return" /><xsd:element name="MT_Z_02HR_147_Request" type="DT_Z_02HR_147_Request" /><xsd:complexType name="DT_Z_02HR_147_Return"><xsd:sequence><xsd:element name="T_RETURN" minOccurs="0" maxOccurs="unbounded" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1983000a55c11ddad25001a73a94339</xsd:appinfo></xsd:annotation><xsd:complexType><xsd:sequence><xsd:element name="TYPE" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1983001a55c11ddca09001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">消息类型: S 成功,E 错误,W 警告,I 信息,A 中断</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="ID" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1983002a55c11ddb0b5001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">消息, 消息类</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="NUMBER" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1983003a55c11dda344001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">消息, 消息编号</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="MESSAGE" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1983004a55c11ddcac3001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">消息文本</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="LOG_NO" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1983005a55c11ddb88b001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">应用程序日志: 日志号</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="LOG_MSG_NO" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1983006a55c11dd88fa001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">应用日志:内部邮件序列号</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="MESSAGE_V1" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1983007a55c11dda13d001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">消息,消息变量</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="MESSAGE_V2" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1983008a55c11dda5d9001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">消息,消息变量</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="MESSAGE_V3" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1985710a55c11ddcc42001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">消息,消息变量</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="MESSAGE_V4" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">f1985711a55c11dd87cc001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">消息,消息变量</xsd:documentation></xsd:annotation></xsd:element></xsd:sequence></xsd:complexType></xsd:element></xsd:sequence></xsd:complexType><xsd:complexType name="DT_Z_02HR_147_Request"><xsd:sequence><xsd:element name="T_P2010" minOccurs="0" maxOccurs="unbounded" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">29001b30a55c11ddc900001a73a94339</xsd:appinfo></xsd:annotation><xsd:complexType><xsd:sequence><xsd:element name="PERNR" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">290153b0a55c11dda0ff001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">人员号</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="ZKQDM" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">290153b1a55c11dd9c03001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">工资项</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="ANZHL" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">290153b2a55c11ddae67001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">数量/单位</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="EITXT" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">290153b3a55c11ddafcf001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">时间/计量单位文本</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="BETRG" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">290153b4a55c11ddaecb001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">金额</xsd:documentation></xsd:annotation></xsd:element><xsd:element name="DATUM" type="xsd:string"><xsd:annotation><xsd:appinfo source="http://sap.com/xi/TextID">290153b5a55c11ddb15b001a73a94339</xsd:appinfo><xsd:documentation xml:lang="EN">开始日期</xsd:documentation></xsd:annotation></xsd:element></xsd:sequence></xsd:complexType></xsd:element></xsd:sequence></xsd:complexType></xsd:schema></wsdl:types><wsdl:message name="MT_Z_02HR_147_Request"><wsdl:part name="MT_Z_02HR_147_Request" element="p1:MT_Z_02HR_147_Request" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" /></wsdl:message><wsdl:message name="MT_Z_02HR_147_Return"><wsdl:part name="MT_Z_02HR_147_Return" element="p1:MT_Z_02HR_147_Return" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" /></wsdl:message><wsdl:portType name="MI_OS_02HR147Request"><wsdl:operation name="MI_OS_02HR147Request"><wsdl:input message="p1:MT_Z_02HR_147_Request" /><wsdl:output message="p1:MT_Z_02HR_147_Return" /></wsdl:operation></wsdl:portType><wsdl:binding name="MI_OS_02HR147RequestBinding" type="p1:MI_OS_02HR147Request" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /><wsdl:operation name="MI_OS_02HR147Request"><soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /><wsdl:input><soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /></wsdl:input><wsdl:output><soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="MI_OS_02HR147RequestService"><wsdl:port name="MI_OS_02HR147RequestPort" binding="p1:MI_OS_02HR147RequestBinding" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><soap:address location="http://10.0.16.26:8000/XISOAPAdapter/MessageServlet?channel=:HR:CC_02HR147_SOAP_Sender&version=3.0&Sender.Service=x&Interface=x%5Ex" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /></wsdl:port></wsdl:service></wsdl:definitions>



...全文
91 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
tang_fu 2008-12-01
http://www.iwms.net/n888c12.aspx
回复
hebhd 2008-11-25
http://www.iwms.net/n888c12.aspx
回复
yeah920 2008-11-25
帮忙up起来
回复
layers2323 2008-11-21
没调用过,高级,学习。
回复
chenou851123 2008-11-21
这个是WESD.EXE编译过后的文件

//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行库版本:2.0.50727.1433
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------

//
// 此源代码由 wsdl 自动生成, Version=2.0.50727.42。
//
namespace MI_OS_02HR147Request {
using System.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
}

/// <remarks/>
public event MI_OS_02HR147RequestCompletedEventHandler MI_OS_02HR147RequestCompleted;



/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://cgnpc.com.cn/XI")]
public partial class DT_Z_02HR_147_ReturnT_RETURN {

private string tYPEField;

private string idField;

private string nUMBERField;

private string mESSAGEField;

private string lOG_NOField;

private string lOG_MSG_NOField;

private string mESSAGE_V1Field;

private string mESSAGE_V2Field;

private string mESSAGE_V3Field;

private string mESSAGE_V4Field;

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string TYPE {
get {
return this.tYPEField;
}
set {
this.tYPEField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string ID {
get {
return this.idField;
}
set {
this.idField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="integer")]
public string NUMBER {
get {
return this.nUMBERField;
}
set {
this.nUMBERField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MESSAGE {
get {
return this.mESSAGEField;
}
set {
this.mESSAGEField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string LOG_NO {
get {
return this.lOG_NOField;
}
set {
this.lOG_NOField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, DataType="integer")]
public string LOG_MSG_NO {
get {
return this.lOG_MSG_NOField;
}
set {
this.lOG_MSG_NOField = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MESSAGE_V1 {
get {
return this.mESSAGE_V1Field;
}
set {
this.mESSAGE_V1Field = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MESSAGE_V2 {
get {
return this.mESSAGE_V2Field;
}
set {
this.mESSAGE_V2Field = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MESSAGE_V3 {
get {
return this.mESSAGE_V3Field;
}
set {
this.mESSAGE_V3Field = value;
}
}

/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public string MESSAGE_V4 {
get {
return this.mESSAGE_V4Field;
}
set {
this.mESSAGE_V4Field = value;
}
}
}

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void MI_OS_02HR147RequestCompletedEventHandler(object sender, MI_OS_02HR147RequestCompletedEventArgs e);

/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class MI_OS_02HR147RequestCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {

private object[] results;

internal MI_OS_02HR147RequestCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}

/// <remarks/>
public DT_Z_02HR_147_ReturnT_RETURN[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((DT_Z_02HR_147_ReturnT_RETURN[])(this.results[0]));
}
}
}
}



要在ASP里面要怎么调用是否要对方提供.asmx的地址啊?

是否就是这一句<soap:address location="http://10.0.16.26:8000/XISOAPAdapter/MessageServlet?channel=:HR:CC_02HR147_SOAP_Sender&version=3.0&Sender.Service=x&Interface=x%5Ex" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" />
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2008-11-21 10:25
社区公告
暂无公告