sending xml file to web service using sendfile method and php

Go To StackoverFlow.com

1

I need to send a file to a web service (ebridge) using their SendFile method. This may be too specific to their service for anyone to answer, but I thought I'd give it a try. This is the only documentation I can find regarding the SendFile method:

Purpose
This method is used to submit data for processing by ePortal.
Input parameters
Login (string) The ePortal userID.
Password (string) The ePortal password for that user.
Content (string) This is the document to be uploaded.
Filename (string) This is the name of the file with no path information.
Return Value
SendFileResult (boolean) The boolean return value represents success or failure of the submission of a document.

Here is their sample xml code for posting:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
<SendFile xmlns="eBridge.WebServices">
  <login>mylogin</login>
  <password>mypassword</password>
  <content>string</content>
  <filename>string</filename>
</SendFile>
  </soap:Body>
</soap:Envelope>

I am also given a sample of the file (ASN.xml) that I am supposed to send. I've tried putting the xml from this file in between the content tags and just putting "test.xml" in the filename tags. That doesn't work. I know I am making a connection because if I leave it just like it is above I will get a response back, it just returns false since I didn't send anything. Perhaps I am misunderstanding what they want in content and filename? Does anyone have any ideas what I am supposed to do with this?

clarification: What I am wondering is if the xml file goes into 'content' as a string, then what is 'filename' for? Is it actually looking for a file or is this just a name that gets assigned to something later?

2012-04-04 23:14
by xena


0

Ummm, are you creating a SOAPClient? That xml file is actually the body of a SOAP request and that is encapsulated by the SOAPClient class in PHP.

For the WSDL file: https://www.ebridgeservices.com/ePortalService.asmx?WSDL Use the SOAPClient Class to build your request to their services. Use $soapReq->SendFile({args and blah here})

and if you don't like the PHP Manual: Here's an example/tutorial.

2012-04-04 23:35
by Norm
I certainly hope the OP is using SOAPClient (or some equivalent). But I understood the question to mean "what exactly should go into "SendFile()"? And my answer remains "I think it should be the contents of the XML file ... but ask the nice folks at ebridgeservices.com to be sure". IMHO.. - paulsm4 2012-04-05 01:32
Yeah, the question isn't clear - Norm 2012-04-05 13:23
I originally planned on using SOAPClient, but I got an error saying the connection wasn't secure, even though I was using a https url. I asked the people at ebridge and they just said they couldn't help me with any php issues. My confusion is if the contents of the document goes into 'content' then what is the purpose of having 'filename'? Do they use the content from the string to create a file then give it the name you provide? Or is it actually looking for a file with that name? When I put the xml file as a string into content and provide test.xml for the filename, nothing is returned - xena 2012-04-05 15:46


0

Their web page has a "live chat". Why don't you ask them?

http://www.ebridgeconnections.com/support/development-kit/API-services.html

But I believe <content> means exactly that: you're supposed to include the entire XML file - as a string - in the SOAP message.

IMHO...

2012-04-04 23:18
by paulsm4
After several attempts I got through on their "live" chat. They told me to post in their forum, which I've already tried, still waiting. : - xena 2012-04-05 18:46
Ads