Results 1 to 4 of 4

Thread: Object not set to reference bij

  1. #1
    Senior Member xsintill's Avatar
    Join Date
    Aug 2002
    Location
    Rotterdam
    Posts
    1,075

    Object not set to reference bij

    ik heb een webservice welke manueel correcte resultaten laten zien als ik via Internet explorer naar de webservice ga en vervolgens het webform invul en een invoke geef.

    Als ik in delphi 6 de webservice importeer en uitvoer krijg ik een foutmelding.
    Dit heb ik in delphi code

    interface:
    delphi Code:
    1. GetConnectorSoap = interface(IInvokable)
    2.   ['{89EB0994-6689-CC59-E572-D749D106864C}']
    3.     function  GetData(const environmentId: String; const userId: String; const password: String; const logonAs: String; const connectorId: String; const filtersXml: String): String; stdcall;
    4.     function  GetDataCollection(const environmentId: String; const userId: String; const password: String; const logonAs: String; const getConnectorsXml: String): String; stdcall;
    5.   end;
    6.  
    7. function GetGetConnectorSoap(UseWSDL: Boolean=System.False; Addr: string=''): GetConnectorSoap;

    delphi Code:
    1. memo1.lines.text := GetGetConnectorSoap.GetData('ERPDemo', '', '', '', 'ProfitCountries', '');

    ik krijg de volgende foutmelding:
    Project Project1.exe raised exception class ERemotableException with message 'Server was unable to process request. ---> Object reference not set to an instance of an object.'

    heeft iemand een idee wat ik fout doe.

  2. #2
    Counting your refs Paul-Jan's Avatar
    Join Date
    Feb 2002
    Location
    Lage Zwaluwe
    Posts
    2,160
    Ik zou zeggen: start Fiddler op en kijk naar het verschil in de soap XML die over het lijntje gaat.

    In de webservice is "iets" nil, maar of dat rechtstreeks een parameter van de soap call betreft, of er gewoon een ander stuk functionaliteit is dat nogal moeite heeft met hetgeen binnenkomt, is niet te zeggen. Een erg nette foutmelding is het in ieder geval niet.

  3. #3
    De WSDL importer doet niet altijd even goed zijn best, je moet handmatig een regel toevoegen om de parameters naar je webservice te laten verzenden.

    Zie deze post.
    Marcel

  4. #4
    Senior Member xsintill's Avatar
    Join Date
    Aug 2002
    Location
    Rotterdam
    Posts
    1,075
    dank je wel marcel
    door de regel in de wsdl import unit in de initialization te zetten als laatste regel met somesoap vervangen door de interface naam werkt het nu wel

    delphi Code:
    1. unit getConnector;
    2.  
    3. interface
    4.  
    5. uses InvokeRegistry, Types, XSBuiltIns;
    6.  
    7. type
    8.   GetConnectorSoap = interface(IInvokable)
    9.   ['{89EB0994-6689-CC59-E572-D749D106864C}']
    10.     function  GetData(const environmentId: String; const userId: String; const password: String; const logonAs: String; const connectorId: String; const filtersXml: String): String; stdcall;
    11.     function  GetDataCollection(const environmentId: String; const userId: String; const password: String; const logonAs: String; const getConnectorsXml: String): String; stdcall;
    12.   end;
    13. ...
    14. initialization
    15.   InvRegistry.RegisterInterface(TypeInfo(GetConnectorSoap), 'urn:Afas.Profit.Services', 'utf-8');
    16.   InvRegistry.RegisterDefaultSOAPAction(TypeInfo(GetConnectorSoap), 'urn:Afas.Profit.Services/%operationName%');
    17.   InvRegistry.RegisterInvokeOptions(TypeInfo(GetConnectorSoap), ioDocument);

    paul-jan bedanktvoor de fiddler2 tip

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •