cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
hogi
Level XII

HTTP Request (XML)

I want to send a XML based HTTP Request via SOAP to a web server.

Can I do this in Jmp?

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: HTTP Request (XML)

Haven't used SOAP but isn't it basically sending XML? Might have to tinker a bit with headers but this seemed to work

Names Default To Here(1);

request = New HTTP Request(
	URL("https://www.dataaccess.com/webservicesserver/NumberConversion.wso"),
	Method("POST"),
	Headers({"Content-Type: text/xml; charset=utf-8"}),
	Text(
"\[<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <NumberToWords xmlns="http://www.dataaccess.com/webservicesserver/">
      <ubiNum>500</ubiNum>
    </NumberToWords>
  </soap:Body>
</soap:Envelope>]\"
	)
);
data = request << Send;
Open(Char To Blob(data), "xml");

https://documenter.getpostman.com/view/8854915/Szf26WHn https://www.dataaccess.com/webservicesserver/NumberConversion.wso

-Jarmo

View solution in original post

5 REPLIES 5
jthi
Super User

Re: HTTP Request (XML)

Haven't used SOAP but isn't it basically sending XML? Might have to tinker a bit with headers but this seemed to work

Names Default To Here(1);

request = New HTTP Request(
	URL("https://www.dataaccess.com/webservicesserver/NumberConversion.wso"),
	Method("POST"),
	Headers({"Content-Type: text/xml; charset=utf-8"}),
	Text(
"\[<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <NumberToWords xmlns="http://www.dataaccess.com/webservicesserver/">
      <ubiNum>500</ubiNum>
    </NumberToWords>
  </soap:Body>
</soap:Envelope>]\"
	)
);
data = request << Send;
Open(Char To Blob(data), "xml");

https://documenter.getpostman.com/view/8854915/Szf26WHn https://www.dataaccess.com/webservicesserver/NumberConversion.wso

-Jarmo
hogi
Level XII

Re: HTTP Request (XML)

Thanks @jthi 
wonderful

 

New HTTP Request( Text () ??

 

 hogi_1-1689351443513.png

 

hogi_0-1689351397163.png

It is too often that I stop here ...

 

What to do instead:

hogi_4-1689351725086.png

hogi
Level XII

Re: HTTP Request (XML)

or even:

hogi_0-1689356382544.png

 

jthi
Super User

Re: HTTP Request (XML)

Using XML didn't work for me when using that endpoint so I did use Text and then modified headers to get it working.

-Jarmo
hogi
Level XII

Re: HTTP Request (XML)

Seems that they fixed it - On my System (v17.1) it also works with XML(...)

Is there some explanation about the differences between Text and XML?

It could make a difference for 

is valid()

But I just checked it by destroying the XML syntax a bit and it was still "valid" for the xml(...) case ...
So, actually I don't know what is checked by IsValid()