1

Maximo Query Web サービスからの Maximo 応答を処理する方法を知っている人はいますか?

WONUMMaximo からデータセットの応答を取得できますが、作業指示属性 (例など)を取得しようとするとSITEID、すべての属性が として返されnullます。

以下は私が使用しているコードです。

       MXWO_WORKORDERType wo_add = new MXWO_WORKORDERType();

        MXWO_WORKORDERType[] wo_results;

        DateTime creationDateTime = new DateTime();
        bool creationDateTimeSpecified = false;
        string language = "NoDef";
        string transLanguage = "NoDef";
        string messageID = "NoDef";
        string maximoVersion = "NoDef";
        bool uniqueResult = false;
        string maxItems = "10000";
        string rsStart = "0";
        string rsCount = "NoDef";
        string rsTotal = "NoDef";

        MXStringType mxstringStID = new MXStringType();
        MXStringType mxstringstatus = new MXStringType();
        MXStringType mxstringwonum = new MXStringType();



        // create query from string 
        MXWOQueryType query = new MXWOQueryType();

        query.WHERE = ("SITEID = 'ABC' AND STATUS='WAPPR'");



         MXWOPortTypeClient c = new MXWOPortTypeClient("MXWOSOAP1Port");



        // perform query 


        MXWO_WORKORDERType[] returnedWOs = c.QueryMXWO(query, ref creationDateTime, ref language, ref transLanguage, ref messageID, ref maximoVersion, uniqueResult, maxItems, ref rsStart, out rsCount, out rsTotal);            

       MXWO_WORKORDERType wo = null;



       for (int i = 0; i < returnedWOs.Length; i++)
       {



           mxstringwonum.Value = returnedWOs[i].WONUM.Value;

           wo.WONUM = mxstringwonum;


           MessageBox.Show(mxstringwonum.Value);



       }
4

2 に答える 2

1

ありがとうシュレイウス。あなたのコードと他の記事のコードを微調整して、機能させました。以下は最終的なコードです。ご返信/ご協力ありがとうございます。

        DateTime creationDateTime = new DateTime();
        bool creationDateTimeSpecified = false;
        string language = "NoDef";
        string transLanguage = "NoDef";
        string messageID = "NoDef";
        string maximoVersion = "NoDef";
        bool uniqueResult = false;
        string maxItems = "10000";
        string rsStart = "0";
        string rsCount = "NoDef";
        string rsTotal = "NoDef";

        MXStringType mxstringStID = new MXStringType();
        MXStringType mxstringwonum = new MXStringType();
        MXStringType mxDescription = new MXStringType();


        Uri serviceUri = new Uri("http://maximourl/meaweb/services/testservice");           
        BasicHttpBinding serviceBinding = new BasicHttpBinding();
        EndpointAddress EndPoint = new EndpointAddress(serviceUri);

        ChannelFactory<MXWOPortTypeChannel> channelFactory = new ChannelFactory<MXWOPortTypeChannel>(serviceBinding, EndPoint);

        //Create a channel 
        MXWOPortTypeChannel channel = channelFactory.CreateChannel();

        channel.Open();

        MXWOQueryType query1 = new MXWOQueryType();

        query1.WHERE = ("SITEID = 'ABC' AND STATUS='APPR'");


        QueryMXWOResponse resp1 = new QueryMXWOResponse();



        QueryMXWORequest creq = new QueryMXWORequest();

        creq.baseLanguage = language;
        //creq.creationDateTime = creationDateTime;
        creq.maximoVersion = maximoVersion;
        creq.transLanguage = transLanguage;
        creq.messageID = messageID;
        creq.rsStart = rsStart;
        creq.maxItems = maxItems;
        creq.uniqueResult = uniqueResult;

        creq.MXWOQuery = query1;


        resp1 = channel.QueryMXWO(creq);

        MXWO_WORKORDERType[] results = resp1.MXWOSet;



        for (int i = 0; i < results.Length; i++)
        {

            MXWO_WORKORDERType wt = results[i];

            mxstringwonum.Value = results[i].WONUM.Value;
            wt.WONUM.Value = mxstringwonum.Value;

            mxDescription.Value = results[i].DESCRIPTION.Value;
            wt.DESCRIPTION.Value = mxDescription.Value;

            mxstringStID.Value = results[i].SITEID.Value;
            wt.SITEID.Value = mxstringStID.Value;


           MessageBox.Show(mxstringStID.Value + " -- " + mxstringwonum.Value + " -- " + mxDescription.Value);

      }
于 2013-11-15T16:19:32.050 に答える