SOAP & eTapestry?

Questions, tips and tricks and techniques for scripting in Servoy

SOAP & eTapestry?

Postby bobcusick1332964082 » Wed Sep 11, 2013 10:54 pm

It's been a really long time since I've done SOAP (like a really long time)... and judging from the previous posts here - it's been a long time for a lot of people... :D

I've been bumping my head into an absolute wall trying to get the login stuff to work for eTapestry XML API via SOAP.

If you're curious - the spec is here: https://www.blackbaudhq.com/files/etapestry/api/basics.html

If there is anyone out there that has connected to eTapestry via Servoy - or if there are any SOAP gurus out there - any help would be GREATLY appreciated! :oops:
bobcusick1332964082
 
Posts: 85
Joined: Wed Mar 28, 2012 9:48 pm

Re: SOAP & eTapestry?

Postby Adelo Herrero » Thu Sep 12, 2013 10:29 am

Hi:

What is the problem? the xml request? the functions names? the post connection?

Best regards.

Note: I am not any soap guru; only curious ;-)
Adelo Herrero
Adelo Herrero
 
Posts: 103
Joined: Sat Jul 25, 2009 9:24 pm
Location: Requena (Valencia) España

Re: SOAP & eTapestry?

Postby bobcusick1332964082 » Thu Sep 12, 2013 7:41 pm

The issue is that the server keeps just returning an 500 error complaining about creating an "envelope":

Code: Select all
Internal Server Error (caught exception while handling request: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source: )
bobcusick1332964082
 
Posts: 85
Joined: Wed Mar 28, 2012 9:48 pm

Re: SOAP & eTapestry?

Postby Adelo Herrero » Fri Sep 13, 2013 11:24 am

Hello:

With this code the server return: status = 200, and xml response. I used the function "ping" of api.

Code: Select all
function testEtapestry(event) {
   var szUrl = "https://sna.etapestry.com/v2messaging/service?WSDL";
   var szXML = '<?xml version="1.0" encoding="UTF-8"?>' + "\n" ;
   szXML += '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="etapestryAPI/service">' + "\n" ;
   szXML += '   <soapenv:Header/>' + "\n" ;
   szXML += '   <soapenv:Body>' + "\n" ;
   szXML += '      <ser:pingOkay soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>' + "\n" ;
   szXML += '   </soapenv:Body>' + "\n" ;
   szXML += '</soapenv:Envelope>'   

   var client = plugins.http.createNewHttpClient()
   var request = client.createPostRequest(szUrl);
   
   request.addHeader("Content-Type", "text/xml; charset=utf-8");
   request.addHeader("Host","sna.etapestry.com");
   
   request.addParameter(null, szXML);
   var response = null;
   var objResponse = request.executeRequest();
   if (objResponse != null) {
      response = objResponse.getResponseBody();
      var statusCode = objResponse.getStatusCode();
      application.output(statusCode + "\n" + response);
   }
   else {
      application.output("No se ha conectado");
   }
}


Hope this help.
Adelo Herrero
Adelo Herrero
 
Posts: 103
Joined: Sat Jul 25, 2009 9:24 pm
Location: Requena (Valencia) España

Re: SOAP & eTapestry?

Postby bobcusick1332964082 » Fri Sep 13, 2013 2:36 pm

Adelo,

WOW! :shock:

THANK YOU SO VERY MUCH! This will get me on the right track!

I owe you several beers, my friend! :D

Bob
bobcusick1332964082
 
Posts: 85
Joined: Wed Mar 28, 2012 9:48 pm

Re: SOAP & eTapestry?

Postby Adelo Herrero » Fri Sep 13, 2013 3:30 pm

I'm happy to help you :)

Best regards.
Adelo Herrero
Adelo Herrero
 
Posts: 103
Joined: Sat Jul 25, 2009 9:24 pm
Location: Requena (Valencia) España

Re: SOAP & eTapestry?

Postby david » Mon Sep 16, 2013 6:27 pm

I'd be interested in the code that gets this working when you get it figured out. Adelo's code is the typical approach that should work. However — as with most SOAP services — the devil is in the details and eTapestry's version seems to have a few of those.
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Re: SOAP & eTapestry?

Postby bobcusick1332964082 » Wed Sep 18, 2013 8:41 pm

The sort answer is: SOAP SUCKS.

I've tried and tried with LOTS of variations on this code - but still couldn't even get the login to work:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:enc=http://schemas.xmlsoap.org/soap/encoding/ xmlns:ns0="etapestryAPI/service" xmlns:ns1="http://java.sun.com/jax-rpc-ri/internal">
<env:Header/>
<env:Body>
<login>
      <loginId>"myLoginEmail"</loginId>
      <password>"myPassword"</password>
</login>
</env:Body
</env:Envelope>



On the FLIP side of "SUCK" is the DonorPerfect XML API (restful): http://www.donorperfect.com/XML-API

It will even let you do SQL Queries (including joins, updates, etc!) Those DonorPerfect people GOT IT RIGHT. It was an absolute SNAP to get it working flawlessly (under 5 minutes). I've spent a few DAYS monkeying around with this SOAP crap!
bobcusick1332964082
 
Posts: 85
Joined: Wed Mar 28, 2012 9:48 pm


Return to Methods

Who is online

Users browsing this forum: No registered users and 10 guests