Guest User

Untitled

a guest
Jun 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <xs:element name="CheckDomain">
  2. <xs:complexType>
  3. <xs:sequence>
  4. <xs:element name="domain" type="domainRef"/>
  5. <xs:element name="suggestions" type="xs:boolean" default="false" minOccurs="0"/>
  6. </xs:sequence>
  7. </xs:complexType>
  8. </xs:element>
  9.  
  10. <CheckDomain xmlns="...">
  11. <domainRef>...</domainRef>
  12. <suggestions>true</suggestions> <!-- or it could be "false" -->
  13. </CheckDomain>
  14.  
  15. use strict;
  16. use LWP::UserAgent;
  17. use HTTP::Request;
  18.  
  19. my $message = "<?xml version="1.0" encoding="utf-8"?>
  20. <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  21. xmlns:ecn="http://www.alcatel.com/ecn_csa/EcnServices.wsdl">
  22. <soapenv:Body>
  23. <ecn:GetBusinessAccount>
  24. <accountNumber>$number</accountNumber>
  25. </ecn:GetBusinessAccount>
  26. </soapenv:Body>
  27. </soapenv:Envelope>";
  28. my $userAgent = LWP::UserAgent->new();
  29. my $request = HTTP::Request->new(POST => 'http://server:port/endpoint');
  30. # $request->header(SOAPAction => '""'); #use it if required
  31. $request->content($message);
  32. $request->content_type("text/xml; charset=utf-8");
  33. my $response = $userAgent->request($request);
  34. # $response->code == 200
  35. print $response->as_string;
Add Comment
Please, Sign In to add comment