API gateway for REST and SOAP written in Java.

Overview

Membrane Service Proxy

GitHub release Hex.pm

Reverse HTTP proxy (framework) written in Java, that can be used

  • as an API gateway
  • as a security proxy
  • for HTTP based integration
  • as a WebSockets and STOMP router

Get Started

Download the binary.

Unpack.

Start service-proxy.sh or service-proxy.bat.

Have a look at the main configuration file conf/proxies.xml. Changes to this file are instantly deployed.

Run the samples in the examples folder, follow the REST or SOAP tutorials, see the Documentation or the FAQ.

Samples

REST

Routing requests from localhost:80 to localhost:8080 :

<serviceProxy port="80">
    <target host="localhost" port="8080" />
serviceProxy>

Routing only requests with path /foo :

<serviceProxy port="80">
    <path>/foopath>
    <target host="localhost" port="8080" />
serviceProxy>

SOAP

SOAP proxies configure themselves by analysing WSDL:

<soapProxy wsdl="http://thomas-bayer.com/axis2/services/BLZService?wsdl">
soapProxy>

Add features like logging or XML Schema validation against a WSDL document:

<soapProxy wsdl="http://thomas-bayer.com/axis2/services/BLZService?wsdl">
	<validator />
	<log />
soapProxy>

Limit the number of requests in a given time frame:

<serviceProxy port="80">
    <rateLimiter requestLimit="3" requestLimitDuration="PT30S"/>
    <target host="localhost" port="8080" />
serviceProxy>

Rewrite URLs:

<serviceProxy port="2000">
    <rewriter>
    	<map from="^/goodlookingpath/(.*)" to="/backendpath/$1" />
    rewriter>
    <target host="my.backend.server" port="80" />
serviceProxy>

Monitor HTTP traffic:

<serviceProxy port="2000">
    <log/>
    <target host="localhost" port="8080" />
serviceProxy>

Monitoring and manipulation

Dynamically manipulate and monitor messages with Groovy and JavaScript (Nashorn):

<serviceProxy port="2000">
  	<groovy>
    	exc.request.header.add("X-Groovy", "Hello from Groovy")
    	CONTINUE
  	groovy>
	<target host="localhost" port="8080" />
serviceProxy>
<serviceProxy port="2000">
  	<javascript>
    	exc.getRequest().getHeader().add("X-Javascript", "Hello from JavaScript");
   		CONTINUE;
  	javascript>
	<target host="localhost" port="8080" />
serviceProxy>

Route and intercept WebSocket traffic:

<serviceProxy port="2000">
        <webSocket url="http://my.websocket.server:1234">
            <wsLog/>
        webSocket>
    <target port="8080" host="localhost"/>
serviceProxy>

(Find an example on membrane-soa.org)

Security

Use the widely adopted OAuth2/OpenID Framework to secure endpoints:

<serviceProxy name="Resource Service" port="2001">
    <oauth2Resource>
        <membrane src="https://accounts.google.com" clientId="INSERT_CLIENT_ID" clientSecret="INSERT_CLIENT_SECRET" scope="email profile" subject="sub"/>
    oauth2Resource>    
    <groovy>
        def oauth2 = exc.properties.oauth2
        exc.request.header.setValue('X-EMAIL',oauth2.userinfo.email)
        CONTINUE
    groovy>
    <target host="thomas-bayer.com" port="80"/>
serviceProxy>

(Find an example on membrane-soa.org)

Operate your own OAuth2/OpenID AuthorizationServer/Identity Provider:

<serviceProxy name="Authorization Server" port="2000">
    <oauth2authserver location="logindialog" issuer="http://localhost:2000" consentFile="consentFile.json">
        <staticUserDataProvider>
        	<user username="john" password="password" email="[email protected]" />
        staticUserDataProvider>
        	<staticClientList>
        <client clientId="abc" clientSecret="def" callbackUrl="http://localhost:2001/oauth2callback" />
        staticClientList>
    	<bearerToken/>
        <claims value="aud email iss sub username">
        	<scope id="username" claims="username"/>
        	<scope id="profile" claims="username email password"/>
        claims>
    oauth2authserver>
serviceProxy>

(Find an example on membrane-soa.org)

Secure an endpoint with basic authentication:

<serviceProxy port="2000">
    <basicAuthentication>
        <user name="bob" password="secret" />
    basicAuthentication>
    <target host="localhost" port="8080" />
serviceProxy>

Route to SSL/TLS secured endpoints:

<serviceProxy port="8080">
	<target host="www.predic8.de" port="443">
		<ssl/>
	target>
serviceProxy>

Secure endpoints with SSL/TLS:

<serviceProxy port="443">
	<ssl>
		<keystore location="membrane.jks" password="secret" keyPassword="secret" />
		<truststore location="membrane.jks" password="secret" />
	ssl>
	<target host="localhost" port="8080"  />
serviceProxy>

Limit the number of incoming requests:

<serviceProxy port="2000">
    <rateLimiter requestLimit="3" requestLimitDuration="PT30S"/>
    <target host="localhost" port="8080" />
serviceProxy>

Clustering

Distribute your workload to multiple nodes:

<serviceProxy name="Balancer" port="8080">
    <balancer name="balancer">
        <clusters>
            <cluster name="Default">
                <node host="my.backend.service-1" port="4000"/>
                <node host="my.backend.service-2" port="4000"/>
                <node host="my.backend.service-3" port="4000"/>
            cluster>
        clusters>
    balancer>
serviceProxy>

See configuration reference for much more.

Comments
  • SSLHandshakeException using a Proxy Config

    SSLHandshakeException using a Proxy Config

    See:

    https://groups.google.com/forum/#!topic/membrane-monitor/Q53ewuB6ZFg

    Hi,

    More news today. I've try to make a test with a java core batch in the same context (same server, same proxy...) :

        public static void main(String[] args) throws Exception {
    
        CloseableHttpClient httpclient = HttpClients.createDefault();
    
        try {
    
        HttpHost target = new HttpHost("www.google.de", 443, "https");
    
        HttpHost proxy = new HttpHost("gateway.xxxx.zzzzz.net", 80, "http");
    
    
        RequestConfig config = RequestConfig.custom().setProxy(proxy).build();
    
        HttpGet request = new HttpGet("/");
    
        request.setConfig(config);
    
    
        CloseableHttpResponse response = httpclient.execute(target, request);
    
        try {
    
        System.out.println(response.getStatusLine());
    
        EntityUtils.consume(response.getEntity());
    
        } 
    
        } 
    
        }
    

    --> It's work : HTTP/1.1 200 OK

    If I switch "http" by "https" in this line

    HttpHost proxy = new HttpHost("gateway.xxxx.zzzzz.net", 80, "https");
    

    I get the same error than with membrane :

    Exception in thread "main" javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake [...]
    

    --> It's sounds like membrane try to access to my proxy server with HTTPS protocol instead HTTP.

    Do you know how can I force membrane to access to my proxy with HTTP protocol ?

    Best Regards.

    bug 
    opened by predic8 17
  • wsdl files fail to load if they contain schemas that have complexType elements with restriction elements that reference built in types

    wsdl files fail to load if they contain schemas that have complexType elements with restriction elements that reference built in types

    The presence of a schema containing a complexType element that has a restriction element child with a base of anyType, boolean or string or other built in primitive type causes membrane to fail to start. If the schema is moved to an external file and imported into the wsdl then it works as expected.

    Having a restriction element as a child of a simpleType seems to work OK.

    Caused by: org.xml.sax.SAXParseException; systemId: file:///membrane-service-proxy-4.0.17/examples/validation/soap-Proxy/test.wsdl; lineNumber: 4; columnNumber: 41; src-resolve.4.1: Error resolving component 'anyType'. It was detected that 'anyType' has no namespace, but components with no target namespace are not referenceable from schema document 'file:///membrane-service-proxy-4.0.17/examples/validation/soap-Proxy/test.wsdl'. If 'anyType' is intended to have a namespace, perhaps a prefix needs to be provided. If it is intended that 'anyType' has no namespace, then an 'import' without a "namespace" attribute should be added to 'file:///membrane-service-proxy-4.0.17/examples/validation/soap-Proxy/test.wsdl'.

    Consider this schema (schema.xsd)

    <schema targetNamespace="http://www.example.com/IPO"
                    attributeFormDefault="unqualified"
                    elementFormDefault="unqualified"
            xmlns="http://www.w3.org/2001/XMLSchema">
    
    <!-- this is OK -->
      <simpleType name="SKU2">
        <restriction base="string"/>
      </simpleType>
    
    <!-- as is this externally -->
      <complexType name="SKU">
        <complexContent>
          <restriction base="anyType"/>
        </complexContent>
      </complexType>
    
    </schema>
    

    If I embed it into test.wsdl then membrane won't start. If I import it instead it's ok (adjust the data below to uncomment the import and comment the embedded schema to test).

    <definitions name="HelloService"
       targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"
       xmlns="http://schemas.xmlsoap.org/wsdl/"
       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
       xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    
       <types>
    
    <!--
         <import namespace="http://www.example.com/IPO" schemaLocation="schema.xsd"/>
    -->
    
        <schema targetNamespace="http://www.example.com/IPO"
                            attributeFormDefault="unqualified"
                    elementFormDefault="unqualified"
                xmlns="http://www.w3.org/2001/XMLSchema">
    
    <!-- this is OK too -->
          <simpleType name="SKU2">
            <restriction base="string"/>
          </simpleType>
    
    <!-- but this is not! -->
          <complexType name="SKU">
            <complexContent>
              <restriction base="anyType"/>
            </complexContent>
          </complexType>
    
       </schema>
    
       </types>
    
       <!-- all of this is boilerplate to make the wsdl syntactically correct -->
       <message name="SayHelloRequest">
          <part name="firstName" type="SKU"/>
       </message>
    
       <message name="SayHelloResponse">
          <part name="greeting" type="string"/>
       </message>
    
       <portType name="Hello_PortType">
          <operation name="sayHello">
             <input message="tns:SayHelloRequest"/>
             <output message="tns:SayHelloResponse"/>
          </operation>
       </portType>
    
       <binding name="Hello_Binding" type="tns:Hello_PortType">
          <soap:binding style="rpc"
             transport="http://schemas.xmlsoap.org/soap/http"/>
          <operation name="sayHello">
             <soap:operation soapAction="sayHello"/>
             <input>
                <soap:body
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                   namespace="urn:examples:helloservice"
                   use="encoded"/>
             </input>
    
             <output>
                <soap:body
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
                   namespace="urn:examples:helloservice"
                   use="encoded"/>
             </output>
          </operation>
       </binding>
    
       <service name="Hello_Service">
          <documentation>WSDL File for HelloService</documentation>
          <port binding="tns:Hello_Binding" name="Hello_Port">
             <soap:address
                location="http://www.examples.com/SayHello/" />
          </port>
       </service>
    </definitions>
    

    proxies.xml

    <spring:beans xmlns="http://membrane-soa.org/proxies/1/"
        xmlns:spring="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.springframework.org/schema/beans     http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                            http://membrane-soa.org/proxies/1/ http://membrane-soa.org/schemas/proxies-1.xsd">
    
        <router>
            <soapProxy port="20009" wsdl="test.wsdl">
                        <validator />
                    </soapProxy>
        </router>
    </spring:beans>
    
    bug 
    opened by longsonr 13
  • soap ssl tunel

    soap ssl tunel

    Hi. It is my first try with membrane service proxy and i want configure a SSL Tunnel to the Server in soap service. This is my proxy configuratin:

       <soapProxy port="9090" wsdl="https://estelam.nibn.net:443/IBANSpecEnquiry/IBANSpec?wsdl">    
            <ssl ignoreTimestampCheckFailure="true">
                <keystore    location="C:/java/membrane-service-proxy-4.0.18/conf/iban.jks"    password="password" />
                <truststore  location="C:/java/membrane-service-proxy-4.0.18/conf/iban.jks" password="password" />
            </ssl>
    
        </soapProxy>
    

    But when i starting service this error was occured:

      org.springframework.context.ApplicationContextException: Failed to start bean 'r
      outer'; nested exception is java.lang.RuntimeException: java.lang.IllegalArgumen
      tException: Could not download the WSDL 'https://estelam.nibn.net:443/IBANSpecEn
      quiry/IBANSpec?wsdl'.
              at org.springframework.context.support.DefaultLifecycleProcessor.doStart
      (DefaultLifecycleProcessor.java:170)
              at org.springframework.context.support.DefaultLifecycleProcessor.access$
      1(DefaultLifecycleProcessor.java:154)
              at org.springframework.context.support.DefaultLifecycleProcessor$Lifecyc
      leGroup.start(DefaultLifecycleProcessor.java:339)
              at org.springframework.context.support.DefaultLifecycleProcessor.startBe
      ans(DefaultLifecycleProcessor.java:143)
              at org.springframework.context.support.DefaultLifecycleProcessor.start(D
      efaultLifecycleProcessor.java:89)
              at org.springframework.context.support.AbstractApplicationContext.start(
      AbstractApplicationContext.java:1259)
              at com.predic8.membrane.core.Router.init(Router.java:138)
              at com.predic8.membrane.core.RouterCLI.main(RouterCLI.java:38)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at com.predic8.membrane.core.Starter.main(Starter.java:26)
      Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: Could
       not download the WSDL 'https://estelam.nibn.net:443/IBANSpecEnquiry/IBANSpec?ws
      dl'.
              at com.predic8.membrane.core.Router.start(Router.java:270)
              at org.springframework.context.support.DefaultLifecycleProcessor.doStart
      (DefaultLifecycleProcessor.java:167)
              ... 12 more
      Caused by: java.lang.IllegalArgumentException: Could not download the WSDL 'http
      s://estelam.nibn.net:443/IBANSpecEnquiry/IBANSpec?wsdl'.
              at com.predic8.membrane.core.rules.SOAPProxy.parseWSDL(SOAPProxy.java:15
      1)
              at com.predic8.membrane.core.rules.SOAPProxy.configure(SOAPProxy.java:19
      4)
              at com.predic8.membrane.core.rules.SOAPProxy.init(SOAPProxy.java:268)
              at com.predic8.membrane.core.rules.AbstractProxy.init(AbstractProxy.java
      :180)
              at com.predic8.membrane.core.Router.init(Router.java:241)
              at com.predic8.membrane.core.Router.start(Router.java:256)
              ... 13 more
      Caused by: java.lang.RuntimeException: com.predic8.membrane.core.resolver.Resour
      ceRetrievalException: com.predic8.membrane.core.transport.http.EOFWhileReadingFi
      rstLineException: null line so far: "§♥☺ ☻☻
      " while retrieving https://estelam.nibn.net:443/IBANSpecEnquiry/IBANSpec?wsdl
              at com.predic8.membrane.core.resolver.ResolverMap$ExternalResolverConver
      ter$1.resolveViaHttp(ResolverMap.java:238)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMet
      hodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
              at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(P
      ogoMetaMethodSite.java:52)
              at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent
      (CallSiteArray.java:49)
              at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(Abs
      tractCallSite.java:133)
              at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(Abs
      tractCallSite.java:141)
              at com.predic8.xml.util.ExternalResolver.resolve(ExternalResolver.groovy
      :66)
              at com.predic8.xml.util.ExternalResolver$resolve.call(Unknown Source)
              at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSi
      teArray.java:45)
              at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCa
      llSite.java:108)
              at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCa
      llSite.java:120)
              at com.predic8.soamodel.AbstractParser.getResourceToken(AbstractParser.g
      roovy:45)
              at com.predic8.soamodel.AbstractParser.this$2$getResourceToken(AbstractP
      arser.groovy)
              at com.predic8.soamodel.AbstractParser$this$2$getResourceToken.callCurre                          
         nt(Unknown Source)
              at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent
         (CallSiteArray.java:49)
                 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(Abs
         tractCallSite.java:133)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(Abs
         tractCallSite.java:141)
        at com.predic8.soamodel.AbstractParser.parse(AbstractParser.groovy:34)
        at com.predic8.wsdl.WSDLParser.super$2$parse(WSDLParser.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
         90)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1074)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper
         N(ScriptBytecodeAdapter.java:128)
        at com.predic8.wsdl.WSDLParser.parse(WSDLParser.groovy:29)
        at com.predic8.membrane.core.rules.SOAPProxy.parseWSDL(SOAPProxy.java:96
         )
        ... 18 more
         Caused by: com.predic8.membrane.core.resolver.ResourceRetrievalException: com.pr
         edic8.membrane.core.transport.http.EOFWhileReadingFirstLineException: null line
         so far: "§♥☺ ☻☻
         " while retrieving https://estelam.nibn.net:443/IBANSpecEnquiry/IBANSpec?wsdl
        at com.predic8.membrane.core.resolver.HTTPSchemaResolver.resolve(HTTPSch
         emaResolver.java:67)
        at com.predic8.membrane.core.resolver.ResolverMap$ExternalResolverConver
         ter$1.resolveViaHttp(ResolverMap.java:236)
        ... 50 more
         Caused by: com.predic8.membrane.core.transport.http.EOFWhileReadingFirstLineExce
         ption: null line so far: "§♥☺ ☻☻
         "
        at com.predic8.membrane.core.http.Response.parseStartLine(Response.java:
         295)
        at com.predic8.membrane.core.http.Response.read(Response.java:312)
        at com.predic8.membrane.core.transport.http.HttpClient.doCall(HttpClient
         .java:252)
        at com.predic8.membrane.core.transport.http.HttpClient.call(HttpClient.j
         ava:157)
        at com.predic8.membrane.core.transport.http.HttpClient.call(HttpClient.j
         ava:124)
        at com.predic8.membrane.core.resolver.HTTPSchemaResolver.resolve(HTTPSch
         emaResolver.java:56)
        ... 51 more
    

    Thank you

    question wontfix 
    opened by ali-rezvani 11
  • EOFWhileReadingLineException

    EOFWhileReadingLineException

    We receive random EOFWhileReadingLineExceptions while proxying a webpage. We do this for rapid prototyping (enhance the html with custom css, js, content). We're using membrane 4.0.2

    This is the full exception:

    An exception occured while handling a request: com.predic8.membrane.core.transport.http.EOFWhileReadingLineException at com.predic8.membrane.core.util.HttpUtil.readLine(HttpUtil.java:63) at com.predic8.membrane.core.http.Response.parseStartLine(Response.java:253) at com.predic8.membrane.core.http.Response.read(Response.java:267) at com.predic8.membrane.core.transport.http.HttpClient.doCall(HttpClient.java:211) at com.predic8.membrane.core.transport.http.HttpClient.call(HttpClient.java:146) at com.predic8.membrane.core.interceptor.HTTPClientInterceptor.handleRequest(HTTPClientInterceptor.java:55) at com.predic8.membrane.core.interceptor.InterceptorFlowController.invokeRequestHandlers(InterceptorFlowController.java:106) at com.predic8.membrane.core.interceptor.InterceptorFlowController.invokeHandlers(InterceptorFlowController.java:71) at com.predic8.membrane.core.transport.http.AbstractHttpHandler.invokeHandlers(AbstractHttpHandler.java:69) at com.predic8.membrane.core.transport.http.HttpServerHandler.process(HttpServerHandler.java:182) at com.predic8.membrane.core.transport.http.HttpServerHandler.run(HttpServerHandler.java:87) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:680)

    Any ideas?

    question possible bug 
    opened by niklasbulitta 11
  • Question, How to I can change serversocket port?

    Question, How to I can change serversocket port?

    07:07:44,385 ERROR RouterCLI:50 - Failed to start bean 'router'; nested exception is java.lang.RuntimeException: com.predic8.membrane.core.transport.PortOccupiedException: Opening a serversocket at port 80 failed. Please make sure that the port is not occupied by a different program or change your rule configuration to select another one. org.springframework.context.ApplicationContextException: Failed to start bean 'router'; nested exception is java.lang.RuntimeException: com.predic8.membrane.core.transport.PortOccupiedException: Opening a serversocket at port 80 failed. Please make sure that the port is not occupied by a different program or change your rule configuration to select another one.

    I added

    <serviceProxy port="9001">
        <webSocket/>
        <target host="localhost" port="2001" />
    </serviceProxy>
    
    

    but it doesn't work

    opened by marti1125 8
  • wsdl fails to load if it has no carriage returns

    wsdl fails to load if it has no carriage returns

    xml documents should not need whitespace/carriage returns. I have a large wsdl file that fails i.e. membrane fails to start. It works (i.e. membrane starts) if the wsdl file is prettified though.

    Apologies for the size of the file but small files don't cause a problem. Here's the formatted version:

    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                      xmlns:sch3="http://www.capita-software-services.com/scp/base"
                      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                      xmlns:tns="http://www.capita-software-services.com/scp/simple"
                      targetNamespace="http://www.capita-software-services.com/scp/simple">
        <wsdl:types>
            <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                       xmlns="http://www.capita-software-services.com/portal-api"
                       xmlns:cpt="http://www.capita-software-services.com/portal-api" elementFormDefault="unqualified"
                       targetNamespace="http://www.capita-software-services.com/portal-api">
                <xs:annotation>
                    <xs:documentation>Schema Version: 8.0.0.0</xs:documentation>
                    <xs:documentation>Schema Description: Type definitions for
                        use by Secure Bureau Service
                    </xs:documentation>
                </xs:annotation>
                <xs:simpleType name="generalShortString">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="1"/>
                        <xs:maxLength value="35"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalString">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="1"/>
                        <xs:maxLength value="50"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalIntermediateString">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="1"/>
                        <xs:maxLength value="100"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalMediumString">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="1"/>
                        <xs:maxLength value="255"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalLongString">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="1"/>
                        <xs:maxLength value="2048"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalShortStringEmpty">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="0"/>
                        <xs:maxLength value="35"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalStringEmpty">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="0"/>
                        <xs:maxLength value="50"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalMediumStringEmpty">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="0"/>
                        <xs:maxLength value="255"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalLongStringEmpty">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="0"/>
                        <xs:maxLength value="2048"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalAmount">
                    <xs:annotation>
                        <xs:documentation>Amount in minor currency
                            units(pence/cents), leading sign
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:int"/>
                </xs:simpleType>
                <xs:simpleType name="generalAmountPositive">
                    <xs:annotation>
                        <xs:documentation>Amount in minor currency
                            units(pence/cents)
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:positiveInteger"/>
                </xs:simpleType>
                <xs:simpleType name="generalAmountNonZero">
                    <xs:annotation>
                        <xs:documentation>Amount in minor currency
                            units(pence/cents), leading sign, zero not allowed
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:int">
                        <xs:pattern value="[\-+]?[0]*[1-9]\d*"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalInteger">
                    <xs:restriction base="xs:int"/>
                </xs:simpleType>
                <xs:simpleType name="generalShort">
                    <xs:restriction base="xs:short">
                        <xs:minInclusive value="1"/>
                        <xs:maxInclusive value="32767"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalDecimal">
                    <xs:restriction base="xs:decimal">
                        <xs:fractionDigits value="4"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalDecimalPositive">
                    <xs:restriction base="generalDecimal">
                        <xs:minExclusive value="0"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalDate">
                    <xs:annotation>
                        <xs:documentation>Use the xml date/time format eg
                            2003-09-26T15:32:00
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:dateTime"/>
                </xs:simpleType>
                <xs:simpleType name="generalDateMMYY">
                    <xs:annotation>
                        <xs:documentation>Date format MMYY</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:pattern value="(([1][0-2])|([0][1-9]))[0-9][0-9]"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalDateMMYYallow0000">
                    <xs:annotation>
                        <xs:documentation>Date format MMYY</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[0][0][0][0]|((([1][0-2])|([0][1-9]))[0-9][0-9])"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalCode">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="1"/>
                        <xs:maxLength value="5"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="generalBoolean">
                    <xs:restriction base="xs:boolean"/>
                </xs:simpleType>
                <xs:simpleType name="generalSequenceNumber">
                    <xs:restriction base="xs:positiveInteger">
                        <xs:totalDigits value="5"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="systemCode">
                    <xs:annotation>
                        <xs:documentation>ACP - AXIS Common Payments</xs:documentation>
                        <xs:documentation>ACR - AXIS Counter Receipting</xs:documentation>
                        <xs:documentation>ADD - AXIS Direct Debits</xs:documentation>
                        <xs:documentation>AIM - AXIS Income Management</xs:documentation>
                        <xs:documentation>AIP - AXIS Internet Payments</xs:documentation>
                        <xs:documentation>AOS - AXIS On-line Services</xs:documentation>
                        <xs:documentation>API - AXIS Payments Interface</xs:documentation>
                        <xs:documentation>APN - AXIS PAYe.NET</xs:documentation>
                        <xs:documentation>APP - AXIS Payment Portal</xs:documentation>
                        <xs:documentation>ARP - AXIS Remittance</xs:documentation>
                        <xs:documentation>ASR - AXIS Speech Recognition</xs:documentation>
                        <xs:documentation>ATP - AXIS Telephone Payments</xs:documentation>
                        <xs:documentation>ATT - AXIS Touch Tone</xs:documentation>
                        <xs:documentation>DIR - Direct Authorisations from Third
                            Parties
                        </xs:documentation>
                        <xs:documentation>EXT - EXTERNAL SYSTEM</xs:documentation>
                        <xs:documentation>HPAY - AXIS Health PAYe.NET</xs:documentation>
                        <xs:documentation>MAPN - Managed AXIS PAYe.NET</xs:documentation>
                        <xs:documentation>MHPAY - Managed AXIS Health PAYe.NET</xs:documentation>
                        <xs:documentation>MOTO - AXIS Mail Order Telephone
                            Order
                        </xs:documentation>
                        <xs:documentation>PCR - Perception</xs:documentation>
                        <xs:documentation>SBS - Secure Bureau Service</xs:documentation>
                        <xs:documentation>SCM - AXIS SafeCom</xs:documentation>
                        <xs:documentation>SCP - AXIS Stored Card Portal</xs:documentation>
                        <xs:documentation>SGW - AXIS Smart Gateway</xs:documentation>
                        <xs:documentation>SMS - AXIS Short Message Service</xs:documentation>
                        <xs:documentation>THY - Thyron</xs:documentation>
                        <xs:documentation>TVWAP - AXIS DigiTV</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="ACP"/>
                        <xs:enumeration value="ACR"/>
                        <xs:enumeration value="ADD"/>
                        <xs:enumeration value="AIM"/>
                        <xs:enumeration value="AIP"/>
                        <xs:enumeration value="AOS"/>
                        <xs:enumeration value="API"/>
                        <xs:enumeration value="APN"/>
                        <xs:enumeration value="APP"/>
                        <xs:enumeration value="ARP"/>
                        <xs:enumeration value="ASR"/>
                        <xs:enumeration value="ATP"/>
                        <xs:enumeration value="ATT"/>
                        <xs:enumeration value="DIR"/>
                        <xs:enumeration value="EXT"/>
                        <xs:enumeration value="HPAY"/>
                        <xs:enumeration value="MAPN"/>
                        <xs:enumeration value="MHPAY"/>
                        <xs:enumeration value="MOTO"/>
                        <xs:enumeration value="PCR"/>
                        <xs:enumeration value="SCM"/>
                        <xs:enumeration value="SCP"/>
                        <xs:enumeration value="SGW"/>
                        <xs:enumeration value="SMS"/>
                        <xs:enumeration value="THY"/>
                        <xs:enumeration value="TVWAP"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="systemCodeDirect">
                    <xs:annotation>
                        <xs:documentation>DIR - Direct Authorisations from Third
                            Parties
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="DIR"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="siteID">
                    <xs:restriction base="xs:unsignedShort">
                        <xs:maxInclusive value="32767"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="uniqueTranID">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="12"/>
                        <xs:maxLength value="12"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="isoCode">
                    <xs:annotation>
                        <xs:documentation>Three digit ISO code</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[0-9]{3}"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="userName">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="1"/>
                        <xs:maxLength value="25"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="sourceCode">
                    <xs:restriction base="generalCode"/>
                </xs:simpleType>
                <xs:simpleType name="languageCode">
                    <xs:restriction base="xs:string">
                        <xs:length value="2"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="linkCAN">
                    <xs:restriction base="xs:positiveInteger"/>
                </xs:simpleType>
                <xs:simpleType name="san">
                    <xs:restriction base="xs:positiveInteger"/>
                </xs:simpleType>
                <xs:simpleType name="recordSource">
                    <xs:annotation>
                        <xs:documentation>0 - Holding</xs:documentation>
                        <xs:documentation>1 - History</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="0"/>
                        <xs:enumeration value="1"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="track2Data">
                    <xs:annotation>
                        <xs:documentation>Mandatory if card swiped, otherwise
                            should not be present
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:maxLength value="100"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="cardNumber">
                    <xs:annotation>
                        <xs:documentation>Mandatory on keyed and chip card
                            transactions, should not be present for swiped
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:pattern value="([0-9]{12,19})"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="issueNumber">
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[0-9]?[0-9]"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="keySwipe">
                    <xs:annotation>
                        <xs:documentation>0 - Signed voucher</xs:documentation>
                        <xs:documentation>1 - Mail order/telephone order/CNP</xs:documentation>
                        <xs:documentation>2 - Continuous authority</xs:documentation>
                        <xs:documentation>3 - PIN verified (on-line)</xs:documentation>
                        <xs:documentation>4 - PIN verified (off-line)</xs:documentation>
                        <xs:documentation>5 - Signed voucher (swiped)</xs:documentation>
                        <xs:documentation>6 - Signed voucher (keyed)</xs:documentation>
                        <xs:documentation>7 - Unattended device without PIN</xs:documentation>
                        <xs:documentation>8 - PIN verified transaction
                            (recovered after sale)
                        </xs:documentation>
                        <xs:documentation>9 - Signed voucher (recovered after
                            sale)
                        </xs:documentation>
                        <xs:documentation>G - Secure e-commerce transaction with
                            cardholder certificate
                        </xs:documentation>
                        <xs:documentation>H - Non-authenticated security
                            transaction with SET merchant certificate
                        </xs:documentation>
                        <xs:documentation>J - Non-authenticated security
                            transaction without SET merchant certificate (e.g. SSL)
                        </xs:documentation>
                        <xs:documentation>K - Non-secure transaction</xs:documentation>
                        <xs:documentation>R - Reversal (used in reversal file
                            only)
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="0"/>
                        <xs:enumeration value="1"/>
                        <xs:enumeration value="2"/>
                        <xs:enumeration value="3"/>
                        <xs:enumeration value="4"/>
                        <xs:enumeration value="5"/>
                        <xs:enumeration value="6"/>
                        <xs:enumeration value="7"/>
                        <xs:enumeration value="8"/>
                        <xs:enumeration value="9"/>
                        <xs:enumeration value="G"/>
                        <xs:enumeration value="H"/>
                        <xs:enumeration value="J"/>
                        <xs:enumeration value="K"/>
                        <xs:enumeration value="R"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="cardType">
                    <xs:annotation>
                        <xs:documentation>Mandatory on card transactions</xs:documentation>
                        <xs:documentation>D - Debit Card</xs:documentation>
                        <xs:documentation>C - Credit Card</xs:documentation>
                        <xs:documentation>N - No Auth</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:length value="1"/>
                        <xs:enumeration value="D"/>
                        <xs:enumeration value="C"/>
                        <xs:enumeration value="N"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="merchantNumber">
                    <xs:restriction base="xs:string">
                        <xs:minLength value="1"/>
                        <xs:maxLength value="20"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="cardTranType">
                    <xs:annotation>
                        <xs:documentation>Mandatory on card transactions</xs:documentation>
                        <xs:documentation>09 - Sale, keyed (cardholder not
                            present(CNP), mail order/batch)
                        </xs:documentation>
                        <xs:documentation>10 - Sale, swiped or chip (cardholder
                            present)
                        </xs:documentation>
                        <xs:documentation>20 - Sale, keyed (cardholder present /
                            magstripe fallback only)
                        </xs:documentation>
                        <xs:documentation>B2 - Sale, e-commerce, keyed (CNP)</xs:documentation>
                        <xs:documentation>Z1 - Sale, swiped,
                            voice-authorization
                        </xs:documentation>
                        <xs:documentation>Z2 - Sale, keyed,
                            voice-authorization
                        </xs:documentation>
                        <xs:documentation>Z9 - Sale, keyed, voice-authorization
                            (CNP)
                        </xs:documentation>
                        <xs:documentation>47 - Refund, keyed (CNP, mail
                            order/batch)
                        </xs:documentation>
                        <xs:documentation>58 - Refund, swiped or chip
                            (cardholder present)
                        </xs:documentation>
                        <xs:documentation>61 - Refund, keyed (cardholder present
                            / magstripe fallback only)
                        </xs:documentation>
                        <xs:documentation>B4 - Refund, e-commerce, keyed (CNP)</xs:documentation>
                        <xs:documentation>25 - Sale reversal</xs:documentation>
                        <xs:documentation>86 - Refund reversal</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="09"/>
                        <xs:enumeration value="10"/>
                        <xs:enumeration value="20"/>
                        <xs:enumeration value="B2"/>
                        <xs:enumeration value="Z1"/>
                        <xs:enumeration value="Z2"/>
                        <xs:enumeration value="Z9"/>
                        <xs:enumeration value="47"/>
                        <xs:enumeration value="58"/>
                        <xs:enumeration value="61"/>
                        <xs:enumeration value="B4"/>
                        <xs:enumeration value="25"/>
                        <xs:enumeration value="86"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="eCommerceTerminalType">
                    <xs:annotation>
                        <xs:documentation>For E-commerce transactions</xs:documentation>
                        <xs:documentation>22 - Chip and Pin transaction</xs:documentation>
                        <xs:documentation>25 - Unattended Chip and Pin
                            transaction, controlled by merchant
                        </xs:documentation>
                        <xs:documentation>30 - Secure transaction with
                            cardholder certificate
                        </xs:documentation>
                        <xs:documentation>31 - Non-authenticated security
                            transaction with SET merchant certificate
                        </xs:documentation>
                        <xs:documentation>32 - Non-authenticated security
                            transaction without SET merchant certificate(eg SSL)
                        </xs:documentation>
                        <xs:documentation>33 - No additional information
                            (considered as unsecured)
                        </xs:documentation>
                        <xs:documentation>35 - Unattended Chip and Pin
                            transaction, controlled by cardholder
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:length value="2"/>
                        <xs:enumeration value="22"/>
                        <xs:enumeration value="25"/>
                        <xs:enumeration value="30"/>
                        <xs:enumeration value="31"/>
                        <xs:enumeration value="32"/>
                        <xs:enumeration value="33"/>
                        <xs:enumeration value="35"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="cardSecurityCode">
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[0-9][0-9][0-9]?[0-9]"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="houseNumber">
                    <xs:restriction base="xs:string">
                        <xs:maxLength value="10"/>
                        <xs:minLength value="1"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="postCode">
                    <xs:restriction base="xs:string">
                        <xs:maxLength value="10"/>
                        <xs:minLength value="1"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="securityAttempted">
                    <xs:annotation>
                        <xs:documentation>M - MasterCard Secure</xs:documentation>
                        <xs:documentation>V - Verified By Visa</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="M"/>
                        <xs:enumeration value="V"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="securityResult">
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Y"/>
                        <xs:enumeration value="A"/>
                        <xs:enumeration value="U"/>
                        <xs:enumeration value="N"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="eci">
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[0-9][0-9]"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="surchargeType">
                    <xs:annotation>
                        <xs:documentation>F - Fixed Amount</xs:documentation>
                        <xs:documentation>N - None</xs:documentation>
                        <xs:documentation>P - Percentage</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:length value="1"/>
                        <xs:enumeration value="F"/>
                        <xs:enumeration value="N"/>
                        <xs:enumeration value="P"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="cardMnemonic">
                    <xs:restriction base="xs:string">
                        <xs:length value="4"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="cardDescription">
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="VISA"/>
                        <xs:enumeration value="MASTERCARD"/>
                        <xs:enumeration value="AMERICAN EXPRESS"/>
                        <xs:enumeration value="LASER"/>
                        <xs:enumeration value="DINERS"/>
                        <xs:enumeration value="JCBC"/>
                        <xs:enumeration value="NONE"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="statusCode">
                    <xs:annotation>
                        <xs:documentation>0 - Operation completed successfully</xs:documentation>
                        <xs:documentation>Non-zero - Operation failed, more
                            details available in description
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:int"/>
                </xs:simpleType>
                <xs:simpleType name="responseCode">
                    <xs:annotation>
                        <xs:documentation>Card Authorisation Response Codes:-</xs:documentation>
                        <xs:documentation>From the underlying application. Some
                            examples:
                        </xs:documentation>
                        <xs:documentation>00 - Transaction Authorized</xs:documentation>
                        <xs:documentation>Non-zero - Transaction Not Authorized,
                            some possible values are given below
                        </xs:documentation>
                        <xs:documentation>02 - Referral B</xs:documentation>
                        <xs:documentation>05 - Declined</xs:documentation>
                        <xs:documentation>30 - Bank validation failed, invalid
                            merchant etc
                        </xs:documentation>
                        <xs:documentation>54 - Expired Card</xs:documentation>
                        <xs:documentation>91 - Comms Fault</xs:documentation>
                        <xs:documentation>92 - Manual Auth</xs:documentation>
                        <xs:documentation>Validate Card Response Codes:-</xs:documentation>
                        <xs:documentation>0 - Request processed successfully</xs:documentation>
                        <xs:documentation>10 - Request failed schema validation
                            exception
                        </xs:documentation>
                        <xs:documentation>20 - Request failed data access
                            exception
                        </xs:documentation>
                        <xs:documentation>30 - Request failed validation
                            exception
                        </xs:documentation>
                        <xs:documentation>90 - Request failed other error</xs:documentation>
                        <xs:documentation>Stored Card Response Codes:-</xs:documentation>
                        <xs:documentation>0 - Request processed successfully</xs:documentation>
                        <xs:documentation>5 - Card not found</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[0-9A-Z][0-9]?"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="maskedCardNumber">
                    <xs:annotation>
                        <xs:documentation>Card number with all but first six and
                            last four digits masked with asterisks
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[0-9]{6}\*+[0-9]{4}"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="responseAVVCVV">
                    <xs:restriction base="xs:string">
                        <xs:pattern value="\d{6}"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="surchargeRate">
                    <xs:annotation>
                        <xs:documentation>Percentage rate on which surcharge is
                            based, not present for fixed rate surcharges
                        </xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:decimal"/>
                </xs:simpleType>
                <xs:simpleType name="cardLastFourDigits">
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[0-9][0-9][0-9][0-9]"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="panEntryMethod">
                    <xs:annotation>
                        <xs:documentation>ECOM - E-Commerce (Default)</xs:documentation>
                        <xs:documentation>CNP - Card Not Present</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="ECOM"/>
                        <xs:enumeration value="CNP"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="portalAction">
                    <xs:annotation>
                        <xs:documentation>authorise (Default)</xs:documentation>
                        <xs:documentation>storeOnly</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="authorise"/>
                        <xs:enumeration value="storeOnly"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="phone">
                    <xs:restriction base="xs:string">
                        <xs:pattern value="|\+[1-9][0-9]{8}[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="email">
                    <xs:restriction base="xs:string">
                        <xs:pattern value="|[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,6}"/>
                        <xs:whiteSpace value="replace"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="integrator">
                    <xs:restriction base="xs:positiveInteger"/>
                </xs:simpleType>
                <xs:simpleType name="lineId">
                    <xs:restriction base="xs:token">
                        <xs:minLength value="1"/>
                        <xs:maxLength value="50"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="bacsReference">
                    <xs:restriction base="xs:string">
                        <xs:pattern value="[A-Za-z0-9.\-/&amp; ]{1,18}"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="bankSortCode">
                    <xs:restriction base="xs:token">
                        <xs:pattern value="[0-9]{6}"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="bankAccountNumber">
                    <xs:restriction base="xs:token">
                        <xs:pattern value="[0-9]{8}"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="httpUrl">
                    <xs:restriction base="xs:token">
                        <xs:pattern value="https?://.+"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:annotation>
                    <xs:documentation>Schema Version: 7.4.2.0</xs:documentation>
                    <xs:documentation>Schema Description: Type definitions for
                        use by Common Foundation
                    </xs:documentation>
                </xs:annotation>
                <xs:element name="credentials" type="credentials"/>
                <xs:complexType name="credentials">
                    <xs:sequence>
                        <xs:element name="subject" type="subject"/>
                        <xs:element name="requestIdentification" type="requestIdentification"/>
                        <xs:element name="signature" type="signature"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="subject">
                    <xs:sequence>
                        <xs:element name="subjectType" type="subjectType"/>
                        <xs:element name="identifier" type="xs:int"/>
                        <xs:element minOccurs="0" name="systemCode" nillable="true" type="systemCode"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="requestIdentification">
                    <xs:sequence>
                        <xs:element name="uniqueReference" type="xs:string"/>
                        <xs:element name="timeStamp" type="timeStamp"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="signature">
                    <xs:sequence>
                        <xs:element name="algorithm" type="algorithm"/>
                        <xs:element name="hmacKeyID" type="xs:int"/>
                        <xs:element name="digest" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:simpleType name="timeStamp">
                    <xs:restriction base="xs:string">
                        <xs:pattern
                                value="(20)\d\d(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])([0-1]\d|2[0-3])([0-5]\d)([0-5]\d)"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="algorithm">
                    <xs:annotation>
                        <xs:documentation>Original</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="Original"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="subjectType">
                    <xs:annotation>
                        <xs:documentation>Capita Site</xs:documentation>
                        <xs:documentation>Integrator</xs:documentation>
                        <xs:documentation>Other Security Entity</xs:documentation>
                        <xs:documentation>Secure Bureau Service Site</xs:documentation>
                        <xs:documentation>Capita Portal</xs:documentation>
                    </xs:annotation>
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="CapitaSite"/>
                        <xs:enumeration value="Integrator"/>
                        <xs:enumeration value="OtherSecurityEntity"/>
                        <xs:enumeration value="SecureBureauServiceSite"/>
                        <xs:enumeration value="CapitaPortal"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:element name="scpSimpleInvokeRequest" type="scpSimpleInvokeRequest"/>
                <xs:element name="scpSimpleInvokeResponse" type="scpInvokeResponse"/>
                <xs:element name="scpSimpleQueryRequest" type="scpQueryRequest"/>
                <xs:element name="scpSimpleQueryResponse" type="scpSimpleQueryResponse"/>
                <xs:complexType name="scpSimpleInvokeRequest">
                    <xs:complexContent>
                        <xs:extension base="scpInvokeRequest">
                            <xs:sequence>
                                <xs:element minOccurs="0" name="sale" type="simpleSale"/>
                            </xs:sequence>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="simpleSale">
                    <xs:complexContent>
                        <xs:extension base="saleBase">
                            <xs:sequence>
                                <xs:element minOccurs="0" name="postageAndPacking" type="postageAndPacking"/>
                                <xs:element minOccurs="0" name="surchargeable" type="surchargeable"/>
                                <xs:element minOccurs="0" name="items">
                                    <xs:complexType>
                                        <xs:sequence>
                                            <xs:element maxOccurs="unbounded" name="item" type="simpleItem"/>
                                        </xs:sequence>
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="surchargeable">
                    <xs:sequence>
                        <xs:choice>
                            <xs:element name="applyScpConfig">
                                <xs:complexType/>
                            </xs:element>
                            <xs:element name="surcharge" type="surchargeItemDetails"/>
                        </xs:choice>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="simpleItem">
                    <xs:complexContent>
                        <xs:extension base="itemBase">
                            <xs:sequence>
                                <xs:element minOccurs="0" name="surchargeable" type="xs:boolean"/>
                            </xs:sequence>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="scpSimpleQueryResponse">
                    <xs:complexContent>
                        <xs:extension base="scpQueryResponse">
                            <xs:sequence>
                                <xs:element minOccurs="0" name="paymentResult" type="simplePaymentResult"/>
                            </xs:sequence>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="simplePaymentResult">
                    <xs:complexContent>
                        <xs:extension base="paymentResultBase">
                            <xs:choice minOccurs="0">
                                <xs:element name="paymentDetails" type="simplePayment"/>
                                <xs:element name="errorDetails" type="errorDetails"/>
                            </xs:choice>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="simplePayment">
                    <xs:complexContent>
                        <xs:extension base="paymentBase">
                            <xs:sequence>
                                <xs:element name="saleSummary" type="simpleSaleSummary"/>
                                <xs:element minOccurs="0" name="surchargeDetails" type="surchargeDetails"/>
                            </xs:sequence>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="simpleSaleSummary">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="items">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element maxOccurs="unbounded" name="itemSummary" type="simpleItemSummary"/>
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="simpleItemSummary">
                    <xs:complexContent>
                        <xs:extension base="itemSummaryBase"/>
                    </xs:complexContent>
                </xs:complexType>
                <xs:element name="scpVersionRequest" type="scpVersionRequest"/>
                <xs:element name="scpVersionResponse" type="scpVersionResponse"/>
                <xs:complexType name="requestWithCredentials">
                    <xs:sequence>
                        <xs:element ref="credentials"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="scpVersionRequest">
                    <xs:complexContent>
                        <xs:extension base="requestWithCredentials"/>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="scpVersionResponse">
                    <xs:sequence>
                        <xs:element name="version" type="xs:string"/>
                        <xs:element name="schemaVersion" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="scpInvokeRequest">
                    <xs:complexContent>
                        <xs:extension base="requestWithCredentials">
                            <xs:sequence>
                                <xs:element name="requestType" type="requestType"/>
                                <xs:element name="requestId" type="xs:token"/>
                                <xs:element name="routing" type="routing"/>
                                <xs:element name="panEntryMethod" type="cpt:panEntryMethod"/>
                                <xs:element minOccurs="0" name="additionalInstructions" type="additionalInstructions"/>
                                <xs:element minOccurs="0" name="billing" type="billingDetails"/>
                            </xs:sequence>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:simpleType name="requestType">
                    <xs:restriction base="xs:token">
                        <xs:enumeration value="payOnly"/>
                        <xs:enumeration value="authoriseOnly"/>
                        <xs:enumeration value="storeOnly"/>
                        <xs:enumeration value="payAndStore"/>
                        <xs:enumeration value="payAndAutoStore"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:complexType name="routing">
                    <xs:sequence>
                        <xs:element name="returnUrl" type="returnUrl"/>
                        <xs:element minOccurs="0" name="backUrl" type="cpt:httpUrl"/>
                        <xs:element minOccurs="0" name="errorUrl" type="cpt:httpUrl"/>
                        <xs:element name="siteId" type="xs:int"/>
                        <xs:element name="scpId" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:simpleType name="returnUrl">
                    <xs:union memberTypes="cpt:httpUrl scpSpecialUrl"/>
                </xs:simpleType>
                <xs:simpleType name="scpSpecialUrl">
                    <xs:restriction base="xs:token">
                        <xs:enumeration value="scp:close"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:complexType name="additionalInstructions">
                    <xs:all>
                        <xs:element minOccurs="0" name="merchantCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="countryCode" type="cpt:isoCode"/>
                        <xs:element minOccurs="0" name="currencyCode" type="cpt:isoCode"/>
                        <xs:element minOccurs="0" name="acceptedCards" type="acceptedCards"/>
                        <xs:element minOccurs="0" name="language" type="cpt:languageCode"/>
                        <xs:element minOccurs="0" name="stageIndicator" type="stageIndicator"/>
                        <xs:element minOccurs="0" name="responseInterface" type="responseInterface"/>
                        <xs:element minOccurs="0" name="cardholderID" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="integrator" type="xs:positiveInteger"/>
                        <xs:element minOccurs="0" name="styleCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="frameworkCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="systemCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="walletRequest">
                            <xs:complexType/>
                        </xs:element>
                    </xs:all>
                </xs:complexType>
                <xs:complexType name="acceptedCards">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="includes" type="acceptedCardList"/>
                        <xs:element minOccurs="0" name="excludes" type="acceptedCardList"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="acceptedCardList">
                    <xs:sequence>
                        <xs:element maxOccurs="unbounded" name="card" type="acceptedCardType"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="stageIndicator">
                    <xs:sequence>
                        <xs:element name="firstPortalStage" type="stageNumber"/>
                        <xs:element name="totalStages" type="stageNumber"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:simpleType name="stageNumber">
                    <xs:restriction base="xs:byte">
                        <xs:minInclusive value="1"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="responseInterface">
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="scpWebService"/>
                        <xs:enumeration value="commonPaymentsFormPost"/>
                        <xs:enumeration value="xmlFormPost"/>
                        <xs:enumeration value="htmlFormPost"/>
                        <xs:enumeration value="planningFormPost"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:complexType name="billingDetails">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="card" type="card"/>
                        <xs:element minOccurs="0" name="cardHolderDetails" type="cardHolderDetails"/>
                    </xs:sequence>
                    <xs:attribute default="true" name="editable" type="xs:boolean" use="optional"/>
                </xs:complexType>
                <xs:complexType name="card">
                    <xs:sequence>
                        <xs:choice>
                            <xs:element name="cardDetails" type="cardDetails"/>
                            <xs:element name="storedCardKey" type="storedCardKey"/>
                        </xs:choice>
                        <xs:element minOccurs="0" name="paymentGroupCode" type="cpt:generalCode"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="cardDetails">
                    <xs:sequence>
                        <xs:element name="cardNumber" type="cpt:cardNumber"/>
                        <xs:element name="expiryDate" type="cpt:generalDateMMYY"/>
                        <xs:element minOccurs="0" name="startDate" type="cpt:generalDateMMYY"/>
                        <xs:element minOccurs="0" name="issueNumber" type="cpt:issueNumber"/>
                        <xs:element minOccurs="0" name="cardSecurityCode" type="cpt:cardSecurityCode"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="storedCardKey">
                    <xs:sequence>
                        <xs:element name="token" type="xs:string"/>
                        <xs:element name="lastFourDigits" type="cpt:cardLastFourDigits"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="cardHolderDetails">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="cardHolderName" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="address" type="address"/>
                        <xs:element minOccurs="0" name="contact" type="contact"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="address">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="address1" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="address2" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="address3" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="address4" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="county" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="country" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="postcode" type="cpt:postCode"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="contact">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="telephone" type="cpt:phone"/>
                        <xs:element minOccurs="0" name="mobile" type="cpt:phone"/>
                        <xs:element minOccurs="0" name="email" type="cpt:email"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="saleBase">
                    <xs:sequence>
                        <xs:element name="saleSummary" type="summaryData"/>
                        <xs:element minOccurs="0" name="deliveryDetails" type="contactDetails"/>
                        <xs:element minOccurs="0" name="lgSaleDetails" type="lgSaleDetails"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="summaryData">
                    <xs:sequence>
                        <xs:element name="description">
                            <xs:simpleType>
                                <xs:restriction base="xs:string">
                                    <xs:minLength value="1"/>
                                    <xs:maxLength value="100"/>
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:element>
                        <xs:element name="amountInMinorUnits" type="cpt:generalAmount"/>
                        <xs:element minOccurs="0" name="reference" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="displayableReference" type="cpt:generalString"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="contactDetails">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="name" type="threePartName"/>
                        <xs:element minOccurs="0" name="address" type="address"/>
                        <xs:element minOccurs="0" name="contact" type="contact"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="threePartName">
                    <xs:sequence>
                        <xs:element name="surname" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="title" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="forename" type="cpt:generalString"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="lgSaleDetails">
                    <xs:all>
                        <xs:element minOccurs="0" name="areaCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="locationCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="sourceCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="userName" type="cpt:userName"/>
                        <xs:element minOccurs="0" name="userCode" type="cpt:generalCode"/>
                    </xs:all>
                </xs:complexType>
                <xs:complexType name="postageAndPacking">
                    <xs:sequence>
                        <xs:element name="pnpSummary" type="summaryData"/>
                        <xs:element minOccurs="0" name="tax" type="taxItem"/>
                        <xs:element minOccurs="0" name="lgPnpDetails" type="lgPnpDetails"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="taxItem">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="vat" type="vatItem"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="vatItem">
                    <xs:complexContent>
                        <xs:extension base="vatBase">
                            <xs:sequence>
                                <xs:element name="vatAmountInMinorUnits" type="cpt:generalAmount"/>
                            </xs:sequence>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="vatBase">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="vatCode" type="cpt:generalCode"/>
                        <xs:element name="vatRate" type="cpt:generalDecimal"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="lgPnpDetails">
                    <xs:all>
                        <xs:element minOccurs="0" name="fundCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="pnpCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="pnpOptionCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="pnpOptionDescription" type="cpt:generalString"/>
                    </xs:all>
                </xs:complexType>
                <xs:complexType name="surchargeItemDetails">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="fundCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="reference" type="cpt:generalString"/>
                        <xs:element name="surchargeInfo" type="surchargeInfo"/>
                        <xs:element minOccurs="0" name="tax" type="taxSurcharge"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="surchargeInfo">
                    <xs:sequence>
                        <xs:element maxOccurs="unbounded" name="cardSurchargeRate" type="cardSurchargeRate"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="cardSurchargeRate">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="surchargeCardType" type="acceptedCardType"/>
                        <xs:element name="surchargeBasis" type="surchargeBasis"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="acceptedCardType">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="cardDescription" type="cpt:cardDescription"/>
                        <xs:element minOccurs="0" name="cardType" type="cardType"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="surchargeBasis">
                    <xs:annotation>
                        <xs:documentation>At least one of surchargeFixed and/or
                            surchargeRate
                            is required
                        </xs:documentation>
                    </xs:annotation>
                    <xs:all>
                        <xs:element minOccurs="0" name="surchargeFixed" type="cpt:generalAmountPositive"/>
                        <xs:element minOccurs="0" name="surchargeRate" type="cpt:generalDecimalPositive"/>
                    </xs:all>
                </xs:complexType>
                <xs:complexType name="taxSurcharge">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="vat" type="vatSurcharge"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="vatSurcharge">
                    <xs:complexContent>
                        <xs:extension base="vatBase"/>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="itemBase">
                    <xs:sequence>
                        <xs:element name="itemSummary" type="summaryData"/>
                        <xs:element minOccurs="0" name="tax" type="taxItem"/>
                        <xs:element minOccurs="0" name="quantity" type="cpt:generalShort"/>
                        <xs:element minOccurs="0" name="notificationEmails" type="notificationEmails"/>
                        <xs:element minOccurs="0" name="lgItemDetails" type="lgItemDetails"/>
                        <xs:element minOccurs="0" name="customerInfo" type="customerInfo"/>
                        <xs:element name="lineId" type="cpt:lineId"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="notificationEmails">
                    <xs:sequence>
                        <xs:element maxOccurs="5" name="email" type="cpt:email"/>
                        <xs:element minOccurs="0" name="additionalEmailMessage" type="cpt:generalLongString"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="lgItemDetails">
                    <xs:all>
                        <xs:element minOccurs="0" name="fundCode" type="cpt:generalCode"/>
                        <xs:element minOccurs="0" name="isFundItem" type="xs:boolean"/>
                        <xs:element minOccurs="0" name="additionalReference" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="narrative" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="accountName" type="threePartName"/>
                        <xs:element minOccurs="0" name="accountAddress" type="address"/>
                        <xs:element minOccurs="0" name="contact" type="contact"/>
                    </xs:all>
                </xs:complexType>
                <xs:complexType name="customerInfo">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="customerString1" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="customerString2" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="customerString3" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="customerString4" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="customerString5" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="customerNumber1" type="xs:int"/>
                        <xs:element minOccurs="0" name="customerNumber2" type="xs:int"/>
                        <xs:element minOccurs="0" name="customerNumber3" type="xs:int"/>
                        <xs:element minOccurs="0" name="customerNumber4" type="xs:int"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="bankDetails">
                    <xs:complexContent>
                        <xs:extension base="bacsBankAccount">
                            <xs:sequence>
                                <xs:element minOccurs="0" name="bacsReference" type="cpt:bacsReference"/>
                            </xs:sequence>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="bacsBankAccount">
                    <xs:sequence>
                        <xs:element name="sortCode" type="cpt:bankSortCode"/>
                        <xs:element name="bacsAccountNumber" type="cpt:bankAccountNumber"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="scpInvokeResponse">
                    <xs:complexContent>
                        <xs:extension base="scpResponse">
                            <xs:sequence>
                                <xs:element name="invokeResult">
                                    <xs:complexType>
                                        <xs:sequence>
                                            <xs:element name="status" type="status"/>
                                            <xs:choice>
                                                <xs:element name="redirectUrl" type="xs:token"/>
                                                <xs:element name="errorDetails" type="errorDetails"/>
                                            </xs:choice>
                                        </xs:sequence>
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="scpResponse">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="requestId" type="xs:token"/>
                        <xs:element name="scpReference" type="xs:string"/>
                        <xs:element name="transactionState" type="transactionState"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:simpleType name="transactionState">
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="IN_PROGRESS"/>
                        <xs:enumeration value="COMPLETE"/>
                        <xs:enumeration value="INVALID_REFERENCE"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:simpleType name="status">
                    <xs:restriction base="xs:string">
                        <xs:enumeration value="SUCCESS"/>
                        <xs:enumeration value="INVALID_REQUEST"/>
                        <xs:enumeration value="CARD_DETAILS_REJECTED"/>
                        <xs:enumeration value="CANCELLED"/>
                        <xs:enumeration value="LOGGED_OUT"/>
                        <xs:enumeration value="NOT_ATTEMPTED"/>
                        <xs:enumeration value="ERROR"/>
                    </xs:restriction>
                </xs:simpleType>
                <xs:complexType name="errorDetails">
                    <xs:sequence>
                        <xs:element minOccurs="0" name="errorId" type="xs:string"/>
                        <xs:element minOccurs="0" name="errorMessage" type="xs:string"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="scpQueryRequest">
                    <xs:complexContent>
                        <xs:extension base="requestWithCredentials">
                            <xs:sequence>
                                <xs:element name="siteId" type="xs:int"/>
                                <xs:element name="scpReference" type="xs:string"/>
                            </xs:sequence>
                            <xs:attribute default="false" name="acceptNonCardResponseData" type="xs:boolean"
                                          use="optional"/>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="scpQueryResponse">
                    <xs:complexContent>
                        <xs:extension base="scpResponse">
                            <xs:sequence>
                                <xs:element minOccurs="0" name="storeCardResult" type="storeCardResult"/>
                                <xs:element minOccurs="0" name="emailResult" type="emailResult"/>
                            </xs:sequence>
                        </xs:extension>
                    </xs:complexContent>
                </xs:complexType>
                <xs:complexType name="storeCardResult">
                    <xs:sequence>
                        <xs:element name="status" type="status"/>
                        <xs:choice minOccurs="0">
                            <xs:element name="storedCardDetails" type="storedCardDetails"/>
                            <xs:element name="errorDetails" type="errorDetails"/>
                        </xs:choice>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="storedCardDetails">
                    <xs:sequence>
                        <xs:element name="storedCardKey" type="storedCardKey"/>
                        <xs:element name="cardDescription" type="cpt:cardDescription"/>
                        <xs:element name="cardType" type="cardType"/>
                        <xs:element minOccurs="0" name="expiryDate" type="cpt:generalDateMMYY"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="emailResult">
                    <xs:sequence>
                        <xs:element name="status" type="status"/>
                        <xs:element name="errorDetails" type="errorDetails"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="paymentResultBase">
                    <xs:sequence>
                        <xs:element name="status" type="status"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="paymentBase">
                    <xs:sequence>
                        <xs:element name="paymentHeader" type="paymentHeader"/>
                        <xs:choice>
                            <xs:element name="authDetails" type="authDetails"/>
                            <xs:element name="nonCardPayment" type="nonCardPayment"/>
                        </xs:choice>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="paymentHeader">
                    <xs:sequence>
                        <xs:element name="transactionDate" type="cpt:generalDate"/>
                        <xs:element name="machineCode" type="cpt:generalCode"/>
                        <xs:element name="uniqueTranId">
                            <xs:simpleType>
                                <xs:restriction base="xs:string">
                                    <xs:length value="12"/>
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:element>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="authDetails">
                    <xs:sequence>
                        <xs:element name="authCode" type="cpt:generalString"/>
                        <xs:element name="amountInMinorUnits" type="cpt:generalAmount"/>
                        <xs:element name="maskedCardNumber" type="cpt:maskedCardNumber"/>
                        <xs:element name="cardDescription" type="cpt:cardDescription"/>
                        <xs:element name="cardType" type="cardType"/>
                        <xs:element name="merchantNumber" type="cpt:generalString"/>
                        <xs:element minOccurs="0" name="expiryDate" type="cpt:generalDateMMYY"/>
                        <xs:element minOccurs="0" name="continuousAuditNumber" type="cpt:generalSequenceNumber"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="nonCardPayment">
                    <xs:sequence>
                        <xs:element name="amountInMinorUnits" type="cpt:generalAmount"/>
                        <xs:element minOccurs="0" name="continuousAuditNumber" type="cpt:generalSequenceNumber"/>
                        <xs:element name="paymentType" type="cpt:generalString"/>
                        <xs:element name="paymentProviderReference" type="cpt:generalString"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="itemSummaryBase">
                    <xs:sequence>
                        <xs:element name="lineId" type="cpt:lineId"/>
                        <xs:element name="continuousAuditNumber" type="cpt:generalSequenceNumber"/>
                    </xs:sequence>
                </xs:complexType>
                <xs:complexType name="surchargeDetails">
                    <xs:sequence>
                        <xs:element name="fundCode" type="cpt:generalCode"/>
                        <xs:element name="reference" type="cpt:generalString"/>
                        <xs:element name="amountInMinorUnits" type="cpt:generalAmount"/>
                        <xs:element name="surchargeBasis" type="surchargeBasis"/>
                        <xs:element minOccurs="0" name="continuousAuditNumber" type="cpt:generalSequenceNumber"/>
                        <xs:element name="vatAmountInMinorUnits" type="cpt:generalAmount"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:schema>
        </wsdl:types>
        <wsdl:message name="scpSimpleQueryRequest">
            <wsdl:part element="tns:scpSimpleQueryRequest" name="scpSimpleQueryRequest"/>
        </wsdl:message>
        <wsdl:message name="scpSimpleInvokeRequest">
            <wsdl:part element="tns:scpSimpleInvokeRequest" name="scpSimpleInvokeRequest"/>
        </wsdl:message>
        <wsdl:message name="scpVersionResponse">
            <wsdl:part element="sch3:scpVersionResponse" name="scpVersionResponse"/>
        </wsdl:message>
        <wsdl:message name="scpVersionRequest">
            <wsdl:part element="sch3:scpVersionRequest" name="scpVersionRequest"/>
        </wsdl:message>
        <wsdl:message name="scpSimpleQueryResponse">
            <wsdl:part element="tns:scpSimpleQueryResponse" name="scpSimpleQueryResponse"/>
        </wsdl:message>
        <wsdl:message name="scpSimpleInvokeResponse">
            <wsdl:part element="tns:scpSimpleInvokeResponse" name="scpSimpleInvokeResponse"/>
        </wsdl:message>
        <wsdl:portType name="scp">
            <wsdl:operation name="scpSimpleQuery">
                <wsdl:input message="tns:scpSimpleQueryRequest" name="scpSimpleQueryRequest"/>
                <wsdl:output message="tns:scpSimpleQueryResponse" name="scpSimpleQueryResponse"/>
            </wsdl:operation>
            <wsdl:operation name="scpSimpleInvoke">
                <wsdl:input message="tns:scpSimpleInvokeRequest" name="scpSimpleInvokeRequest"/>
                <wsdl:output message="tns:scpSimpleInvokeResponse" name="scpSimpleInvokeResponse"/>
            </wsdl:operation>
            <wsdl:operation name="scpVersion">
                <wsdl:input message="tns:scpVersionRequest" name="scpVersionRequest"/>
                <wsdl:output message="tns:scpVersionResponse" name="scpVersionResponse"/>
            </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="scpSoap11" type="tns:scp">
            <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
            <wsdl:operation name="scpSimpleQuery">
                <soap:operation soapAction=""/>
                <wsdl:input name="scpSimpleQueryRequest">
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output name="scpSimpleQueryResponse">
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="scpSimpleInvoke">
                <soap:operation soapAction=""/>
                <wsdl:input name="scpSimpleInvokeRequest">
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output name="scpSimpleInvokeResponse">
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="scpVersion">
                <soap:operation soapAction=""/>
                <wsdl:input name="scpVersionRequest">
                    <soap:body use="literal"/>
                </wsdl:input>
                <wsdl:output name="scpVersionResponse">
                    <soap:body use="literal"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="scpService">
            <wsdl:port binding="tns:scpSoap11" name="scpSoap11">
                <soap:address location="https://sbsctest.e-paycapita.com:443/scp/scpws"/>
            </wsdl:port>
        </wsdl:service>
    </wsdl:definitions>
    

    And the same file unformatted:

    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:sch3="http://www.capita-software-services.com/scp/base" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.capita-software-services.com/scp/simple" targetNamespace="http://www.capita-software-services.com/scp/simple"><wsdl:types><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.capita-software-services.com/portal-api" xmlns:cpt="http://www.capita-software-services.com/portal-api" elementFormDefault="unqualified" targetNamespace="http://www.capita-software-services.com/portal-api"><xs:annotation><xs:documentation>Schema Version: 8.0.0.0</xs:documentation><xs:documentation>Schema Description: Type definitions for
                    use by Secure Bureau Service</xs:documentation></xs:annotation><xs:simpleType name="generalShortString"><xs:restriction base="xs:string"><xs:minLength value="1" /><xs:maxLength value="35" /></xs:restriction></xs:simpleType><xs:simpleType name="generalString"><xs:restriction base="xs:string"><xs:minLength value="1" /><xs:maxLength value="50" /></xs:restriction></xs:simpleType><xs:simpleType name="generalIntermediateString"><xs:restriction base="xs:string"><xs:minLength value="1" /><xs:maxLength value="100" /></xs:restriction></xs:simpleType><xs:simpleType name="generalMediumString"><xs:restriction base="xs:string"><xs:minLength value="1" /><xs:maxLength value="255" /></xs:restriction></xs:simpleType><xs:simpleType name="generalLongString"><xs:restriction base="xs:string"><xs:minLength value="1" /><xs:maxLength value="2048" /></xs:restriction></xs:simpleType><xs:simpleType name="generalShortStringEmpty"><xs:restriction base="xs:string"><xs:minLength value="0" /><xs:maxLength value="35" /></xs:restriction></xs:simpleType><xs:simpleType name="generalStringEmpty"><xs:restriction base="xs:string"><xs:minLength value="0" /><xs:maxLength value="50" /></xs:restriction></xs:simpleType><xs:simpleType name="generalMediumStringEmpty"><xs:restriction base="xs:string"><xs:minLength value="0" /><xs:maxLength value="255" /></xs:restriction></xs:simpleType><xs:simpleType name="generalLongStringEmpty"><xs:restriction base="xs:string"><xs:minLength value="0" /><xs:maxLength value="2048" /></xs:restriction></xs:simpleType><xs:simpleType name="generalAmount"><xs:annotation><xs:documentation>Amount in minor currency
                        units(pence/cents), leading sign</xs:documentation></xs:annotation><xs:restriction base="xs:int" /></xs:simpleType><xs:simpleType name="generalAmountPositive"><xs:annotation><xs:documentation>Amount in minor currency
                        units(pence/cents)</xs:documentation></xs:annotation><xs:restriction base="xs:positiveInteger" /></xs:simpleType><xs:simpleType name="generalAmountNonZero"><xs:annotation><xs:documentation>Amount in minor currency
                        units(pence/cents), leading sign, zero not allowed</xs:documentation></xs:annotation><xs:restriction base="xs:int"><xs:pattern value="[\-+]?[0]*[1-9]\d*" /></xs:restriction></xs:simpleType><xs:simpleType name="generalInteger"><xs:restriction base="xs:int" /></xs:simpleType><xs:simpleType name="generalShort"><xs:restriction base="xs:short"><xs:minInclusive value="1" /><xs:maxInclusive value="32767" /></xs:restriction></xs:simpleType><xs:simpleType name="generalDecimal"><xs:restriction base="xs:decimal"><xs:fractionDigits value="4" /></xs:restriction></xs:simpleType><xs:simpleType name="generalDecimalPositive"><xs:restriction base="generalDecimal"><xs:minExclusive value="0" /></xs:restriction></xs:simpleType><xs:simpleType name="generalDate"><xs:annotation><xs:documentation>Use the xml date/time format eg
                        2003-09-26T15:32:00</xs:documentation></xs:annotation><xs:restriction base="xs:dateTime" /></xs:simpleType><xs:simpleType name="generalDateMMYY"><xs:annotation><xs:documentation>Date format MMYY</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:pattern value="(([1][0-2])|([0][1-9]))[0-9][0-9]" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="generalDateMMYYallow0000"><xs:annotation><xs:documentation>Date format MMYY</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:pattern value="[0][0][0][0]|((([1][0-2])|([0][1-9]))[0-9][0-9])" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="generalCode"><xs:restriction base="xs:string"><xs:minLength value="1" /><xs:maxLength value="5" /></xs:restriction></xs:simpleType><xs:simpleType name="generalBoolean"><xs:restriction base="xs:boolean" /></xs:simpleType><xs:simpleType name="generalSequenceNumber"><xs:restriction base="xs:positiveInteger"><xs:totalDigits value="5" /></xs:restriction></xs:simpleType><xs:simpleType name="systemCode"><xs:annotation><xs:documentation>ACP - AXIS Common Payments</xs:documentation><xs:documentation>ACR - AXIS Counter Receipting</xs:documentation><xs:documentation>ADD - AXIS Direct Debits</xs:documentation><xs:documentation>AIM - AXIS Income Management</xs:documentation><xs:documentation>AIP - AXIS Internet Payments</xs:documentation><xs:documentation>AOS - AXIS On-line Services</xs:documentation><xs:documentation>API - AXIS Payments Interface</xs:documentation><xs:documentation>APN - AXIS PAYe.NET</xs:documentation><xs:documentation>APP - AXIS Payment Portal</xs:documentation><xs:documentation>ARP - AXIS Remittance</xs:documentation><xs:documentation>ASR - AXIS Speech Recognition</xs:documentation><xs:documentation>ATP - AXIS Telephone Payments</xs:documentation><xs:documentation>ATT - AXIS Touch Tone</xs:documentation><xs:documentation>DIR - Direct Authorisations from Third
                        Parties</xs:documentation><xs:documentation>EXT - EXTERNAL SYSTEM</xs:documentation><xs:documentation>HPAY - AXIS Health PAYe.NET</xs:documentation><xs:documentation>MAPN - Managed AXIS PAYe.NET</xs:documentation><xs:documentation>MHPAY - Managed AXIS Health PAYe.NET</xs:documentation><xs:documentation>MOTO - AXIS Mail Order Telephone
                        Order</xs:documentation><xs:documentation>PCR - Perception</xs:documentation><xs:documentation>SBS - Secure Bureau Service</xs:documentation><xs:documentation>SCM - AXIS SafeCom</xs:documentation><xs:documentation>SCP - AXIS Stored Card Portal</xs:documentation><xs:documentation>SGW - AXIS Smart Gateway</xs:documentation><xs:documentation>SMS - AXIS Short Message Service</xs:documentation><xs:documentation>THY - Thyron</xs:documentation><xs:documentation>TVWAP - AXIS DigiTV</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="ACP" /><xs:enumeration value="ACR" /><xs:enumeration value="ADD" /><xs:enumeration value="AIM" /><xs:enumeration value="AIP" /><xs:enumeration value="AOS" /><xs:enumeration value="API" /><xs:enumeration value="APN" /><xs:enumeration value="APP" /><xs:enumeration value="ARP" /><xs:enumeration value="ASR" /><xs:enumeration value="ATP" /><xs:enumeration value="ATT" /><xs:enumeration value="DIR" /><xs:enumeration value="EXT" /><xs:enumeration value="HPAY" /><xs:enumeration value="MAPN" /><xs:enumeration value="MHPAY" /><xs:enumeration value="MOTO" /><xs:enumeration value="PCR" /><xs:enumeration value="SCM" /><xs:enumeration value="SCP" /><xs:enumeration value="SGW" /><xs:enumeration value="SMS" /><xs:enumeration value="THY" /><xs:enumeration value="TVWAP" /></xs:restriction></xs:simpleType><xs:simpleType name="systemCodeDirect"><xs:annotation><xs:documentation>DIR - Direct Authorisations from Third
                        Parties</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="DIR" /></xs:restriction></xs:simpleType><xs:simpleType name="siteID"><xs:restriction base="xs:unsignedShort"><xs:maxInclusive value="32767" /></xs:restriction></xs:simpleType><xs:simpleType name="uniqueTranID"><xs:restriction base="xs:string"><xs:minLength value="12" /><xs:maxLength value="12" /></xs:restriction></xs:simpleType><xs:simpleType name="isoCode"><xs:annotation><xs:documentation>Three digit ISO code</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:pattern value="[0-9]{3}" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="userName"><xs:restriction base="xs:string"><xs:minLength value="1" /><xs:maxLength value="25" /></xs:restriction></xs:simpleType><xs:simpleType name="sourceCode"><xs:restriction base="generalCode" /></xs:simpleType><xs:simpleType name="languageCode"><xs:restriction base="xs:string"><xs:length value="2" /></xs:restriction></xs:simpleType><xs:simpleType name="linkCAN"><xs:restriction base="xs:positiveInteger" /></xs:simpleType><xs:simpleType name="san"><xs:restriction base="xs:positiveInteger" /></xs:simpleType><xs:simpleType name="recordSource"><xs:annotation><xs:documentation>0 - Holding</xs:documentation><xs:documentation>1 - History</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="0" /><xs:enumeration value="1" /></xs:restriction></xs:simpleType><xs:simpleType name="track2Data"><xs:annotation><xs:documentation>Mandatory if card swiped, otherwise
                        should not be present</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:maxLength value="100" /></xs:restriction></xs:simpleType><xs:simpleType name="cardNumber"><xs:annotation><xs:documentation>Mandatory on keyed and chip card
                        transactions, should not be present for swiped</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:pattern value="([0-9]{12,19})" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="issueNumber"><xs:restriction base="xs:string"><xs:pattern value="[0-9]?[0-9]" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="keySwipe"><xs:annotation><xs:documentation>0 - Signed voucher</xs:documentation><xs:documentation>1 - Mail order/telephone order/CNP</xs:documentation><xs:documentation>2 - Continuous authority</xs:documentation><xs:documentation>3 - PIN verified (on-line)</xs:documentation><xs:documentation>4 - PIN verified (off-line)</xs:documentation><xs:documentation>5 - Signed voucher (swiped)</xs:documentation><xs:documentation>6 - Signed voucher (keyed)</xs:documentation><xs:documentation>7 - Unattended device without PIN</xs:documentation><xs:documentation>8 - PIN verified transaction
                        (recovered after sale)</xs:documentation><xs:documentation>9 - Signed voucher (recovered after
                        sale)</xs:documentation><xs:documentation>G - Secure e-commerce transaction with
                        cardholder certificate</xs:documentation><xs:documentation>H - Non-authenticated security
                        transaction with SET merchant certificate</xs:documentation><xs:documentation>J - Non-authenticated security
                        transaction without SET merchant certificate (e.g. SSL)</xs:documentation><xs:documentation>K - Non-secure transaction</xs:documentation><xs:documentation>R - Reversal (used in reversal file
                        only)</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="0" /><xs:enumeration value="1" /><xs:enumeration value="2" /><xs:enumeration value="3" /><xs:enumeration value="4" /><xs:enumeration value="5" /><xs:enumeration value="6" /><xs:enumeration value="7" /><xs:enumeration value="8" /><xs:enumeration value="9" /><xs:enumeration value="G" /><xs:enumeration value="H" /><xs:enumeration value="J" /><xs:enumeration value="K" /><xs:enumeration value="R" /></xs:restriction></xs:simpleType><xs:simpleType name="cardType"><xs:annotation><xs:documentation>Mandatory on card transactions</xs:documentation><xs:documentation>D - Debit Card</xs:documentation><xs:documentation>C - Credit Card</xs:documentation><xs:documentation>N - No Auth</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:length value="1" /><xs:enumeration value="D" /><xs:enumeration value="C" /><xs:enumeration value="N" /></xs:restriction></xs:simpleType><xs:simpleType name="merchantNumber"><xs:restriction base="xs:string"><xs:minLength value="1" /><xs:maxLength value="20" /></xs:restriction></xs:simpleType><xs:simpleType name="cardTranType"><xs:annotation><xs:documentation>Mandatory on card transactions</xs:documentation><xs:documentation>09 - Sale, keyed (cardholder not
                        present(CNP), mail order/batch)</xs:documentation><xs:documentation>10 - Sale, swiped or chip (cardholder
                        present)</xs:documentation><xs:documentation>20 - Sale, keyed (cardholder present /
                        magstripe fallback only)</xs:documentation><xs:documentation>B2 - Sale, e-commerce, keyed (CNP)</xs:documentation><xs:documentation>Z1 - Sale, swiped,
                        voice-authorization</xs:documentation><xs:documentation>Z2 - Sale, keyed,
                        voice-authorization</xs:documentation><xs:documentation>Z9 - Sale, keyed, voice-authorization
                        (CNP)</xs:documentation><xs:documentation>47 - Refund, keyed (CNP, mail
                        order/batch)</xs:documentation><xs:documentation>58 - Refund, swiped or chip
                        (cardholder present)</xs:documentation><xs:documentation>61 - Refund, keyed (cardholder present
                        / magstripe fallback only)</xs:documentation><xs:documentation>B4 - Refund, e-commerce, keyed (CNP)</xs:documentation><xs:documentation>25 - Sale reversal</xs:documentation><xs:documentation>86 - Refund reversal</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="09" /><xs:enumeration value="10" /><xs:enumeration value="20" /><xs:enumeration value="B2" /><xs:enumeration value="Z1" /><xs:enumeration value="Z2" /><xs:enumeration value="Z9" /><xs:enumeration value="47" /><xs:enumeration value="58" /><xs:enumeration value="61" /><xs:enumeration value="B4" /><xs:enumeration value="25" /><xs:enumeration value="86" /></xs:restriction></xs:simpleType><xs:simpleType name="eCommerceTerminalType"><xs:annotation><xs:documentation>For E-commerce transactions</xs:documentation><xs:documentation>22 - Chip and Pin transaction</xs:documentation><xs:documentation>25 - Unattended Chip and Pin
                        transaction, controlled by merchant</xs:documentation><xs:documentation>30 - Secure transaction with
                        cardholder certificate</xs:documentation><xs:documentation>31 - Non-authenticated security
                        transaction with SET merchant certificate</xs:documentation><xs:documentation>32 - Non-authenticated security
                        transaction without SET merchant certificate(eg SSL)</xs:documentation><xs:documentation>33 - No additional information
                        (considered as unsecured)</xs:documentation><xs:documentation>35 - Unattended Chip and Pin
                        transaction, controlled by cardholder</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:length value="2" /><xs:enumeration value="22" /><xs:enumeration value="25" /><xs:enumeration value="30" /><xs:enumeration value="31" /><xs:enumeration value="32" /><xs:enumeration value="33" /><xs:enumeration value="35" /></xs:restriction></xs:simpleType><xs:simpleType name="cardSecurityCode"><xs:restriction base="xs:string"><xs:pattern value="[0-9][0-9][0-9]?[0-9]" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="houseNumber"><xs:restriction base="xs:string"><xs:maxLength value="10" /><xs:minLength value="1" /></xs:restriction></xs:simpleType><xs:simpleType name="postCode"><xs:restriction base="xs:string"><xs:maxLength value="10" /><xs:minLength value="1" /></xs:restriction></xs:simpleType><xs:simpleType name="securityAttempted"><xs:annotation><xs:documentation>M - MasterCard Secure</xs:documentation><xs:documentation>V - Verified By Visa</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="M" /><xs:enumeration value="V" /></xs:restriction></xs:simpleType><xs:simpleType name="securityResult"><xs:restriction base="xs:string"><xs:enumeration value="Y" /><xs:enumeration value="A" /><xs:enumeration value="U" /><xs:enumeration value="N" /></xs:restriction></xs:simpleType><xs:simpleType name="eci"><xs:restriction base="xs:string"><xs:pattern value="[0-9][0-9]" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="surchargeType"><xs:annotation><xs:documentation>F - Fixed Amount</xs:documentation><xs:documentation>N - None</xs:documentation><xs:documentation>P - Percentage</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:length value="1" /><xs:enumeration value="F" /><xs:enumeration value="N" /><xs:enumeration value="P" /></xs:restriction></xs:simpleType><xs:simpleType name="cardMnemonic"><xs:restriction base="xs:string"><xs:length value="4" /></xs:restriction></xs:simpleType><xs:simpleType name="cardDescription"><xs:restriction base="xs:string"><xs:enumeration value="VISA" /><xs:enumeration value="MASTERCARD" /><xs:enumeration value="AMERICAN EXPRESS" /><xs:enumeration value="LASER" /><xs:enumeration value="DINERS" /><xs:enumeration value="JCBC" /><xs:enumeration value="NONE" /></xs:restriction></xs:simpleType><xs:simpleType name="statusCode"><xs:annotation><xs:documentation>0 - Operation completed successfully</xs:documentation><xs:documentation>Non-zero - Operation failed, more
                        details available in description</xs:documentation></xs:annotation><xs:restriction base="xs:int" /></xs:simpleType><xs:simpleType name="responseCode"><xs:annotation><xs:documentation>Card Authorisation Response Codes:-</xs:documentation><xs:documentation>From the underlying application. Some
                        examples:</xs:documentation><xs:documentation>00 - Transaction Authorized</xs:documentation><xs:documentation>Non-zero - Transaction Not Authorized,
                        some possible values are given below</xs:documentation><xs:documentation>02 - Referral B</xs:documentation><xs:documentation>05 - Declined</xs:documentation><xs:documentation>30 - Bank validation failed, invalid
                        merchant etc</xs:documentation><xs:documentation>54 - Expired Card</xs:documentation><xs:documentation>91 - Comms Fault</xs:documentation><xs:documentation>92 - Manual Auth</xs:documentation><xs:documentation>Validate Card Response Codes:-</xs:documentation><xs:documentation>0 - Request processed successfully</xs:documentation><xs:documentation>10 - Request failed schema validation
                        exception</xs:documentation><xs:documentation>20 - Request failed data access
                        exception</xs:documentation><xs:documentation>30 - Request failed validation
                        exception</xs:documentation><xs:documentation>90 - Request failed other error</xs:documentation><xs:documentation>Stored Card Response Codes:-</xs:documentation><xs:documentation>0 - Request processed successfully</xs:documentation><xs:documentation>5 - Card not found</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:pattern value="[0-9A-Z][0-9]?" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="maskedCardNumber"><xs:annotation><xs:documentation>Card number with all but first six and
                        last four digits masked with asterisks</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:pattern value="[0-9]{6}\*+[0-9]{4}" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="responseAVVCVV"><xs:restriction base="xs:string"><xs:pattern value="\d{6}" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="surchargeRate"><xs:annotation><xs:documentation>Percentage rate on which surcharge is
                        based, not present for fixed rate surcharges</xs:documentation></xs:annotation><xs:restriction base="xs:decimal" /></xs:simpleType><xs:simpleType name="cardLastFourDigits"><xs:restriction base="xs:string"><xs:pattern value="[0-9][0-9][0-9][0-9]" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="panEntryMethod"><xs:annotation><xs:documentation>ECOM - E-Commerce (Default)</xs:documentation><xs:documentation>CNP - Card Not Present</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="ECOM" /><xs:enumeration value="CNP" /></xs:restriction></xs:simpleType><xs:simpleType name="portalAction"><xs:annotation><xs:documentation>authorise (Default)</xs:documentation><xs:documentation>storeOnly</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="authorise" /><xs:enumeration value="storeOnly" /></xs:restriction></xs:simpleType><xs:simpleType name="phone"><xs:restriction base="xs:string"><xs:pattern value="|\+[1-9][0-9]{8}[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?[0-9]?" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="email"><xs:restriction base="xs:string"><xs:pattern value="|[A-Za-z0-9._%+\-]+@[A-Za-z0-9.\-]+\.[A-Za-z]{2,6}" /><xs:whiteSpace value="replace" /></xs:restriction></xs:simpleType><xs:simpleType name="integrator"><xs:restriction base="xs:positiveInteger" /></xs:simpleType><xs:simpleType name="lineId"><xs:restriction base="xs:token"><xs:minLength value="1" /><xs:maxLength value="50" /></xs:restriction></xs:simpleType><xs:simpleType name="bacsReference"><xs:restriction base="xs:string"><xs:pattern value="[A-Za-z0-9.\-/&amp; ]{1,18}" /></xs:restriction></xs:simpleType><xs:simpleType name="bankSortCode"><xs:restriction base="xs:token"><xs:pattern value="[0-9]{6}" /></xs:restriction></xs:simpleType><xs:simpleType name="bankAccountNumber"><xs:restriction base="xs:token"><xs:pattern value="[0-9]{8}" /></xs:restriction></xs:simpleType><xs:simpleType name="httpUrl"><xs:restriction base="xs:token"><xs:pattern value="https?://.+" /></xs:restriction></xs:simpleType><xs:annotation><xs:documentation>Schema Version: 7.4.2.0</xs:documentation><xs:documentation>Schema Description: Type definitions for
                    use by Common Foundation</xs:documentation></xs:annotation><xs:element name="credentials" type="credentials" /><xs:complexType name="credentials"><xs:sequence><xs:element name="subject" type="subject" /><xs:element name="requestIdentification" type="requestIdentification" /><xs:element name="signature" type="signature" /></xs:sequence></xs:complexType><xs:complexType name="subject"><xs:sequence><xs:element name="subjectType" type="subjectType" /><xs:element name="identifier" type="xs:int" /><xs:element minOccurs="0" name="systemCode" nillable="true" type="systemCode" /></xs:sequence></xs:complexType><xs:complexType name="requestIdentification"><xs:sequence><xs:element name="uniqueReference" type="xs:string" /><xs:element name="timeStamp" type="timeStamp" /></xs:sequence></xs:complexType><xs:complexType name="signature"><xs:sequence><xs:element name="algorithm" type="algorithm" /><xs:element name="hmacKeyID" type="xs:int" /><xs:element name="digest" type="xs:string" /></xs:sequence></xs:complexType><xs:simpleType name="timeStamp"><xs:restriction base="xs:string"><xs:pattern value="(20)\d\d(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])([0-1]\d|2[0-3])([0-5]\d)([0-5]\d)" /></xs:restriction></xs:simpleType><xs:simpleType name="algorithm"><xs:annotation><xs:documentation>Original</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="Original" /></xs:restriction></xs:simpleType><xs:simpleType name="subjectType"><xs:annotation><xs:documentation>Capita Site</xs:documentation><xs:documentation>Integrator</xs:documentation><xs:documentation>Other Security Entity</xs:documentation><xs:documentation>Secure Bureau Service Site</xs:documentation><xs:documentation>Capita Portal</xs:documentation></xs:annotation><xs:restriction base="xs:string"><xs:enumeration value="CapitaSite" /><xs:enumeration value="Integrator" /><xs:enumeration value="OtherSecurityEntity" /><xs:enumeration value="SecureBureauServiceSite" /><xs:enumeration value="CapitaPortal" /></xs:restriction></xs:simpleType><xs:element name="scpSimpleInvokeRequest" type="scpSimpleInvokeRequest" /><xs:element name="scpSimpleInvokeResponse" type="scpInvokeResponse" /><xs:element name="scpSimpleQueryRequest" type="scpQueryRequest" /><xs:element name="scpSimpleQueryResponse" type="scpSimpleQueryResponse" /><xs:complexType name="scpSimpleInvokeRequest"><xs:complexContent><xs:extension base="scpInvokeRequest"><xs:sequence><xs:element minOccurs="0" name="sale" type="simpleSale" /></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="simpleSale"><xs:complexContent><xs:extension base="saleBase"><xs:sequence><xs:element minOccurs="0" name="postageAndPacking" type="postageAndPacking" /><xs:element minOccurs="0" name="surchargeable" type="surchargeable" /><xs:element minOccurs="0" name="items"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" name="item" type="simpleItem" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="surchargeable"><xs:sequence><xs:choice><xs:element name="applyScpConfig"><xs:complexType /></xs:element><xs:element name="surcharge" type="surchargeItemDetails" /></xs:choice></xs:sequence></xs:complexType><xs:complexType name="simpleItem"><xs:complexContent><xs:extension base="itemBase"><xs:sequence><xs:element minOccurs="0" name="surchargeable" type="xs:boolean" /></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="scpSimpleQueryResponse"><xs:complexContent><xs:extension base="scpQueryResponse"><xs:sequence><xs:element minOccurs="0" name="paymentResult" type="simplePaymentResult" /></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="simplePaymentResult"><xs:complexContent><xs:extension base="paymentResultBase"><xs:choice minOccurs="0"><xs:element name="paymentDetails" type="simplePayment" /><xs:element name="errorDetails" type="errorDetails" /></xs:choice></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="simplePayment"><xs:complexContent><xs:extension base="paymentBase"><xs:sequence><xs:element name="saleSummary" type="simpleSaleSummary" /><xs:element minOccurs="0" name="surchargeDetails" type="surchargeDetails" /></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="simpleSaleSummary"><xs:sequence><xs:element minOccurs="0" name="items"><xs:complexType><xs:sequence><xs:element maxOccurs="unbounded" name="itemSummary" type="simpleItemSummary" /></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:complexType><xs:complexType name="simpleItemSummary"><xs:complexContent><xs:extension base="itemSummaryBase" /></xs:complexContent></xs:complexType><xs:element name="scpVersionRequest" type="scpVersionRequest" /><xs:element name="scpVersionResponse" type="scpVersionResponse" /><xs:complexType name="requestWithCredentials"><xs:sequence><xs:element ref="credentials" /></xs:sequence></xs:complexType><xs:complexType name="scpVersionRequest"><xs:complexContent><xs:extension base="requestWithCredentials" /></xs:complexContent></xs:complexType><xs:complexType name="scpVersionResponse"><xs:sequence><xs:element name="version" type="xs:string" /><xs:element name="schemaVersion" type="xs:string" /></xs:sequence></xs:complexType><xs:complexType name="scpInvokeRequest"><xs:complexContent><xs:extension base="requestWithCredentials"><xs:sequence><xs:element name="requestType" type="requestType" /><xs:element name="requestId" type="xs:token" /><xs:element name="routing" type="routing" /><xs:element name="panEntryMethod" type="cpt:panEntryMethod" /><xs:element minOccurs="0" name="additionalInstructions" type="additionalInstructions" /><xs:element minOccurs="0" name="billing" type="billingDetails" /></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:simpleType name="requestType"><xs:restriction base="xs:token"><xs:enumeration value="payOnly" /><xs:enumeration value="authoriseOnly" /><xs:enumeration value="storeOnly" /><xs:enumeration value="payAndStore" /><xs:enumeration value="payAndAutoStore" /></xs:restriction></xs:simpleType><xs:complexType name="routing"><xs:sequence><xs:element name="returnUrl" type="returnUrl" /><xs:element minOccurs="0" name="backUrl" type="cpt:httpUrl" /><xs:element minOccurs="0" name="errorUrl" type="cpt:httpUrl" /><xs:element name="siteId" type="xs:int" /><xs:element name="scpId" type="xs:int" /></xs:sequence></xs:complexType><xs:simpleType name="returnUrl"><xs:union memberTypes="cpt:httpUrl scpSpecialUrl" /></xs:simpleType><xs:simpleType name="scpSpecialUrl"><xs:restriction base="xs:token"><xs:enumeration value="scp:close" /></xs:restriction></xs:simpleType><xs:complexType name="additionalInstructions"><xs:all><xs:element minOccurs="0" name="merchantCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="countryCode" type="cpt:isoCode" /><xs:element minOccurs="0" name="currencyCode" type="cpt:isoCode" /><xs:element minOccurs="0" name="acceptedCards" type="acceptedCards" /><xs:element minOccurs="0" name="language" type="cpt:languageCode" /><xs:element minOccurs="0" name="stageIndicator" type="stageIndicator" /><xs:element minOccurs="0" name="responseInterface" type="responseInterface" /><xs:element minOccurs="0" name="cardholderID" type="cpt:generalString" /><xs:element minOccurs="0" name="integrator" type="xs:positiveInteger" /><xs:element minOccurs="0" name="styleCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="frameworkCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="systemCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="walletRequest"><xs:complexType /></xs:element></xs:all></xs:complexType><xs:complexType name="acceptedCards"><xs:sequence><xs:element minOccurs="0" name="includes" type="acceptedCardList" /><xs:element minOccurs="0" name="excludes" type="acceptedCardList" /></xs:sequence></xs:complexType><xs:complexType name="acceptedCardList"><xs:sequence><xs:element maxOccurs="unbounded" name="card" type="acceptedCardType" /></xs:sequence></xs:complexType><xs:complexType name="stageIndicator"><xs:sequence><xs:element name="firstPortalStage" type="stageNumber" /><xs:element name="totalStages" type="stageNumber" /></xs:sequence></xs:complexType><xs:simpleType name="stageNumber"><xs:restriction base="xs:byte"><xs:minInclusive value="1" /></xs:restriction></xs:simpleType><xs:simpleType name="responseInterface"><xs:restriction base="xs:string"><xs:enumeration value="scpWebService" /><xs:enumeration value="commonPaymentsFormPost" /><xs:enumeration value="xmlFormPost" /><xs:enumeration value="htmlFormPost" /><xs:enumeration value="planningFormPost" /></xs:restriction></xs:simpleType><xs:complexType name="billingDetails"><xs:sequence><xs:element minOccurs="0" name="card" type="card" /><xs:element minOccurs="0" name="cardHolderDetails" type="cardHolderDetails" /></xs:sequence><xs:attribute default="true" name="editable" type="xs:boolean" use="optional" /></xs:complexType><xs:complexType name="card"><xs:sequence><xs:choice><xs:element name="cardDetails" type="cardDetails" /><xs:element name="storedCardKey" type="storedCardKey" /></xs:choice><xs:element minOccurs="0" name="paymentGroupCode" type="cpt:generalCode" /></xs:sequence></xs:complexType><xs:complexType name="cardDetails"><xs:sequence><xs:element name="cardNumber" type="cpt:cardNumber" /><xs:element name="expiryDate" type="cpt:generalDateMMYY" /><xs:element minOccurs="0" name="startDate" type="cpt:generalDateMMYY" /><xs:element minOccurs="0" name="issueNumber" type="cpt:issueNumber" /><xs:element minOccurs="0" name="cardSecurityCode" type="cpt:cardSecurityCode" /></xs:sequence></xs:complexType><xs:complexType name="storedCardKey"><xs:sequence><xs:element name="token" type="xs:string" /><xs:element name="lastFourDigits" type="cpt:cardLastFourDigits" /></xs:sequence></xs:complexType><xs:complexType name="cardHolderDetails"><xs:sequence><xs:element minOccurs="0" name="cardHolderName" type="cpt:generalString" /><xs:element minOccurs="0" name="address" type="address" /><xs:element minOccurs="0" name="contact" type="contact" /></xs:sequence></xs:complexType><xs:complexType name="address"><xs:sequence><xs:element minOccurs="0" name="address1" type="cpt:generalString" /><xs:element minOccurs="0" name="address2" type="cpt:generalString" /><xs:element minOccurs="0" name="address3" type="cpt:generalString" /><xs:element minOccurs="0" name="address4" type="cpt:generalString" /><xs:element minOccurs="0" name="county" type="cpt:generalString" /><xs:element minOccurs="0" name="country" type="cpt:generalString" /><xs:element minOccurs="0" name="postcode" type="cpt:postCode" /></xs:sequence></xs:complexType><xs:complexType name="contact"><xs:sequence><xs:element minOccurs="0" name="telephone" type="cpt:phone" /><xs:element minOccurs="0" name="mobile" type="cpt:phone" /><xs:element minOccurs="0" name="email" type="cpt:email" /></xs:sequence></xs:complexType><xs:complexType name="saleBase"><xs:sequence><xs:element name="saleSummary" type="summaryData" /><xs:element minOccurs="0" name="deliveryDetails" type="contactDetails" /><xs:element minOccurs="0" name="lgSaleDetails" type="lgSaleDetails" /></xs:sequence></xs:complexType><xs:complexType name="summaryData"><xs:sequence><xs:element name="description"><xs:simpleType><xs:restriction base="xs:string"><xs:minLength value="1" /><xs:maxLength value="100" /></xs:restriction></xs:simpleType></xs:element><xs:element name="amountInMinorUnits" type="cpt:generalAmount" /><xs:element minOccurs="0" name="reference" type="cpt:generalString" /><xs:element minOccurs="0" name="displayableReference" type="cpt:generalString" /></xs:sequence></xs:complexType><xs:complexType name="contactDetails"><xs:sequence><xs:element minOccurs="0" name="name" type="threePartName" /><xs:element minOccurs="0" name="address" type="address" /><xs:element minOccurs="0" name="contact" type="contact" /></xs:sequence></xs:complexType><xs:complexType name="threePartName"><xs:sequence><xs:element name="surname" type="cpt:generalString" /><xs:element minOccurs="0" name="title" type="cpt:generalString" /><xs:element minOccurs="0" name="forename" type="cpt:generalString" /></xs:sequence></xs:complexType><xs:complexType name="lgSaleDetails"><xs:all><xs:element minOccurs="0" name="areaCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="locationCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="sourceCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="userName" type="cpt:userName" /><xs:element minOccurs="0" name="userCode" type="cpt:generalCode" /></xs:all></xs:complexType><xs:complexType name="postageAndPacking"><xs:sequence><xs:element name="pnpSummary" type="summaryData" /><xs:element minOccurs="0" name="tax" type="taxItem" /><xs:element minOccurs="0" name="lgPnpDetails" type="lgPnpDetails" /></xs:sequence></xs:complexType><xs:complexType name="taxItem"><xs:sequence><xs:element minOccurs="0" name="vat" type="vatItem" /></xs:sequence></xs:complexType><xs:complexType name="vatItem"><xs:complexContent><xs:extension base="vatBase"><xs:sequence><xs:element name="vatAmountInMinorUnits" type="cpt:generalAmount" /></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="vatBase"><xs:sequence><xs:element minOccurs="0" name="vatCode" type="cpt:generalCode" /><xs:element name="vatRate" type="cpt:generalDecimal" /></xs:sequence></xs:complexType><xs:complexType name="lgPnpDetails"><xs:all><xs:element minOccurs="0" name="fundCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="pnpCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="pnpOptionCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="pnpOptionDescription" type="cpt:generalString" /></xs:all></xs:complexType><xs:complexType name="surchargeItemDetails"><xs:sequence><xs:element minOccurs="0" name="fundCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="reference" type="cpt:generalString" /><xs:element name="surchargeInfo" type="surchargeInfo" /><xs:element minOccurs="0" name="tax" type="taxSurcharge" /></xs:sequence></xs:complexType><xs:complexType name="surchargeInfo"><xs:sequence><xs:element maxOccurs="unbounded" name="cardSurchargeRate" type="cardSurchargeRate" /></xs:sequence></xs:complexType><xs:complexType name="cardSurchargeRate"><xs:sequence><xs:element minOccurs="0" name="surchargeCardType" type="acceptedCardType" /><xs:element name="surchargeBasis" type="surchargeBasis" /></xs:sequence></xs:complexType><xs:complexType name="acceptedCardType"><xs:sequence><xs:element minOccurs="0" name="cardDescription" type="cpt:cardDescription" /><xs:element minOccurs="0" name="cardType" type="cardType" /></xs:sequence></xs:complexType><xs:complexType name="surchargeBasis"><xs:annotation><xs:documentation>At least one of surchargeFixed and/or
                        surchargeRate
                        is required</xs:documentation></xs:annotation><xs:all><xs:element minOccurs="0" name="surchargeFixed" type="cpt:generalAmountPositive" /><xs:element minOccurs="0" name="surchargeRate" type="cpt:generalDecimalPositive" /></xs:all></xs:complexType><xs:complexType name="taxSurcharge"><xs:sequence><xs:element minOccurs="0" name="vat" type="vatSurcharge" /></xs:sequence></xs:complexType><xs:complexType name="vatSurcharge"><xs:complexContent><xs:extension base="vatBase" /></xs:complexContent></xs:complexType><xs:complexType name="itemBase"><xs:sequence><xs:element name="itemSummary" type="summaryData" /><xs:element minOccurs="0" name="tax" type="taxItem" /><xs:element minOccurs="0" name="quantity" type="cpt:generalShort" /><xs:element minOccurs="0" name="notificationEmails" type="notificationEmails" /><xs:element minOccurs="0" name="lgItemDetails" type="lgItemDetails" /><xs:element minOccurs="0" name="customerInfo" type="customerInfo" /><xs:element name="lineId" type="cpt:lineId" /></xs:sequence></xs:complexType><xs:complexType name="notificationEmails"><xs:sequence><xs:element maxOccurs="5" name="email" type="cpt:email" /><xs:element minOccurs="0" name="additionalEmailMessage" type="cpt:generalLongString" /></xs:sequence></xs:complexType><xs:complexType name="lgItemDetails"><xs:all><xs:element minOccurs="0" name="fundCode" type="cpt:generalCode" /><xs:element minOccurs="0" name="isFundItem" type="xs:boolean" /><xs:element minOccurs="0" name="additionalReference" type="cpt:generalString" /><xs:element minOccurs="0" name="narrative" type="cpt:generalString" /><xs:element minOccurs="0" name="accountName" type="threePartName" /><xs:element minOccurs="0" name="accountAddress" type="address" /><xs:element minOccurs="0" name="contact" type="contact" /></xs:all></xs:complexType><xs:complexType name="customerInfo"><xs:sequence><xs:element minOccurs="0" name="customerString1" type="cpt:generalString" /><xs:element minOccurs="0" name="customerString2" type="cpt:generalString" /><xs:element minOccurs="0" name="customerString3" type="cpt:generalString" /><xs:element minOccurs="0" name="customerString4" type="cpt:generalString" /><xs:element minOccurs="0" name="customerString5" type="cpt:generalString" /><xs:element minOccurs="0" name="customerNumber1" type="xs:int" /><xs:element minOccurs="0" name="customerNumber2" type="xs:int" /><xs:element minOccurs="0" name="customerNumber3" type="xs:int" /><xs:element minOccurs="0" name="customerNumber4" type="xs:int" /></xs:sequence></xs:complexType><xs:complexType name="bankDetails"><xs:complexContent><xs:extension base="bacsBankAccount"><xs:sequence><xs:element minOccurs="0" name="bacsReference" type="cpt:bacsReference" /></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="bacsBankAccount"><xs:sequence><xs:element name="sortCode" type="cpt:bankSortCode" /><xs:element name="bacsAccountNumber" type="cpt:bankAccountNumber" /></xs:sequence></xs:complexType><xs:complexType name="scpInvokeResponse"><xs:complexContent><xs:extension base="scpResponse"><xs:sequence><xs:element name="invokeResult"><xs:complexType><xs:sequence><xs:element name="status" type="status" /><xs:choice><xs:element name="redirectUrl" type="xs:token" /><xs:element name="errorDetails" type="errorDetails" /></xs:choice></xs:sequence></xs:complexType></xs:element></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="scpResponse"><xs:sequence><xs:element minOccurs="0" name="requestId" type="xs:token" /><xs:element name="scpReference" type="xs:string" /><xs:element name="transactionState" type="transactionState" /></xs:sequence></xs:complexType><xs:simpleType name="transactionState"><xs:restriction base="xs:string"><xs:enumeration value="IN_PROGRESS" /><xs:enumeration value="COMPLETE" /><xs:enumeration value="INVALID_REFERENCE" /></xs:restriction></xs:simpleType><xs:simpleType name="status"><xs:restriction base="xs:string"><xs:enumeration value="SUCCESS" /><xs:enumeration value="INVALID_REQUEST" /><xs:enumeration value="CARD_DETAILS_REJECTED" /><xs:enumeration value="CANCELLED" /><xs:enumeration value="LOGGED_OUT" /><xs:enumeration value="NOT_ATTEMPTED" /><xs:enumeration value="ERROR" /></xs:restriction></xs:simpleType><xs:complexType name="errorDetails"><xs:sequence><xs:element minOccurs="0" name="errorId" type="xs:string" /><xs:element minOccurs="0" name="errorMessage" type="xs:string" /></xs:sequence></xs:complexType><xs:complexType name="scpQueryRequest"><xs:complexContent><xs:extension base="requestWithCredentials"><xs:sequence><xs:element name="siteId" type="xs:int" /><xs:element name="scpReference" type="xs:string" /></xs:sequence><xs:attribute default="false" name="acceptNonCardResponseData" type="xs:boolean" use="optional" /></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="scpQueryResponse"><xs:complexContent><xs:extension base="scpResponse"><xs:sequence><xs:element minOccurs="0" name="storeCardResult" type="storeCardResult" /><xs:element minOccurs="0" name="emailResult" type="emailResult" /></xs:sequence></xs:extension></xs:complexContent></xs:complexType><xs:complexType name="storeCardResult"><xs:sequence><xs:element name="status" type="status" /><xs:choice minOccurs="0"><xs:element name="storedCardDetails" type="storedCardDetails" /><xs:element name="errorDetails" type="errorDetails" /></xs:choice></xs:sequence></xs:complexType><xs:complexType name="storedCardDetails"><xs:sequence><xs:element name="storedCardKey" type="storedCardKey" /><xs:element name="cardDescription" type="cpt:cardDescription" /><xs:element name="cardType" type="cardType" /><xs:element minOccurs="0" name="expiryDate" type="cpt:generalDateMMYY" /></xs:sequence></xs:complexType><xs:complexType name="emailResult"><xs:sequence><xs:element name="status" type="status" /><xs:element name="errorDetails" type="errorDetails" /></xs:sequence></xs:complexType><xs:complexType name="paymentResultBase"><xs:sequence><xs:element name="status" type="status" /></xs:sequence></xs:complexType><xs:complexType name="paymentBase"><xs:sequence><xs:element name="paymentHeader" type="paymentHeader" /><xs:choice><xs:element name="authDetails" type="authDetails" /><xs:element name="nonCardPayment" type="nonCardPayment" /></xs:choice></xs:sequence></xs:complexType><xs:complexType name="paymentHeader"><xs:sequence><xs:element name="transactionDate" type="cpt:generalDate" /><xs:element name="machineCode" type="cpt:generalCode" /><xs:element name="uniqueTranId"><xs:simpleType><xs:restriction base="xs:string"><xs:length value="12" /></xs:restriction></xs:simpleType></xs:element></xs:sequence></xs:complexType><xs:complexType name="authDetails"><xs:sequence><xs:element name="authCode" type="cpt:generalString" /><xs:element name="amountInMinorUnits" type="cpt:generalAmount" /><xs:element name="maskedCardNumber" type="cpt:maskedCardNumber" /><xs:element name="cardDescription" type="cpt:cardDescription" /><xs:element name="cardType" type="cardType" /><xs:element name="merchantNumber" type="cpt:generalString" /><xs:element minOccurs="0" name="expiryDate" type="cpt:generalDateMMYY" /><xs:element minOccurs="0" name="continuousAuditNumber" type="cpt:generalSequenceNumber" /></xs:sequence></xs:complexType><xs:complexType name="nonCardPayment"><xs:sequence><xs:element name="amountInMinorUnits" type="cpt:generalAmount" /><xs:element minOccurs="0" name="continuousAuditNumber" type="cpt:generalSequenceNumber" /><xs:element name="paymentType" type="cpt:generalString" /><xs:element name="paymentProviderReference" type="cpt:generalString" /></xs:sequence></xs:complexType><xs:complexType name="itemSummaryBase"><xs:sequence><xs:element name="lineId" type="cpt:lineId" /><xs:element name="continuousAuditNumber" type="cpt:generalSequenceNumber" /></xs:sequence></xs:complexType><xs:complexType name="surchargeDetails"><xs:sequence><xs:element name="fundCode" type="cpt:generalCode" /><xs:element name="reference" type="cpt:generalString" /><xs:element name="amountInMinorUnits" type="cpt:generalAmount" /><xs:element name="surchargeBasis" type="surchargeBasis" /><xs:element minOccurs="0" name="continuousAuditNumber" type="cpt:generalSequenceNumber" /><xs:element name="vatAmountInMinorUnits" type="cpt:generalAmount" /></xs:sequence></xs:complexType></xs:schema></wsdl:types><wsdl:message name="scpSimpleQueryRequest"><wsdl:part element="tns:scpSimpleQueryRequest" name="scpSimpleQueryRequest" /></wsdl:message><wsdl:message name="scpSimpleInvokeRequest"><wsdl:part element="tns:scpSimpleInvokeRequest" name="scpSimpleInvokeRequest" /></wsdl:message><wsdl:message name="scpVersionResponse"><wsdl:part element="sch3:scpVersionResponse" name="scpVersionResponse" /></wsdl:message><wsdl:message name="scpVersionRequest"><wsdl:part element="sch3:scpVersionRequest" name="scpVersionRequest" /></wsdl:message><wsdl:message name="scpSimpleQueryResponse"><wsdl:part element="tns:scpSimpleQueryResponse" name="scpSimpleQueryResponse" /></wsdl:message><wsdl:message name="scpSimpleInvokeResponse"><wsdl:part element="tns:scpSimpleInvokeResponse" name="scpSimpleInvokeResponse" /></wsdl:message><wsdl:portType name="scp"><wsdl:operation name="scpSimpleQuery"><wsdl:input message="tns:scpSimpleQueryRequest" name="scpSimpleQueryRequest" /><wsdl:output message="tns:scpSimpleQueryResponse" name="scpSimpleQueryResponse" /></wsdl:operation><wsdl:operation name="scpSimpleInvoke"><wsdl:input message="tns:scpSimpleInvokeRequest" name="scpSimpleInvokeRequest" /><wsdl:output message="tns:scpSimpleInvokeResponse" name="scpSimpleInvokeResponse" /></wsdl:operation><wsdl:operation name="scpVersion"><wsdl:input message="tns:scpVersionRequest" name="scpVersionRequest" /><wsdl:output message="tns:scpVersionResponse" name="scpVersionResponse" /></wsdl:operation></wsdl:portType><wsdl:binding name="scpSoap11" type="tns:scp"><soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /><wsdl:operation name="scpSimpleQuery"><soap:operation soapAction="" /><wsdl:input name="scpSimpleQueryRequest"><soap:body use="literal" /></wsdl:input><wsdl:output name="scpSimpleQueryResponse"><soap:body use="literal" /></wsdl:output></wsdl:operation><wsdl:operation name="scpSimpleInvoke"><soap:operation soapAction="" /><wsdl:input name="scpSimpleInvokeRequest"><soap:body use="literal" /></wsdl:input><wsdl:output name="scpSimpleInvokeResponse"><soap:body use="literal" /></wsdl:output></wsdl:operation><wsdl:operation name="scpVersion"><soap:operation soapAction="" /><wsdl:input name="scpVersionRequest"><soap:body use="literal" /></wsdl:input><wsdl:output name="scpVersionResponse"><soap:body use="literal" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="scpService"><wsdl:port binding="tns:scpSoap11" name="scpSoap11"><soap:address location="https://sbsctest.e-paycapita.com:443/scp/scpws" /></wsdl:port></wsdl:service></wsdl:definitions>
    
    bug Prio-2 
    opened by longsonr 8
  • Exception with FileExchangeStore after upgrading to Membrane v4.7.1

    Exception with FileExchangeStore after upgrading to Membrane v4.7.1

    Hi,

    We recently upgraded Membrane Service Proxy to version 4.7.1 and started having issues with web services which were working fine before. The only workaround we found to make it work again is to disable file exchange store in those services. We get the following error when service is called with file echange store enabled:

    [2020-08-03 13:56:12,279] DEBUG HttpClient:186 - try # 0 to http://report-test.xxxx.xxx:80/rest/
    [2020-08-03 13:56:12,279] DEBUG ConnectionManager:145 - connection requested for report-test.xxxx.xx:80
    [2020-08-03 13:56:12,279] DEBUG ConnectionManager:147 - Number of connections in pool: 2
    [2020-08-03 13:56:12,280] DEBUG Connection:111 - Opened connection on localPort: 46356
    [2020-08-03 13:56:12,280] DEBUG ChunkedBody:123 - writeNotReadChunked
    [2020-08-03 13:56:42,314] ERROR FileExchangeStore:124 - java.net.SocketTimeoutException: Read timed out
    java.net.SocketTimeoutException: Read timed out
            at java.net.SocketInputStream.socketRead0(Native Method)
            at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
            at java.net.SocketInputStream.read(SocketInputStream.java:171)
            at java.net.SocketInputStream.read(SocketInputStream.java:141)
            at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
            at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
            at com.predic8.membrane.core.util.HttpUtil.readChunkSize(HttpUtil.java:87)
            at com.predic8.membrane.core.http.ChunkedBody$1.readNextChunk(ChunkedBody.java:99)
            at com.predic8.membrane.core.http.BodyInputStream.advanceToNextPosition(BodyInputStream.java:72)
            at com.predic8.membrane.core.http.BodyInputStream.read(BodyInputStream.java:111)
            at java.io.InputStream.read(InputStream.java:101)
            at com.predic8.membrane.core.util.ByteUtil.readStream(ByteUtil.java:71)
            at com.predic8.membrane.core.http.ChunkedBody.read(ChunkedBody.java:47)
            at com.predic8.membrane.core.http.AbstractBody.getContent(AbstractBody.java:100)
            at com.predic8.membrane.core.exchangestore.FileExchangeStore.writeFile(FileExchangeStore.java:177)
            at com.predic8.membrane.core.exchangestore.FileExchangeStore.snapInternal(FileExchangeStore.java:116)
            at com.predic8.membrane.core.exchangestore.FileExchangeStore.access$000(FileExchangeStore.java:52)
            at com.predic8.membrane.core.exchangestore.FileExchangeStore$1.bodyComplete(FileExchangeStore.java:88)
            at com.predic8.membrane.core.http.AbstractBody.markAsRead(AbstractBody.java:74)
            at com.predic8.membrane.core.http.ChunkedBody.markAsRead(ChunkedBody.java:60)
            at com.predic8.membrane.core.http.ChunkedBody.writeNotRead(ChunkedBody.java:135)
            at com.predic8.membrane.core.http.AbstractBody.write(AbstractBody.java:124)
            at com.predic8.membrane.core.http.ChunkedBody.write(ChunkedBody.java:55)
            at com.predic8.membrane.core.http.Message.write(Message.java:233)
            at com.predic8.membrane.core.transport.http.HttpClient.doCall(HttpClient.java:360)
            at com.predic8.membrane.core.transport.http.HttpClient.call(HttpClient.java:216)
            at com.predic8.membrane.core.interceptor.HTTPClientInterceptor.handleRequest(HTTPClientInterceptor.java:60)
            at com.predic8.membrane.core.interceptor.InterceptorFlowController.invokeRequestHandlers(InterceptorFlowController.java:106)
            at com.predic8.membrane.core.interceptor.InterceptorFlowController.invokeHandlers(InterceptorFlowController.java:71)
            at com.predic8.membrane.core.transport.http.AbstractHttpHandler.invokeHandlers(AbstractHttpHandler.java:70)
            at com.predic8.membrane.core.transport.http.HttpServerHandler.process(HttpServerHandler.java:234)
            at com.predic8.membrane.core.transport.http.HttpServerHandler.run(HttpServerHandler.java:119)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            at java.lang.Thread.run(Thread.java:748)
    [2020-08-03 13:56:42,318] DEBUG Response:376 - empty body created
    [2020-08-03 13:56:42,318] DEBUG InterceptorFlowController:126 - Invoking response handler: WSDL Rewriting Interceptor on exchange: [time:Aug 3, 2020,requestURI:/rest/]
    [2020-08-03 13:56:42,318] DEBUG RelocatingInterceptor:45 - WSDL Rewriting Interceptor HTTP method wasn't GET: No relocating done!
    

    Request headers

    Content-Type	application/json
    Accept	*/*
    User-Agent	Apache-CXF/3.2.6
    Cache-Control	no-cache
    Pragma	no-cache
    Host	report-test.xxxx.xxx:80
    Connection	keep-alive
    Transfer-Encoding	chunked
    X-Forwarded-For	xxx.xxx.xxx.xxx
    X-Forwarded-Proto	http
    X-Forwarded-Host	somehost.xxx.xx
    

    Request content

    {
        "bucketName": "expat",
        "objectName": "xxx.xxx-xx__E68_ex_lettre_etr_autre_20200803134639_1596462399846.pdf",
        "reportTemplateName": "EX_LETTRE_ETR_AUTRE",
        "reportLocale": "FR",
        "reportType": "pdf",
        "reportParameters": {
            "P_LOGO": "CIAM"
        },
        "data": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Document>....<\/Document>"
    }
    
    opened by jRom42 7
  • SwaggerProxy does not resolve some URLs

    SwaggerProxy does not resolve some URLs

    works fine. But:

    throws a FileNotFound Exception

    See the Mail Report from Brian below:

    I'm trying to proxy a toy swagger file using membrane but I keep getting the error pasted below. I was wondering if you had any idea what I'm doing wrong. The url to the swagger.json file is definitely valid. My proxies.xml file is attached Also, an unrelated question, does membrane support yaml formatted swagger files or does it only support json?

    The error: Membrane Router running... 20:25:39,211 INFO TrackingFileSystemXmlApplicationContext:583 - Refreshing Membrane Service Proxy's Spring Context 20:25:39,291 INFO XmlBeanDefinitionReader:317 - Loading XML bean definitions from URL [file:/home/bmason/Projects/membrane/membrane-service-proxy-4.6.2/conf/proxies.xml] 20:25:40,263 INFO DefaultLifecycleProcessor:345 - Starting beans in phase 0 org.springframework.context.ApplicationContextException: Failed to start bean 'router'; nested exception is java.lang.RuntimeException: com.predic8.membrane.core.resolver.ResourceRetrievalException: java.io.FileNotFoundException: swagger.json (No such file or directory) while retrieving swagger.json at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:176) at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:50) at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:350) at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:149) at org.springframework.context.support.DefaultLifecycleProcessor.start(DefaultLifecycleProcessor.java:92) at org.springframework.context.support.AbstractApplicationContext.start(AbstractApplicationContext.java:1305) at com.predic8.membrane.core.Router.init(Router.java:146) at com.predic8.membrane.core.RouterCLI.main(RouterCLI.java:42) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.predic8.membrane.core.Starter.main(Starter.java:26) Caused by: java.lang.RuntimeException: com.predic8.membrane.core.resolver.ResourceRetrievalException: java.io.FileNotFoundException: swagger.json (No such file or directory) while retrieving swagger.json at com.predic8.membrane.core.Router.start(Router.java:285) at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:173) ... 12 more Caused by: com.predic8.membrane.core.resolver.ResourceRetrievalException: java.io.FileNotFoundException: swagger.json (No such file or directory) while retrieving swagger.json at com.predic8.membrane.core.resolver.FileSchemaResolver.resolve(FileSchemaResolver.java:75) at com.predic8.membrane.core.resolver.ResolverMap.resolve(ResolverMap.java:181) at com.predic8.membrane.core.interceptor.swagger.SwaggerRewriterInterceptor.init(SwaggerRewriterInterceptor.java:80) at com.predic8.membrane.core.interceptor.AbstractInterceptor.init(AbstractInterceptor.java:105) at com.predic8.membrane.core.rules.AbstractProxy.init(AbstractProxy.java:171) at com.predic8.membrane.core.Router.init(Router.java:256) at com.predic8.membrane.core.Router.start(Router.java:270) ... 13 more Caused by: java.io.FileNotFoundException: swagger.json (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at com.predic8.membrane.core.resolver.FileSchemaResolver.resolve(FileSchemaResolver.java:73) ... 19 more

    bug 
    opened by predic8 7
  • Feature: smart node selection (load-balancing/failover) by monitoring failures

    Feature: smart node selection (load-balancing/failover) by monitoring failures

    The README of this GitHub project currently lists these 4 bullets under "What is Membrane":

    • a Service Virtualization layer,
    • an API Gateway,
    • a synchronous ESB for HTTP based Integration,
    • a Security Proxy.

    The 2 most important features for me are not listed: load-balancing and failover. As of now the built-in functionality is pretty basic.

    This feature request is for smarter handling. I'm going to contribute a DispatchingStrategy that monitors service failures and acts accordingly to them.

    opened by fabiankessler 7
  • Stray Thread hogging CPU after penetration testing with qualys

    Stray Thread hogging CPU after penetration testing with qualys

    We have witnessed an odd behavior of membrane at one of our customers after repeated abuse by qualys.

    It appears that with a chance of roughly 25%, their test creates a thread in membrane that does never end and eats up one CPU core. After 8 recorded tests, we had 2 stray threads with the following Stacktrace:

       java.lang.Thread.State: RUNNABLE
    	at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
    	at java.io.BufferedInputStream.skip(BufferedInputStream.java:380)
    	- locked <0x00000000e1cff1a8> (a java.io.BufferedInputStream)
    	at com.predic8.membrane.core.http.Body.discard(Body.java:90)
    	at com.predic8.membrane.core.http.Message.discardBody(Message.java:77)
    	at com.predic8.membrane.core.transport.http.HttpServerHandler.removeBodyFromBuffer(HttpServerHandler.java:269)
    	at com.predic8.membrane.core.transport.http.HttpServerHandler.process(HttpServerHandler.java:241)
    	at com.predic8.membrane.core.transport.http.HttpServerHandler.run(HttpServerHandler.java:119)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    
       Locked ownable synchronizers:
    	- <0x00000000e102cbc0> (a java.util.concurrent.ThreadPoolExecutor$Worker)
    

    We assume that the culprit is the following section in the Body class (in the discard() method)

    		while (toSkip > 0) {
    			toSkip -= inputStream.skip(toSkip);
    		}
    

    Which will never exit in case .skip continuously returns "0" (which is clearly possible, regarding both the javadoc of InputStream.skip and the implementation of BufferedInputStream.skip and .fill)

    Would it make any sense whatsoever to continue reading once .skip returned 0 or could we define this as a secondary exit parameter? Why are you pro-actively draining the inputstream anyways and don't just close it and let the operating system handle it?

    Added: After dumping the heap and analyzing it, we found the following content in the BufferedInputStream's Buffer which clearly shows the involvement of Qualys:

    POST /rest/json/login HTTP/1.1..Connection: Keep-Alive..Content-Type: application/json..X-Requested-With: XMLHttpRequest..Content-Length: 36..Host: 10.185.85.229..Qualys-Scan: VM....{"user":"admin","password":"admin"}ugins/kish-guest-posting/uploadify/scripts/uploadify.css HTTP/1.1..Host: hostname:9000..Connection: Keep-Alive..Qualys-Scan: VM....GET /Documentation.html HTTP/1.1..Host: hostname:9000..Connection: Keep-Alive..Qualys-Scan: VM....GET /wp-content/plugins/wp-property/third-party/uploadify/uploadify.css HTTP/1.1..Host: hostname:9000..Connection: Keep-Alive..Qualys-Scan: VM....GET /manager/templates/default/header.tpl HTTP/1.1..Host: hostname:9000..Connection: Keep-Alive..Qualys-Scan: VM....GET /console/login/LoginForm.jsp HTTP/1.1..Host: hostname:9000..Connection: Keep-Alive..Qualys-Scan: VM....GET /wp-content/plugins/easy-post-types/classes/custom-image/media.php?ref=ref"</script><iframe+onload%3Dalert(%2FQUALYSXSSTEST%2F)> H
    
    opened by DJGummikuh 6
  • How do I connect to a Private IP running https?

    How do I connect to a Private IP running https?

    I have problem with Private URL: https://192.168.69.64 How to configure the connection to?

    I configure the following, but it doesn't work

    <serviceProxy name="Proxy" port="2022">
    	<ssl>
    		<keystore location="***" password="***" keyPassword="***" />
    		<truststore location="***" password="***" />
    	</ssl>
    	<target host="192.68.69.64">
    		<ssl />
    	</target>		
    </serviceProxy>
    
    

    Please help me! Thanks!

    opened by phunghop 5
  • Fix Javascript Support in Membrane 5.X

    Fix Javascript Support in Membrane 5.X

    Membrane 5 uses Java 17 that does not contain a Javascript engine. The GraalVM Engine is with 25 MByte to big to bundle with Membrane. Maybe we can encapsulate the Engine in a Springbean and accessing an engine from the libs folder that the user has to download himself.

    bug 
    opened by predic8 2
  • Return in case of an error as Default JSON instead of HTML

    Return in case of an error as Default JSON instead of HTML

    The most common use case for Membrane is as an API Gateway. So wie should return a JSON structure as a default. For the HTML use cases we should still provide an HTML error message.

    enhancement Prio-2 
    opened by predic8 0
  • HTTP PROPFIND not supported properly

    HTTP PROPFIND not supported properly

    Hi,

    I am trying to use the service-proxy to reach a SVN server via HTTP. The local client talks HTTP to the Membrane service proxy, which in turns talks https to the SVN server. Here is my config (for some reasons the XML below does not display in read mode so I removed a few > or <...): serviceProxy port="7777"> target host="svn.myserver.com" port="443"> ssl ignoreTimestampCheckFailure="true" /> </target </serviceProxy

    It works fine from the browser, when I go against localhost:7777, but from the svn CLI it fails: $ svn co http://localhost:7777/svn/somerepo/ svn: E175002: Unexpected HTTP status 400 'Bad Request' on '/svn/!svn/vcc/default'

    On the Statistics page in the Membrane admin console, I see that we get status code 207 for the PROPFIND method.

    In the shell where I started the server, I see this: ERROR 22 RouterThread /127.0.0.1:46062 Header:149 - Header read line that caused problems: 0

    Any idea/quick fixes?

    At first I tried with service-proxy v4.8.7 and then it was just hanging forever. Now I am using v4.9.1 and I get this error.

    I have cloned the repo and compiled the code locally. Let me know if you want me to try something :)

    opened by minibiti 3
  • NumberFormatException from readChunkSize

    NumberFormatException from readChunkSize

    We are getting NumberFormatException while using the service, and looks like it's not able to handle the empty string.

    Below is the stack trace for the same:

    java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_312] at java.lang.Integer.parseInt(Integer.java:592) ~[?:1.8.0_312] at com.predic8.membrane.core.util.HttpUtil.readChunkSize(HttpUtil.java:99) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.ChunkedBody$1.readNextChunk(ChunkedBody.java:108) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.BodyInputStream.advanceToNextPosition(BodyInputStream.java:72) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.BodyInputStream.read(BodyInputStream.java:111) ~[service-proxy-core-4.8.7.jar:4.8.7] at java.io.InputStream.read(InputStream.java:101) ~[?:1.8.0_312] at com.predic8.membrane.core.util.ByteUtil.readStream(ByteUtil.java:71) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.ChunkedBody.read(ChunkedBody.java:49) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.AbstractBody.getLength(AbstractBody.java:146) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.ChunkedBody.getLength(ChunkedBody.java:225) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.Message.estimateHeapSize(Message.java:367) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.http.Request.estimateHeapSize(Request.java:211) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchange.AbstractExchange.estimateHeapSize(AbstractExchange.java:428) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchange.AbstractExchange.getHeapSizeEstimation(AbstractExchange.java:415) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchangestore.LimitedMemoryExchangeStore.hasEnoughSpace(LimitedMemoryExchangeStore.java:262) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchangestore.LimitedMemoryExchangeStore.makeSpaceIfNeeded(LimitedMemoryExchangeStore.java:253) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchangestore.LimitedMemoryExchangeStore.snapInternal(LimitedMemoryExchangeStore.java:128) ~[service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchangestore.LimitedMemoryExchangeStore.newSnap(LimitedMemoryExchangeStore.java:88) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.exchangestore.LimitedMemoryExchangeStore.snap(LimitedMemoryExchangeStore.java:58) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.interceptor.ExchangeStoreInterceptor.handle(ExchangeStoreInterceptor.java:84) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.interceptor.ExchangeStoreInterceptor.handleAbort(ExchangeStoreInterceptor.java:76) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.interceptor.InterceptorFlowController.invokeAbortionHandlers(InterceptorFlowController.java:147) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.interceptor.InterceptorFlowController.invokeHandlers(InterceptorFlowController.java:82) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.transport.http.AbstractHttpHandler.invokeHandlers(AbstractHttpHandler.java:70) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.transport.http.HttpServerHandler.process(HttpServerHandler.java:221) [service-proxy-core-4.8.7.jar:4.8.7] at com.predic8.membrane.core.transport.http.HttpServerHandler.run(HttpServerHandler.java:122) [service-proxy-core-4.8.7.jar:4.8.7] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_312] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_312]

    opened by AJANALKARS 3
Releases(v5.0.0-alpha-2)
Telegram API Client and Telegram BOT API Library and Framework in Pure java.

Javagram Telegram API Client and Telegram Bot API library and framework in pure Java. Hello Telegram You can use Javagram for both Telegram API Client

Java For Everything 3 Oct 17, 2021
A barebones WebSocket client and server implementation written in 100% Java.

Java WebSockets This repository contains a barebones WebSocket server and client implementation written in 100% Java. The underlying classes are imple

Nathan Rajlich 9.5k Dec 30, 2022
A multi-threaded downloader written in java

A multi-threaded downloader written in java

null 1 Feb 20, 2022
Short code snippets written by our open source community!

Code Examples This repository contains different code examples in different programming languages. Website https://codes.snowflakedev.org How do I con

SnowflakeDev Community ❄️ 64 Nov 13, 2022
Java API over Accelio

JXIO JXIO is Java API over AccelIO (C library). AccelIO (http://www.accelio.org/) is a high-performance asynchronous reliable messaging and RPC librar

Accelio 75 Nov 1, 2022
Check the connectivity of a server with this API.

ServerStatusAPI Presentation : This is a java API with which can test the conectivity of server (all server but you can also use for minecraft). The f

Gabriel MERCIER 1 Mar 16, 2022
Standalone Play WS, an async HTTP client with fluent API

Play WS Standalone Play WS is a powerful HTTP Client library, originally developed by the Play team for use with Play Framework. It uses AsyncHttpClie

Play Framework 213 Dec 15, 2022
Java library for representing, parsing and encoding URNs as in RFC2141 and RFC8141

urnlib Java library for representing, parsing and encoding URNs as specified in RFC 2141 and RFC 8141. The initial URN RFC 2141 of May 1997 was supers

SLUB 24 May 10, 2022
Pcap editing and replay tools for *NIX and Windows - Users please download source from

Tcpreplay Tcpreplay is a suite of GPLv3 licensed utilities for UNIX (and Win32 under Cygwin) operating systems for editing and replaying network traff

AppNeta, Inc. 956 Dec 30, 2022
Android application allowing to sniff and inject Zigbee, Mosart and Enhanced ShockBurst packets on a Samsung Galaxy S20

RadioSploit 1.0 This Android application allows to sniff and inject Zigbee, Mosart and Enhanced ShockBurst packets from a Samsung Galaxy S20 smartphon

Romain Cayre 52 Nov 1, 2022
An annotation-based Java library for creating Thrift serializable types and services.

Drift Drift is an easy-to-use, annotation-based Java library for creating Thrift clients and serializable types. The client library is similar to JAX-

null 225 Dec 24, 2022
ssh, scp and sftp for java

sshj - SSHv2 library for Java To get started, have a look at one of the examples. Hopefully you will find the API pleasant to work with :) Getting SSH

Jeroen van Erp 2.2k Jan 8, 2023
A Java library for capturing, crafting, and sending packets.

Japanese Logos Pcap4J Pcap4J is a Java library for capturing, crafting and sending packets. Pcap4J wraps a native packet capture library (libpcap, Win

Kaito Yamada 1k Dec 30, 2022
Full-featured Socket.IO Client Library for Java, which is compatible with Socket.IO v1.0 and later.

Socket.IO-client Java This is the Socket.IO Client Library for Java, which is simply ported from the JavaScript client. See also: Android chat demo en

Socket.IO 5k Jan 4, 2023
Asynchronous Http and WebSocket Client library for Java

Async Http Client Follow @AsyncHttpClient on Twitter. The AsyncHttpClient (AHC) library allows Java applications to easily execute HTTP requests and a

AsyncHttpClient 6k Dec 31, 2022
A Java event based WebSocket and HTTP server

Webbit - A Java event based WebSocket and HTTP server Getting it Prebuilt JARs are available from the central Maven repository or the Sonatype Maven r

null 808 Dec 23, 2022
tasks, async await, actors and channels for java

AsyncUtils tasks, async, await, actors and channels for java This project tries to explore several approaches to simplify async/concurrent programming

Michael Hoffer 6 Dec 1, 2022
A small java project consisting of Client and Server, that communicate via TCP/UDP protocols.

Ninja Battle A small java project consisting of Client and Server, that communicate via TCP/UDP protocols. Client The client is equipped with a menu i

Steliyan Dobrev 2 Jan 14, 2022