5 Replies Latest reply on Jan 16, 2008 8:37 PM by Mully74

    Webservice issue

    Rahul Mainkar
      Hello people,
      Recently I got a very tricky problem to deal with. I have a web service which accepts few parameters and an array of objects. Web service is working perfectly fine as we have tested it with some tools.
      Now when I execute my flex application, I get a strange error which I am not able to solve for a long time.
      Error is:
      faultCode:EncodingError faultString:'Cannot find definition for type 'urn:com.ebg.challanparking.ejbs::GetPoItemList'' faultDetail:'null'

      As I guess, my flex application is not able to resolve the name space or it is not getting the correct definition for the Class GetPoItemList.
      I tried putting name spaces into <mx:request> tag but still no luck.

      My question is, how do I resolve this issue and Why is this application not able to recognize the class definition.
      Following is the code snippet
      <mx:WebService id="wsPOGetDetails" showBusyCursor="true" makeObjectsBindable="true"
      wsdl="some wsdl">
      <mx:operation name="getChallanParking" resultFormat="xml" result="wsPOGetDetailsresult(event)"
      fault="handleFault(event)">
      <mx:request >
      <param1></param1>
      <param2></param2>
      <arrayParam></arrayParam>

      </mx:request>
      </mx:operation>
      </mx:WebService>
      I also checked in the WSDL, it has all the necessary details and this class type is present in the schema.
      Any reply will be highly appreciated
      Thanks in advance

      Rahul
        • 1. Re: Webservice issue
          mae@ccg
          Did you try:

          <mx:request xmlns=" http://ejbs.challanparking.ebg.com">

          or something similiar?
          • 2. Re: Webservice issue
            Rahul Mainkar Level 1
            Yes I tried to put in a urn something like this

            <mx:request xmlns:ns1="urn:ws_challanParking_ebgVi" xmlns:pns="urn:com.ebg.challanparking.ejbs">
            <ebeln>0003001012</ebeln>
            <lfdat>2007-12-31T10:14:32.218Z</lfdat>
            <lfuhr>2007-12-31T10:14:32.218Z</lfuhr>
            <lifnr>ABC</lifnr>
            <verur>123456</verur>
            <ns1:challan_items>
            <pns:calculatedCenvat>0</pns:calculatedCenvat>
            <pns:cenvatAmount>33</pns:cenvatAmount>
            <pns:ebelp>00010</pns:ebelp>
            <pns:lfimg>0</pns:lfimg>
            <pns:maktx></pns:maktx>
            <pns:matnr></pns:matnr>
            <pns:poQty>0</pns:poQty>
            <pns:qtyDelv>40</pns:qtyDelv>
            <pns:vrkme></pns:vrkme>

            </ns1:challan_items>

            </mx:request>

            but it gives error
            Error #1009: Cannot access a property or method of a null object reference." faultCode="EncodingError" faultDetail="null"]

            Please Help !!!
            • 3. Re: Webservice issue
              Mully74
              If it makes you feel better - I have the same cr@ppy problem. Wierd thing is, it works sweetly for about 10 other web service calls I have so I'm now doing a very close comparision of the WSDL and schema types. I'm doing nothing different for these calls, altho I suspect passing xs:dateTime might be screwing it. Might take dateTime out of request and try again. I get this in debug output:

              [RPC Fault faultString="Error #1009: Cannot access a property or method of a null object reference." faultCode="EncodingError" faultDetail="null"]
              at mx.rpc.soap::Operation/ http://www.adobe.com/2006/flex/mx/internal::invokePendingCall()[C:\dev\enterprise_bali\fra meworks\mx\rpc\soap\Operation.as:582
              at mx.rpc.soap::Operation/send()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\Operation.as: 492]
              at Function/ http://adobe.com/AS3/2006/builtin::apply()
              at mx.rpc.soap.mxml::Operation/send()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\mxml\Ope ration.as:140]
              at com.accountable.components.accountsignoff::ACCBalanceIssuesDialog/saveIssueClick()[C:\1Ec countability\workspace\FlexAcc\com\accountable\components\accountsignoff\ACCBalanceIssuesD ialog.mxml:188]
              at com.accountable.components.accountsignoff::ACCBalanceIssuesDialog/__saveIssue_click()[C:\ 1Eccountability\workspace\FlexAcc\com\accountable\components\accountsignoff\ACCBalanceIssu esDialog.mxml:332]

              Which would indicate a problem in Flex code so they just bundle up a nice generic fault and return it to ya. AWESOME HUH?!

              Anyone else got this?
              • 4. Re: Webservice issue
                Mully74 Level 1
                If it makes you feel better - I have the same cr@ppy problem. Wierd thing is, it works sweetly for about 10 other web service calls I have so I'm now doing a very close comparision of the WSDL and schema types. I'm doing nothing different for these calls, altho I suspect passing xs:dateTime might be screwing it. Might take dateTime out of request and try again. I get this in debug output:

                [RPC Fault faultString="Error #1009: Cannot access a property or method of a null object reference." faultCode="EncodingError" faultDetail="null"]
                at mx.rpc.soap::Operation/ http://www.adobe.com/2006/flex/mx/internal::invokePendingCall()[C:\dev\enterprise_bali\fra meworks\mx\rpc\soap\Operation.as:582
                at mx.rpc.soap::Operation/send()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\Operation.as: 492]
                at Function/ http://adobe.com/AS3/2006/builtin::apply()
                at mx.rpc.soap.mxml::Operation/send()[C:\dev\enterprise_bali\frameworks\mx\rpc\soap\mxml\Ope ration.as:140]
                at com.accountable.components.accountsignoff::ACCBalanceIssuesDialog/saveIssueClick()[C:\1Ec countability\workspace\FlexAcc\com\accountable\components\accountsignoff\ACCBalanceIssuesD ialog.mxml:188]
                at com.accountable.components.accountsignoff::ACCBalanceIssuesDialog/__saveIssue_click()[C:\ 1Eccountability\workspace\FlexAcc\com\accountable\components\accountsignoff\ACCBalanceIssu esDialog.mxml:332]


                Which might indicate a problem in Flex "Operation.as" so I assume they're bundling up a nice generic fault and returning it. AWESOME!

                Anyone else got this?
                • 5. Re: Webservice issue
                  Mully74 Level 1
                  Hi Rahul,

                  As expected, it was the xs:dateTime letting me down. In my request I was setting it as a "String" object, for example: 2008-01-17T14:52:55.662+11:00.

                  NOTE: My scenario is slightly different to yours in that I'm "binding" my request parameters i.e. not using raw XML in the operation's <mx:request>. However, be wary of the dates. Flex may check against the WSDL's schema types(at runtime) and throw an error when it finds a String in an inconsistent format to xs:dateTime. Yours look okay though.

                  Make sure you specify format="xml" in the <mx:request> tag. Check out the second example here:

                  http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=dataservices_099_13.html

                  Hope this helps.