Sap WebSvc の最新の参照を受け取る単純な Net WebSvc クライアントを作成しました。String と、参照によって送信される 4 つの要素が必要です。カスタム オブジェクトの 3 つの配列と、コレクション構造の外部にある別のカスタム オブジェクト (参照ページに形式があります)
操作を実行する要求が呼び出されると、呼び出し行で SoapException "Deserialization failed" が発生します。(一番下に、コードの抜粋、呼び出す Reference.cs メソッド、およびエラーを可能な限り完全に記述します。 )
ネットで調査したところ、このエラーを示す一般的な問題はメンバー変数名の更新されていない wsdlとアンダースコアであると誰かが答えている SAP フォーラムのスレッドを見つけましたが、どちらも私の場合ではありません。実際、スレッドは続きましたが、私と同じ問題を抱えている人への応答はありませんでした.
とにかく、StackOverflowの人たちはそれよりもアクティブだと思います;-)
よろしくお願いします!
私のコードの抜粋:
string destiny = "myDest";
ZICQService ZICQ = new ZICQService();
ZtyEE070[] innerHeadList = HeadLst.ToArray();
ZtyEE071[] innerObjList = ObjLst.ToArray();
Zrequest[] innerTRequest = TRequest.ToArray();
//This is the row of the Deserialization failed
Bapiret2 respnse = svc.ZbcInsertRequest(destiny, ref innerHeadList, ref innerObjList, IClrQst, ref innerTRequest);
そして、これは私の Web サービスReference.cs 添付メソッドです。
[System.Web.Services.Protocols.SoapDocumentMethodAttribute
("", RequestNamespace="urn:sap-com:document:sap:soap:functions:mc-style",
ResponseNamespace="urn:sap-com:document:sap:soap:functions:mc-style",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("Return", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public Bapiret2 ZbcInsertRequest(
[System.Xml.Serialization.XmlElementAttribute
(Form=XmlSchemaForm.Unqualified)]
string Destino,
[System.Xml.Serialization.XmlArrayAttribute
(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlArrayItemAttribute
("item", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
ref ZtyEE070[] EtRequestHeader,
[System.Xml.Serialization.XmlArrayAttribute
(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlArrayItemAttribute
("item", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
ref ZtyEE071[] EtRequestObj,
[System.Xml.Serialization.XmlElementAttribute
(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
Zclrqstdat IClrqst,
[System.Xml.Serialization.XmlArrayAttribute
(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
[System.Xml.Serialization.XmlArrayItemAttribute
("item", Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)]
ref Zrequest[] TRequest)
{
object[] results = this.Invoke("ZbcInsertRequest", new object[] {
Destino,
EtRequestHeader,
EtRequestObj,
IClrqst,
TRequest});
EtRequestHeader = ((ZtyEE070[])(results[1]));
EtRequestObj = ((ZtyEE071[])(results[2]));
TRequest = ((Zrequest[])(results[3]));
return ((Bapiret2)(results[0]));
}
エラー:
System.Web.Services.Protocols.SoapException
未処理だった
Message="デシリアライズに失敗しました"
ソース="System.Web.Services"
Actor="" Lang="en" Node=""
Role="" スタックトレース:
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
メッセージ、WebResponse 応答、ストリーム
responseStream、ブール asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName、Object[] パラメータ)
at SCM.Manager.mx.com.hylsamex.hmxwasd1.ZICQService.ZbcInsertRequest(String
Destino、ZtyEE070[]& EtRequestHeader、
ZtyEE071[]& EtRequestObj、Zclrqstdat
IClrqst、Zrequest[]& TRequest) で
D:\Documents and Settings\apacay\My
ドキュメント\Visual Studio
2005\プロジェクト\デサローロ
SCM\scm.manager\SCM.Manager\Web
References\mx.com.hylsamex.hmxwasd1\Reference.cs:85行目
at SCM.Manager.SAPDataMockUp.SendOTs() in
D:\Documents and Settings\apacay\My
ドキュメント\Visual Studio
2005\プロジェクト\デサローロ
SCM\scm.manager\SCM.Manager\SAPDataMockUp.cs:164行目
at SCM.Manager.Threads.HandleSap.Send()
D:\Documents and Settings\apacay\My にあります
ドキュメント\Visual Studio
2005\プロジェクト\デサローロ
SCM\scm.manager\SCM.Manager\Threads\HandleSap.cs:24行目
at SCM.Manager.Front.Main(String[] args)
D:\Documents and Settings\apacay\My にあります
ドキュメント\Visual Studio
2005\プロジェクト\デサローロ
SCM\scm.manager\SCM.Manager\Front.cs:170行目
at System.AppDomain._nExecuteAssembly(Assembly
アセンブリ、文字列 [] 引数)
at System.AppDomain.ExecuteAssembly(String
アセンブリファイル、証拠
assemblySecurity、String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext、ContextCallback
コールバック、オブジェクトの状態)
at System.Threading.ThreadHelper.ThreadStart()