Written by

Question Mohan Sujay · Nov 9, 2016

access php

Hi,

How to post and get data using php. I'm using a php external url. In the body in parsing the request as xml and when i execute this using fiddler it response the result as xml but when i consume it in classmethod it fails. I don't have a wsdl file how can i work it out?

My class method is
Example: :http://xyz.com/req/data.php

ClassMethod postData(Object As %VarString) As %VarString
{
  s server="http://xyz.com" 
  s path="/req/data.php"
  s data=$zcvt(Object,"O","URL")
  s http=##class(%Net.HttpRequest).%New()
  s http.Server=server
  s http.Port=80
  s http.ContentType="text/plain"  
  d http.InsertFormData("Request",Object)
  d http.Post(path)
  d $SYSTEM.OBJ.Dump(http.HttpResponse)
  s resp=http.HttpResponse.Data
  s response=resp.Read()
  QUIT response
}

Comments

Dmitry Maslennikov · Nov 9, 2016

It doesn't matter what you have on server side you connect for. 

And it does not work, just because this server did not get what it is expected. And you should know exactly what it expect, you can update your post and add some examples from fiddler, so we can see what you want to achieve with Caché.

0
Mohan Sujay  Nov 9, 2016 to Dmitry Maslennikov

hi,

My code returns empty data

0