Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Troubleshoot web services
Message
De
11/09/2007 17:55:51
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
01192616
Message ID:
01253799
Vues:
17
John - As you can see I did not get any replies to my question. This was so long ago I had forgotten about it. I eventually gave up and wrote the app using ASP. I was a pretty simply little thing to just provide readonly access to 3 tables. As I look at it now the problem may have had to do with the pathing or the permissions level on the server. I'd check those first.
- Don

>I know this is an old message, but I am having the same problem and wonder if DON or anyone else knows the answer to this question?
>
>Thanks in advance!
>
>John
>
>>I am trying to build my first web services app. Following the VFP instructions, I've written a server and client that work on my local network but do not work when tried over the internet. The code follows:
>>
>>
>>** Server code
>>
>>DEFINE CLASS Pag_Bid_Server AS Session OLEPUBLIC
>>****************************************************
>>   PROCEDURE CustomersInGermany AS String
>>      LOCAL loXMLAdapter AS XMLAdapter
>>      LOCAL lcXMLCustomers AS String
>>
>>      loXMLAdapter = CREATEOBJECT("XMLAdapter")
>>
>>      OPEN DATABASE "C:\Program Files\Microsoft Visual FoxPro 9\" ;
>>         + "Samples\Northwind\northwind.dbc"
>>
>>      USE customers
>>      SELECT * ;
>>         FROM customers ;
>>         WHERE country LIKE "Germany%" ;
>>         INTO CURSOR curCustomers
>>
>>      loXMLAdapter.AddTableSchema("curCustomers")
>>      loXMLAdapter.UTF8Encoded = .T.
>>      loXMLAdapter.ToXML("lcXMLCustomers")
>>
>>      CLOSE DATABASES ALL
>>
>>      RETURN lcXMLCustomers
>>   endproc
>>***********************************************************************
>>   procedure GetBids as String
>>      LOCAL loXMLAdapter AS XMLAdapter
>>      LOCAL lcXMLBids AS String
>>
>>      loXMLAdapter = CREATEOBJECT("XMLAdapter")
>>      OPEN DATABASE "D:\foxpro\bids\data\bidsdata.dbc"
>>      USE d:\foxpro\bids\data\bids
>>      SELECT * ;
>>         FROM bids ;
>>         where recno() < 20 ;
>>         INTO CURSOR crsBids
>>
>>      loXMLAdapter.AddTableSchema("crsBids")
>>      loXMLAdapter.UTF8Encoded = .T.
>>      loXMLAdapter.ToXML("lcXMLBids")
>>
>>      CLOSE databases ALL
>>
>>      RETURN lcXMLBids
>>   endproc
>>
>>ENDDEFINE
>>***********************************************
>>**Client code
>>LOCAL loPag_Bid_Server AS "XML Web Service"
>>* LOCAL loPag_Bid_Server AS "MSSOAP.SoapClient30"
>>* Do not remove or alter following line. It is used to support IntelliSense for your XML Web service.
>>*__VFPWSDef__: loPag_Bid_Server = http://TPD284/dwfWebServices/Pag_Bid_Server.wsdl , Pag_Bid_Server , Pag_Bid_ServerSoapPort
>>LOCAL loException, lcErrorMsg, loWSHandler
>>TRY
>>	loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
>>** NOTE: I also tried it without the pathing above
>>
>>	loPag_Bid_Server = loWSHandler.SetupClient("http://pag84.pagnet.org/dwfWebServices/Pag_Bid_Server.wsdl", "Pag_Bid_Server", "Pag_Bid_ServerSoapPort")
>>
>>	* Call your XML Web service here.  ex: leResult = loPag_Bid_Server.SomeMethod()
>>
>>LOCAL lcXML, lcAlias AS String
>>LOCAL loXMLAdapter AS XMLAdapter
>>
>>lcXML = loPag_Bid_Server.GetBids
>>
>>loXMLAdapter = CREATEOBJECT("XMLAdapter")
>>loXMLAdapter.LoadXML(lcXML)
>>
>>lcAlias = loXMLAdapter.Tables.Item(1).Alias
>>loXMLAdapter.Tables.Item(1).ToCursor()
>>
>>SELECT(lcAlias)
>>browse
>>
>>lcXML = loPag_Bid_Server.Customersingermany
>>
>>loXMLAdapter = CREATEOBJECT("XMLAdapter")
>>loXMLAdapter.LoadXML(lcXML)
>>
>>lcAlias = loXMLAdapter.Tables.Item(1).Alias
>>loXMLAdapter.Tables.Item(1).ToCursor()
>>
>>SELECT(lcAlias)
>>browse
>>CLOSE DATABASES ALL
>>	
>>CATCH TO loException
>>	lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message
>>	DO CASE
>>	CASE VARTYPE(loPag_Bid_Server)#"O"
>>		* Handle SOAP error connecting to web service
>>	CASE !EMPTY(loPag_Bid_Server.FaultCode)
>>		* Handle SOAP error calling method
>>		lcErrorMsg=lcErrorMsg+CHR(13)+loPag_Bid_Server.Detail
>>	OTHERWISE
>>		* Handle other error
>>	ENDCASE
>>	* Use for debugging purposes
>>	MESSAGEBOX(lcErrorMsg)
>>FINALLY
>>ENDTRY
>>
>>
>>I am able to read the XML schema (I think that's the right term) over the internet but attempts to run the client produce an error:
>>
>>Error 1429 - OLE IDISPATCH exception code 0 from Connector:Host not found HRESULT: 0x800A1521 - Client: An unanticipated error occured during the processing of this request. HRESULT: 0x800A1521....
>>
>>Any ideas on what I am missing?
>>Thanks
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform