0

I am new to ExtJS and I am a Flex Developer. I am trying to do a mockup of a page we have in our Flex App. I am trying to do a basic service call to hit our servers (on same domain as the ExtJS App) and add the data into Store, which will then be populated into our dataGrid.

I did the tutorial online, but now I am trying to modify it to use my services from our Flex App. I am able to make the service call, and get a success response; However, it looks like the response is what you get when you paste the URL in your browser (this is a WSDL).

It is not hitting the actual method in the service, and returning data. I did do a simple soapclient.js JS project and was able to get data using that tool, but I do not get data back using Ajax. I think I am doing something simple wrong, but cannot figure it out.

    Ext.define('DG.store.PhoneCalls', {

    extend: 'Ext.data.Store',

    model: 'DG.model.PhoneCall',

    autoLoad: true,



    proxy: {

    type: "ajax",

    dataType: 'xml',

    contentType: 'text/xml; charset=utf-8',

    data: '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">  <SOAP-ENV:Header>    <ns0:HeaderID xmlns:ns0="http://urlgoeshere.com/">      <ns0:string>thisisastring</ns0:string>    </ns0:HeaderID>  </SOAP-ENV:Header>  <SOAP-ENV:Body>    <tns:getRecaPayments xmlns:tns="http://urlgoeshere.com/">      <arg0>false</arg0>    </tns:getRecaPayments>  </SOAP-ENV:Body></SOAP-ENV:Envelope>',

    url: "https://urlgoeshere.com.com/Payments_UISupport_HTTPRouter/RecaCompFacadeService/RecaCompFacadeService.wsdl",

    reader: {

        type: 'xml',

        root: 'return',

        record: 'contents'

    },

    afterRequest:function(req, res) {

        console.log("Result: " + req.operation.response);

    }

}

});

When I debug, this is not hitting the method for this service. It returns the entire WSDL response that shows all of the methods available for that service.

In Flex, I have no issue. This app is on the same domain, so that is not the issue. I tried using soap in ExtJS and it didn't work either. I am sure it is a user error here! =)

All I need to do is:

  1. Call this service: https://urlgoeshere.com.com/Payments_UISupport_HTTPRouter/RecaCompFacadeService/RecaCompFacadeService.wsdl

  2. Pass in a false boolean

  3. Hit this method within that service: getRecaPayments

This service returns a bunch of data like this:

<return>
 <contents>
  <name>Joe</name>
  <ssn>111112222</ssn>
 </contents>
 <contents>
  <name>Bob</name>
  <ssn>222342222</ssn>
 </contents>
 <contents>
  <name>Jan</name>
  <ssn>555443333</ssn>
 </contents>
 </return>

Here is my model PhoneCall:

Ext.define('DG.model.PhoneCall', {
    extend: 'Ext.data.Model',
    fields: ['name', 'ssn']
});
anad2312
  • 787
  • 2
  • 8
  • 20
  • Could you put your **[DG.model.PhoneCall]** code, please? need more info. – mfruizs Jul 11 '13 at 09:03
  • @mfruizs2 I have updated the post to include the model. Let me know if you have any suggestions or anything to help out. I just want to make a simple web service call to that WSDL URL and call that method and pass in a false boolean and populate the result into the model and use that data in a dataGrid. Thanks for your help. – anad2312 Jul 11 '13 at 13:05
  • I know that my code makes the service call because I added a console log entry and the value shows as undefined: console.log("Result: " + req.operation.response); – anad2312 Jul 11 '13 at 13:07
  • I am not able to use the soap proxy because I purchased ExtJS, not Sencha Complete. I am confused as to why the soap proxy does not come with ExtJS, only with the Complete bundle. That is insane! I do not see the soap under src/data. – anad2312 Jul 11 '13 at 14:51
  • comment/erase "data: <..>" params from Proxy. It's the unique different that I see atm. – mfruizs Jul 12 '13 at 09:45
  • @mfruizs2 Didn't work either... Not sure why it seems so difficult to make a SOAP call in ExtJS. – anad2312 Jul 12 '13 at 19:29
  • try adding **** on xml header response. – mfruizs Jul 15 '13 at 11:49
  • 1
    @mfruizs2 Still didn't work. I ended up not using the Ajax ExtJS code and in the controller I used the JS SOAP Client http://javascriptsoapclient.codeplex.com and then loaded the raw data into the store. This is def not the correct way of doing it, but I couldn't figure out how to get the ExtJS Ajax call to work. I believe the JS SOAP Client just extends the Ajax stuff. It is easy to use and I do not need to build a SOAP XML parameter. I just pass the end point and the method to hit and it works. – anad2312 Aug 02 '13 at 13:31

1 Answers1

0

Just did some research - and found the two required SOAP classes within the docs.

These files are indeed not contained within the src/data/soap directory...

http://docs.sencha.com/extjs/4.2.2/source/Proxy3.html http://docs.sencha.com/extjs/4.2.2/source/Reader3.html#Ext-data-soap-Reader

Here it's explained in detail, better than I ever could:

http://docs.sencha.com/extjs/4.2.2/#/guide/soap

Martin Zeitler
  • 1
  • 19
  • 155
  • 216