Transferring files (PDFs) using SOAP and creating the WSDL

alcaeus

New Member
I've got an application that accepts incoming PDFs, adds a page and signs the PDF, and then returns the new document to the requesting service. The app works fine, but now I need to create a SOAP interface and a WSDL to describe the service. I can handle the SOAP interface, but creating the WSDL is not so easy and there seems to be alot of disagreement about how to do it.I'm using WSDL 1.2/2.0, and I need to determine how to define the 'type' of the incoming and outgoing PDFs. Would they be strings? Would they be type="xs:base64Binary"? I would assume they would be some form of complex type, and would required certain operation or interface definitions, but I can't find anywhere but here that deals with binary file types.This is the WSDL I've got so far for simple user authentication used before the file is uploaded:<?xml version="1.0" encoding="utf-8" ?><description xmlns="http://www.w3.org/ns/wsdl" targetNamespace= "http://example.com/some.xml" xmlns:tns= "http://example.com/some.xml" xmlns:ghns = "http://example.com/some.xml" xmlns:wsoap= "http://www.w3.org/ns/wsdl/soap" xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wsdlx= "http://www.w3.org/ns/wsdl-extensions"> <documentation> This document describes the eSignature service. </documentation> <types> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.com/some.xml" xmlns="http://example.com/some.wsdl"> <xs:element name="userAuthenticate" type="tUserAuthenticate"/> <xs:complexType name="tUserAuthenticate"> <xs:sequence> <xs:element name="userName" type="xs:string"/> <xs:element name="userKey" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:element name="userAuthenticateResponse" type="xs:string"/> <xs:element name="invalidDataError" type="xs:string"/> </xs:schema> </types> <interface name = "eSignatureInterface" > <fault name = "invalidDataFault" element = "ghns:invalidDataError"/> <operation name="opUserAuthenticate" pattern="http://www.w3.org/ns/wsdl/in-out" style="http://www.w3.org/ns/wsdl/style/iri" wsdlx:safe = "true"> <input messageLabel="In" element="ghns:userAuthenticate" /> <output messageLabel="Out" element="ghns:userAuthenticateResponse" /> <outfault ref="tns:invalidDataFault" messageLabel="Out"/> </operation> </interface> <binding name="userAuthSOAPBinding" interface="tns:userAuthInterface" type="http://www.w3.org/ns/wsdl/soap" wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/"> <fault ref="tns:invalidDataFault" wsoap:code="soap:Sender"/> <operation ref="tns:opUserAuthenticate" wsoap:mep="http://www.w3.org/2003/05/soap/mep/soap-response"/> </binding> <service name="eSignatureService" interface="tns:eSignatureInterface"> <endpoint name="userAuthEndpoint" binding="tns:userAuthSOAPBinding" address ="http://example.com/eSig"/> </service></description>
 
Back
Top