电信java调用我方.net webservice的问题
背景:我朋友的公司(以下简称公司)与电信合作,电信那边用java调用公司.net的 webservice,但是那边无易做图常调用,那边说无法提供技术支持,也给不了出错信息反馈,也不知道他们是用的axis、xfire还是cxf,反正只知道是java。但是自己用.net能调,自己用java的cxf也能正常调用,就他们电信那边java不能调。头大了。电信给了他们的wsdl模板, 大家帮我分析下,可能有什么原因,以下是.net生成的wsdl:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://localhost:5119/DxCallBackService/Service.asmx" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://localhost:5119/DxCallBackService/Service.asmx" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types />
<wsdl:message name="HelloWorldSoapIn">
<wsdl:part name="ss" type="s:string" />
</wsdl:message>
<wsdl:message name="HelloWorldSoapOut">
<wsdl:part name="HelloWorldResult" type="s:string" />
</wsdl:message>
<wsdl:message name="RecvSMSSoapIn">
<wsdl:part name="caller" type="s:string" />
<wsdl:part name="time" type="s:string" />
<wsdl:part name="cont" type="s:string" />
<wsdl:part name="ucNum" type="s:string" />
</wsdl:message>
<wsdl:message name="RecvSMSSoapOut">
<wsdl:part name="RecvSMSResult" type="s:string" />
</wsdl:message>
<wsdl:message name="EchoOfSendSMSSoapIn">
<wsdl:part name="ucNum" type="s:string" />
<wsdl:part name="cee" type="s:string" />
<wsdl:part name="msgid" type="s:int" />
<wsdl:part name="res" type="s:int" />
<wsdl:part name="recvt" type="s:string" />
</wsdl:message>
<wsdl:message name="EchoOfSendSMSSoapOut" />
<wsdl:message name="NotifyStatusSoapIn">
<wsdl:part name="eventID" type="s:int" />
<wsdl:part name="sessionID" type="s:string" />
<wsdl:part name="res" type="s:int" />
<wsdl:part name="para1" type="s:string" />
</wsdl:message>
<wsdl:message name="NotifyStatusSoapOut" />
<wsdl:portType name="CallBackServiceSoap">
<wsdl:operation name="HelloWorld">
<wsdl:input message="tns:HelloWorldSoapIn" />
<wsdl:output message="tns:HelloWorldSoapOut" />
</wsdl:operation>
<wsdl:operation name="RecvSMS">
<wsdl:input message="tns:RecvSMSSoapIn" />
<wsdl:output message="tns:RecvSMSSoapOut" />
</wsdl:operation>
<wsdl:operation name="EchoOfSendSMS">
<wsdl:input message="tns:EchoOfSendSMSSoapIn" />
<wsdl:output message="tns:EchoOfSendSMSSoapOut" />
</wsdl:operation>
<wsdl:operation name="NotifyStatus">
<wsdl:input message="tns:NotifyStatusSoapIn" />
<wsdl:output message="tns:NotifyStatusSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CallBackServiceSoap" type="tns:CallBackServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
<wsdl:operation name="HelloWorld">
<soap:operation soapAction="http://localhost:5119/DxCallBackService/Service.asmx/HelloWorld" style="rpc" />
<wsdl:input>
<soap:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RecvSMS">
<soap:operation soapAction="http://localhost:5119/DxCallBackService/Service.asmx/RecvSMS" style="rpc" />
<wsdl:input>
<soap:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="EchoOfSendSMS">
<soap:operation soapAction="http://localhost:5119/DxCallBackService/Service.asmx/EchoOfSendSMS" style="rpc" />
<wsdl:input>
<soap:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="NotifyStatus">
<soap:operation soapAction="http://localhost:5119/DxCallBackService/Service.asmx/NotifyStatus" style="rpc" />
<wsdl:input>
<soap:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="CallBackServiceSoap12" type="tns:CallBackServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
<wsdl:operation name="HelloWorld">
<soap12:operation soapAction="http://localhost:5119/DxCallBackService/Service.asmx/HelloWorld" style="rpc" />
<wsdl:input>
<soap12:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://www.w3.org/2003/05/soap-encoding" />
</wsdl:input>
<wsdl:output>
<soap12:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://www.w3.org/2003/05/soap-encoding" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="RecvSMS">
<soap12:operation soapAction="http://localhost:5119/DxCallBackService/Service.asmx/RecvSMS" style="rpc" />
<wsdl:input>
<soap12:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://www.w3.org/2003/05/soap-encoding" />
</wsdl:input>
<wsdl:output>
<soap12:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://www.w3.org/2003/05/soap-encoding" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="EchoOfSendSMS">
<soap12:operation soapAction="http://localhost:5119/DxCallBackService/Service.asmx/EchoOfSendSMS" style="rpc" />
<wsdl:input>
<soap12:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://www.w3.org/2003/05/soap-encoding" />
</wsdl:input>
<wsdl:output>
<soap12:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://www.w3.org/2003/05/soap-encoding" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="NotifyStatus">
<soap12:operation soapAction="http://localhost:5119/DxCallBackService/Service.asmx/NotifyStatus" style="rpc" />
<wsdl:input>
<soap12:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://www.w3.org/2003/05/soap-encoding" />
</wsdl:input>
<wsdl:output>
<soap12:body use="encoded" namespace="http://localhost:5119/DxCallBackService/Service.asmx" encodingStyle="http://www.w3.org/2003/05/soap-encoding" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CallBackService">
<wsdl:port name="CallBackServiceSoap" binding="tns:CallBackServiceSoap">
<soap:address location="http://202.105.13.142/DXCallBackService/Service.asmx" />
</wsdl:port>
<wsdl:port name="CallBackServiceSoap12" binding="tns:CallBackServiceSoap12">
<soap12:address location="http://202.105.13.142/DXCallBackService/Service.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
以下是电信那边给的wsdl模板,晕,csdn说帖子太长,不能贴出来,我就给出访问地址吧;
http://202.105.212.146:8080/jboss-net/services/TestCallBack?wsdl
我自己对webservice本身也不熟,时间紧,也没法细细研究webservice了, 大家说可能原因在哪?
--------------------编程问答-------------------- 问题解决就结贴,顶啊 --------------------编程问答-------------------- 不是电信调用你们的WebService么?他们给出的wsdl是怎么个意思? --------------------编程问答-------------------- VS工具可以生成CS代码的
http://msdn.microsoft.com/zh-cn/library/7h3ystb6.aspx
--------------------编程问答--------------------
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:2.0.50727.4961
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
//
// 此源代码由 wsdl 自动生成, Version=2.0.50727.3038。
//
namespace TestInfos {
using System.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Web.Services.WebServiceBindingAttribute(Name="WebServiceSoap", Namespace="http://cx.org/")]
public inte易做图ce IWebServiceSoap {
Authentication AuthenticationValue {
get;
set;
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("AuthenticationValue")]
[System.Web.Services.WebMethodAttribute()]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://cx.org/GetMemberInfo", RequestNamespace="http://cx.org/", ResponseNamespace="http://cx.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
MemberInfo GetMemberInfo(string cardNumber);
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://cx.org/")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://cx.org/", IsNullable=false)]
public partial class Authentication : System.Web.Services.Protocols.SoapHeader {
private string userField;
private string passwordField;
private System.Xml.XmlAttribute[] anyAttrField;
/// <remarks/>
public string User {
get {
return this.userField;
}
set {
this.userField = value;
}
}
/// <remarks/>
public string Password {
get {
return this.passwordField;
}
set {
this.passwordField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlAnyAttributeAttribute()]
public System.Xml.XmlAttribute[] AnyAttr {
get {
return this.anyAttrField;
}
set {
this.anyAttrField = value;
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://cx.org/")]
public partial class MemberInfo {
private string cardNumberField;
private string userNameField;
private string cardTypeField;
private decimal moneyField;
private decimal scoreField;
private string shopField;
private string mobileField;
private System.DateTime extDateField;
private System.DateTime startDateField;
/// <remarks/>
public string CardNumber {
get {
return this.cardNumberField;
}
set {
this.cardNumberField = value;
}
}
/// <remarks/>
public string UserName {
get {
return this.userNameField;
}
set {
this.userNameField = value;
}
}
/// <remarks/>
public string CardType {
get {
return this.cardTypeField;
}
set {
this.cardTypeField = value;
}
}
/// <remarks/>
public decimal Money {
get {
return this.moneyField;
}
set {
this.moneyField = value;
}
}
/// <remarks/>
public decimal Score {
get {
return this.scoreField;
}
set {
this.scoreField = value;
}
}
/// <remarks/>
public string Shop {
get {
return this.shopField;
}
set {
this.shopField = value;
}
}
/// <remarks/>
public string Mobile {
get {
return this.mobileField;
}
set {
this.mobileField = value;
}
}
/// <remarks/>
public System.DateTime ExtDate {
get {
return this.extDateField;
}
set {
this.extDateField = value;
}
}
/// <remarks/>
public System.DateTime StartDate {
get {
return this.startDateField;
}
set {
this.startDateField = value;
}
}
}
}
--------------------编程问答-------------------- 建议改成http+签名的方式提供接口,比webservice方便多了 --------------------编程问答-------------------- 那就自己实现java的调用封装成API给他们 --------------------编程问答-------------------- 电信公司调用方式是固定的(电信还与其它公司有合作,所以改他的调用方法不太可能)
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:2.0.50727.4963
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
//
// 此源代码由 wsdl 自动生成, Version=2.0.50727.3038。
//
namespace TestCallBack {
using System.Diagnostics;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Xml.Serialization;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Web.Services.WebServiceBindingAttribute(Name="TestCallBackSoapBinding", Namespace="http://202.105.212.146:8080/jboss-net/services/TestCallBack")]
public inte易做图ce ITestCallBackSoapBinding {
/// <remarks/>
[System.Web.Services.WebMethodAttribute()]
[System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://proxy.webservice.uc.fin.huawei.com", ResponseNamespace="http://202.105.212.146:8080/jboss-net/services/TestCallBack")]
[return: System.Xml.Serialization.SoapElementAttribute("testReturn")]
string[] test(string url);
}
}
电信给的wsdl是参考模板,就要生成那边样类似的。
--------------------编程问答-------------------- 我遇到 的问题跟楼主的一样,跟贴,,我也希望快点找到解决方法~~
--------------------编程问答-------------------- 电信移动那边的开发商都是些混的人,技术水平真不行,这年头,有关系就对了,至于产品嘛,哄得过领导就对了。 --------------------编程问答-------------------- 哇哦,电信什么的都玩JSP,其实JSP也好不到哪里去,自己给自己找麻烦 --------------------编程问答-------------------- 用ksoap2 --------------------编程问答-------------------- 试一试这种方法
WSDL-First development with WCF
http://blogs.msdn.com/b/dotnetinterop/archive/2008/09/24/wsdl-first-development-with-wcf.aspx
补充:.NET技术 , ASP.NET