Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Consuming Web Services

Status
Not open for further replies.

WalterJolon

Programmer
Jul 22, 2004
23
GT
Hi, I'm trying to send XML data but I'm having troubles, I'm using This code:

LOCAL loService1 AS "XML Web Service"
LOCAL loException, lcErrorMsg, loWSHandler

TRY
vXML = "<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi=" xmlns:xsd=" xmlns:soap=" <soap:Body>
<procesaCURGastos xmlns=" <xml>string</xml>
</procesaCURGastos>
</soap:Body>
</soap:Envelope>"

loWSHandler = NEWOBJECT("WSHandler",IIF(VERSION(2)=0,"",HOME()+"FFC\")+"_ws3client.vcx")
loService1 = loWSHandler.SetupClient(" "Service1", "Service1Soap")

vResp = loService1.procesaCURGastos(vXML)

CATCH TO loException
lcErrorMsg="Error: "+TRANSFORM(loException.Errorno)+" - "+loException.Message
DO CASE
CASE VARTYPE(loService1)#"O"
* Handle SOAP error connecting to web service
CASE !EMPTY(loService1.FaultCode)
* Handle SOAP error calling method
lcErrorMsg=lcErrorMsg+CHR(13)+loService1.Detail
OTHERWISE
* Handle other error
ENDCASE
* Use for debugging purposes
MESSAGEBOX(lcErrorMsg)
FINALLY
ENDTRY

This is the message that i'm getting

Error: 1429 - OLE IDispatch exception code 0 from Connector: Connector:Connection time out. HRESULT=0x800A1527 - Client:An unanticipated error occurred during the processing of this request. HRESULT=0x800A1527 - Client:Sending the Soap message failed or no recognizable response was received HRESULT=0x800A1527 - Client:Unspecified client error. HRESULT=0x800A1527..
Connector:Connection time out. HRESULT=0x800A1527 - Client:An unanticipated error occurred during the processing of this request. HRESULT=0x800A1527 - Client:Sending the Soap message failed or no recognizable response was received HRESULT=0x800A1527 - Client:Unspecified client error. HRESULT=0x800A1527



If someone knows what I'm doing wrong, please, tell me!

Walter Geovanny Jolon Ruiz
Guatemala, C.A.
 
This type of thing is usually simpler than it looks. If the procesaCURGastos method is looking for a single element <XML> then just send that to it:

vXML = "<XML>string</XML>"

...you probably don't need to wrap it up in a SOAP envelope like that.

boyd.gif

 
I think your xml string is not formated correctly. Try

Code:
   vXML = [<?xml version="1.0" encoding="utf-8"?>] + ;
[<soap:Envelope xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/">[/URL]] +;
  [<soap:Body>+ ;
    [<procesaCURGastos xmlns="[URL unfurl="true"]http://tempuri.org/SIAFProxyWS/Service1">+[/URL] ;
      [<xml>string</xml>+ ;
    [</procesaCURGastos>+ ;
  [</soap:Body>] + ;
[</soap:Envelope>]

Jean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top