I generated a XML output from a database (MSSQL2014) and now would like to consume the data as well as the XSD schema information into a R data frame.
Data Source: MSSQL2014 - AdventureWorks2014 database
Query executed:
select top 1 *
from person.person as p
join person.EmailAddress as ea on p.businessEntityID = ea.businessentityID
join person.PersonPhone as pphone on p.businessEntityID = pphone.businessentityID
for XML AUTO, ELEMENTS, XMLSCHEMA('person');
Below is the File generate. I tried this R code to import but it is unsuccessful. Does anyone have a guide/tip to point me to the right direction?
RCode:
library(XML)
(xml_data <- xmlParse(gsub(" ", "", "C:\\dissertation\\smta\\indata\\01_Source_Query.XML", fixed = TRUE), asText = TRUE))
xml_attrib <- xpathSApply(doc=xml, path="//person", xmlAttrs)
df2 <- data.frame(t(xml_attrib))
df2
<xsd:schema targetNamespace="person" xmlns:schema="person" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sqltypes="http://schemas.microsoft.com/sqlserver/2004/sqltypes" elementFormDefault="qualified">
<xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/sqltypes" schemaLocation="http://schemas.microsoft.com/sqlserver/2004/sqltypes/sqltypes.xsd" />
<xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo" />
<xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactRecord" />
<xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes" />
<xsd:import namespace="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey" />
<xsd:element name="p">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="BusinessEntityID" type="sqltypes:int" />
<xsd:element name="PersonType">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="2" /></xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NameStyle" type="sqltypes:bit" sqltypes:sqlTypeAlias="[AdventureWorks2014].[dbo].[NameStyle]" />
<xsd:element name="Title" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="8" /></xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="FirstName">
<xsd:simpleType sqltypes:sqlTypeAlias="[AdventureWorks2014].[dbo].[Name]">
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" /></xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="MiddleName" minOccurs="0">
<xsd:simpleType sqltypes:sqlTypeAlias="[AdventureWorks2014].[dbo].[Name]">
<xsd:restri ction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" /></xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="LastName">
<xsd:simpleType sqltypes:sqlTypeAlias="[AdventureWorks2014].[dbo].[Name]">
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" /></xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="Suffix" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="10" /></xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="EmailPromotion" type="sqltypes:int" />
<xsd:element name="AdditionalContactInfo" minOccurs="0">
<xsd:complexType sqltypes:xmlSchemaCollection="[AdventureWorks2014].[Person].[AdditionalContactInfoSchemaCollection]">
<xsd:complexContent>
<xsd:restriction base="sqltypes:xml">
<xsd:sequence>
<xsd:any processContents="strict" minOccurs="0" maxOccurs="unbounded" namespace="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactRecord http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes"
/></xsd:sequence>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="Demographics" minOccurs="0">
<xsd:complexType sqltypes:xmlSchemaCollection="[AdventureWorks2014].[Person].[IndividualSurveySchemaCollection]">
<xsd:complexContent>
<xsd:restriction base="sqltypes:xml">
<xsd:sequence>
<xsd:any processContents="strict" minOccurs="0" maxOccurs="unbounded" namespace="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey" /></xsd:sequence>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
<xsd :element name="rowguid" type="sqltypes:uniqueidentifier" />
<xsd:element name="ModifiedDate" type="sqltypes:datetime" />
<xsd:element ref="schema:ea" minOccurs="0" maxOccurs="unbounded" /></xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ea">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="BusinessEntityID" type="sqltypes:int" />
<xsd:element name="EmailAddressID" type="sqltypes:int" />
<xsd:element name="EmailAddress" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="50" /></xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="rowguid" type="sqltypes:uniqueidentifier" />
<xsd:element name="ModifiedDate" type="sqltypes:datetime" />
<xsd:element ref="schema:pphone" minOccurs="0" maxOccurs="unbounded" /></xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="pphone">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="BusinessEntityID" type="sqltypes:int" />
<xsd:element name="PhoneNumber">
<xsd:simpleType sqltypes:sqlTypeAlias="[AdventureWorks2014].[dbo].[Phone]">
<xsd:restriction base="sqltypes:nvarchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
<xsd:maxLength value="25" /></xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PhoneNumberTypeID" type="sqltypes:int" />
<xsd:element name="ModifiedDate" type="sqltypes:datetime" /></xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<p xmlns="person">
<BusinessEntityID>1</BusinessEntityID>
<PersonType>EM</PersonType>
<NameStyle>0</NameStyle>
<FirstName>Ken</FirstName>
<MiddleName>J</MiddleName>
<LastName>Sánchez</LastName>
<EmailPromotion>0</EmailPromotion>
<Demographics>
<IndividualSurvey xmlns="http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey">
<TotalPurchaseYTD>0</TotalPurchaseYTD>
</IndividualSurvey>
</Demographics>
<rowguid>92C4279F-1207-48A3-8448-4636514EB7E2</rowgu id>
<ModifiedDate>2009-01-07T00:00:00</ModifiedDate>
<ea>
<BusinessEntityID>1</BusinessEntityID>
<EmailAddressID>1</EmailAddressID>
<EmailAddress>ken0#adventure-works.com</EmailAddress>
<rowguid>8A1901E4-671B-431A-871C-EADB2942E9EE</rowguid>
<ModifiedDate>2009-01-07T00:00:00</ModifiedDate>
<pphone>
<BusinessEntityID>1</BusinessEntityID>
<PhoneNumber>697-555-0142</PhoneNumber>
<PhoneNumberTypeID>1</PhoneNumberTypeID>
<ModifiedDate>2009-01-07T00:00:00</ModifiedDate>
</pphone>
</ea>
</p>
I prefer the rest/xml2 package for parsing files.
library(xml2)
library(rvest)
page<-read_html("C:\\dissertation\\smta\\indata\\01_Source_Query.XML")
persons<-html_nodes(page, xpath = "//p")
fieldnames<-xml_name(xml_find_all(persons, ".//*"))
fields<-xml_text(xml_find_all(persons, ".//*"))
df<-data.frame(fieldnames, fields)
The file seems to be interested as html. The code above reads the data file finds the paragraph tag for the persons and extracts the field names and values and places them into a data frame. If there are multiple persons in your file then the lines defining field names and values will need to be vectorized (most likely with supply). Some clean-up is required to remove a few extraneous rows added to the final data frame.
Good luck.
Related
I have a very simple row based document in which each row comprises a record. I want to have a DFDL that parses it into chunks that contains fixed number of rows(say, for example 3 records at each chunk).
Original File:
record1
record2
record3
record4
record5
record6
record7
After DFDL Parse:
1) [record1, record2, record3]
2) [record4, record5, record6]
3) [record7]
I am currently able to get all records at once with the following DFDL, but it creates a serious problem when the size of document gets bigger, that' s why i want to get these records page by page. Is it possible to do this? Does anyone have any idea how can this be done?
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:ibmDfdlExtn="http://www.ibm.com/dfdl/extensions" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions" xmlns:recSepFieldsFmt="http://www.ibm.com/dfdl/RecordSeparatedFieldFormat" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.ibm.com/dfdl/RecordSeparatedFieldFormat" schemaLocation="../IBMdefined/RecordSeparatedFieldFormat.xsd"/>
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format byteOrder="{$dfdl:byteOrder}" encoding="{$dfdl:encoding}" escapeSchemeRef="recSepFieldsFmt:RecordEscapeScheme" occursCountKind="fixed" ref="recSepFieldsFmt:RecordSeparatedFieldsFormat"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:element dfdl:encoding="{$dfdl:encoding}" ibmSchExtn:docRoot="true" name="MM1">
<xsd:complexType>
<xsd:sequence dfdl:separator="%CR;%LF;%WSP*;" dfdl:terminator="">
<xsd:element dfdl:alignment="1" dfdl:escapeSchemeRef="" dfdl:lengthKind="delimited" dfdl:occursCountKind="implicit" maxOccurs="unbounded" name="body" type="xsd:string">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Thanks
<xsd:element ibmSchExtn:docRoot="true" name="MM1">
<xsd:complexType>
<xsd:sequence dfdl:separator="" dfdl:terminator="">
<xsd:element dfdl:occursCountKind="implicit" maxOccurs="unbounded" name="Chunk">
<xsd:complexType>
<xsd:sequence dfdl:separator="%CR;%LF;%WSP*;" dfdl:terminator="">
<xsd:element dfdl:lengthKind="delimited" dfdl:occursCountKind="implicit" maxOccurs="3" name="Body" type="xsd:string">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
I have a bpel process which receive an array and output another one.
The thing is, I need to get the first one elements, populate the second one and add some for elements in the second one.
My first one array is from this kind of object:
<xsd:complexType name="comment_A">
<xsd:sequence>
<xsd:element name="id" type="xsd:int"/>
<xsd:element name="username" type="xsd:string"/>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="picture" type="xsd:base64Binary"/>
<xsd:element name="date" type="xsd:string"/>
<xsd:element name="hour" type="xsd:string"/>
<xsd:element name="bus-line" type="xsd:string"/>
<xsd:element name="bus-number" type="xsd:integer"/>
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="rate" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
My second one:
<xsd:complexType name="comment_B">
<xsd:sequence>
<xsd:element name="id" type="xsd:int"/>
<xsd:element name="username" type="xsd:string"/>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="picture" type="xsd:base64Binary"/>
<xsd:element name="date" type="xsd:string"/>
<xsd:element name="hour" type="xsd:string"/>
<xsd:element name="bus-line" type="xsd:string"/>
<xsd:element name="bus-number" type="xsd:integer"/>
<xsd:element name="description" type="xsd:string"/>
<xsd:element name="rate" type="xsd:int"/>
<xsd:element name="type-comment" type="xsd:string"/>
<xsd:element name="liked-number" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
So first, I tried iterate over the first array to populate the second one with properties which both have in common. I tried use forEach element.
My code seems like this:
<forEach parallel="yes" counterName="c" name="forEachComment">
<startCounterValue>1</startCounterValue>
<finalCounterValue>count($comments.VwCommentCollection/ns3:VwComment)</finalCounterValue>
<scope name="Scope1">
<assign name="assignResult">
<extensionAssignOperation>
<bpelx:copyList>
<bpelx:from>$comments.VwCommentCollection[$c]</bpelx:from>
<bpelx:to>$outputVariable.payload</bpelx:to>
</bpelx:copyList>
</extensionAssignOperation>
<copy>
<from>$comments.VwCommentCollection[$c]/ns3:VwComment/ns3:id</from>
<to>$outputVariable.payload/ns2:comment/ns2:id</to>
</copy>
</assign>
</scope>
</forEach>
I tried do this first just with id element for a test, however when the comment_A array has size greater than 1, I receive an exception
$comment is my variable which comment_A array
I found a solution following this Brazilian blog: http://blog.iprocess.com.br/2012/09/oracle-soa-suite-11g-uso-da-atividade-assign-no-bpel/
I used append opperation inside BPEL
I'm trying to unmarshal a large xhtml document using XSD's and jaxb. I've got everything working except for one part, which contains pure html. Here is an example of the xhtml I'm getting (I am able to grab every element except the "content"):
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text">...</title>
<id>...</id>
<updated>...</updated>
<entry>
<id>...</id>
<title type="text">...</title>
<updated>...</updated>
<author>
<name>...</name>
</author>
<content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
<div>{html...}<div>{html...}</div>/<div>/<div>
</content>
</entry>
</feed>
Here's an expansion of the xsd file:
<xsd:complexType name="ApCategoriesJAXB" >
<xsd:sequence>
<xsd:element name="id" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element name="title" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element name="updated" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element name="link" type="tns:ApLinkJAXB" minOccurs="0"></xsd:element>
<xsd:element name="entry" type="tns:ApEntryJAXB" minOccurs="0" maxOccurs="unbounded"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ApEntryJAXB">
<xsd:sequence>
<xsd:element name="id" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element name="name" type="xsd:string" minOccurs="0"></xsd:element>
<xsd:element name="title" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element name="updated" type="xsd:string" minOccurs="1" maxOccurs="1"></xsd:element>
<xsd:element name="author" type="tns:ApAuthorJAXB" minOccurs="0"></xsd:element>
<xsd:element name="link" type="tns:ApLinkJAXB" minOccurs="0"></xsd:element>
<xsd:element name="category" type="tns:ApCategoryJAXB" minOccurs="0"></xsd:element>
<xsd:element name="content" type="tns:ApContentJAXB" minOccurs="0"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ApCategoryJAXB" >
<xsd:sequence></xsd:sequence>
<xsd:attribute name="term" type="xsd:string" />
<xsd:attribute name="label" type="xsd:string" />
<xsd:attribute name="scheme" type="xsd:string" />
</xsd:complexType>
<xsd:complexType name="ApContentJAXB" >
<xsd:sequence>
<xsd:element name="div" type="tns:ApDivJAXB" minOccurs="0" maxOccurs="unbounded"></xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ApDivJAXB" >
<xsd:sequence>
<xsd:any namespace="http://www.w3.org/2005/Atom" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
I have tried every combination of nested xsd elements, complexTypes, xsd:any etc etc and cannot seem to get this "content" value no matter what I try. I am happy to take all the html as a string, or unmarshal it into an object.
Thank you in advance for any thoughts.
** I've edited the xsd part to include relevant parts. I've tried both nesting the "any" element in the "div" complexType as seen, as well as skipping the "div" complexType altogether.
Thanks again.
If you want <content> to have a type of xsd:string, you need to encode or otherwise escape the HTML. You could use CDATA sections, Base64 encoding, or escape all the entities (e.g. < to <, etc.).
Otherwise, xsd:any should work. Can you provide a more complete example of your XSD when you tried this?
I am seeing certain nodes of my SOAP response disappearing in Flex 4. I am using an <mx:WebService> that is written using PHP/nusoap and 99% of the responses are unserialized correctly in Flex. For some reason this snippet is causing problems:
RAW XML:
<data xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:reportData[1]">
<item xsi:type="tns:reportData">
<name xsi:type="xsd:string">Tue. 8 Mar. 2011</name>
<year xsi:type="xsd:int">2011</year>
<month xsi:type="xsd:int">3</month>
<day xsi:type="xsd:int">8</day>
<counts xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:double[3]">
<item xsi:type="xsd:double">26</item>
<item xsi:type="xsd:double">11</item>
<item xsi:type="xsd:double">11</item>
</counts>
</item>
</data>
The only element to show in the Flex ProxyObject is "name". All other values are simply ignored.
The WSDL defines reportData as:
<xsd:complexType name="reportData">
<xsd:all>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="url" type="xsd:string"/>
<xsd:element name="year" type="xsd:int"/>
<xsd:element name="month" type="xsd:int"/>
<xsd:element name="day" type="xsd:int"/>
<xsd:element name="hour" type="xsd:int"/>
<xsd:element name="counts" type="tns:reportCountList"/>
<xsd:element name="breakdown_total" type="tns:reportCountList"/>
<xsd:element name="breakdown" type="tns:reportDataList"/>
</xsd:all>
</xsd:complexType>
Any ideas why this XML will not unserialize correctly?
From the comments above:
According to w3.org/TR/2001/REC-xmlschema-1-20010502/#element-all minOccurs defaults to 1 meaning it needs to be explicitly set to minOccurs=0 in the WSDL.
The above SOAP response was missing the required url element. Changing the WSDL to explicitly define the url element as optional minOccurs="0" fixes the issue.
Im totally new to SOAP HTTP Requests. Can someone give me a broad rundown on things that might slow it down. Im working on a .NET application that uses SOAP, WSDL. The request is taking around 50 seconds, everytime. Im probably making no sense, so please excuse my ignorance. Could there be something I could do at my end, to allow the request to run without causing the page not to load. AJAX maybe.
--M
Edit (09/08/2009):
OK, i've used SOAPUI and its coming up with two options WebServiceSoap12 and WebServiceSoap. The first one is goving me a speedy milliseconds response, and the second is giving me a "400 Bad Request. Why would I need that second one?
Below is the WSDL
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.example.com" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.example.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.example.com">
<s:element name="EventGetList">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="regionId" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="EventGetListResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="EventGetListResult" type="tns:ArrayOfOpenEvent" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="ArrayOfOpenEvent">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="OpenEvent" nillable="true" type="tns:OpenEvent" />
</s:sequence>
</s:complexType>
<s:complexType name="OpenEvent">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Id" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Title" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="EventStart" type="s:dateTime" />
<s:element minOccurs="1" maxOccurs="1" name="EventEnd" type="s:dateTime" />
<s:element minOccurs="0" maxOccurs="1" name="RegionId" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EventSubject" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EventAdditionalDetails" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EventDelivery" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Location" type="tns:EventLocation" />
<s:element minOccurs="1" maxOccurs="1" name="OnlineRegistrations" type="s:boolean" />
</s:sequence>
</s:complexType>
<s:complexType name="EventLocation">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="Name" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Address1" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Address2" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Address3" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Town" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Postcode" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="AddressOther" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="EventRegisterClient">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="registration" type="tns:OpenEventRegistration" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="OpenEventRegistration">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="EventId" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="ForeName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Surname" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="TelephoneNumber" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="EmailAddress" type="s:string" />
</s:sequence>
</s:complexType>
<s:element name="EventRegisterClientResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="EventRegisterClientResult" type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="EventGetListSoapIn">
<wsdl:part name="parameters" element="tns:EventGetList" />
</wsdl:message>
<wsdl:message name="EventGetListSoapOut">
<wsdl:part name="parameters" element="tns:EventGetListResponse" />
</wsdl:message>
<wsdl:message name="EventRegisterClientSoapIn">
<wsdl:part name="parameters" element="tns:EventRegisterClient" />
</wsdl:message>
<wsdl:message name="EventRegisterClientSoapOut">
<wsdl:part name="parameters" element="tns:EventRegisterClientResponse" />
</wsdl:message>
<wsdl:portType name="WebServiceSBSpEventsSoap">
<wsdl:operation name="EventGetList">
<wsdl:input message="tns:EventGetListSoapIn" />
<wsdl:output message="tns:EventGetListSoapOut" />
</wsdl:operation>
<wsdl:operation name="EventRegisterClient">
<wsdl:input message="tns:EventRegisterClientSoapIn" />
<wsdl:output message="tns:EventRegisterClientSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="WebServiceSBSpEventsSoap" type="tns:WebServiceSBSpEventsSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="EventGetList">
<soap:operation soapAction="http://www.example.com/EventGetList" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="EventRegisterClient">
<soap:operation soapAction="http://www.example.com/EventRegisterClient" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="WebServiceSBSpEventsSoap12" type="tns:WebServiceSBSpEventsSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="EventGetList">
<soap12:operation soapAction="http://www.example.com/EventGetList" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="EventRegisterClient">
<soap12:operation soapAction="http://www.example.com/EventRegisterClient" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="WebServiceSBSpEvents">
<wsdl:port name="WebServiceSBSpEventsSoap" binding="tns:WebServiceSBSpEventsSoap">
<soap:address location="http://www.example.com/webserviceexternal/WebServiceSBSpEvents.asmx" />
</wsdl:port>
<wsdl:port name="WebServiceSBSpEventsSoap12" binding="tns:WebServiceSBSpEventsSoap12">
<soap12:address location="http://www.example.com/webserviceexternal/WebServiceSBSpEvents.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
You should first try to pinpoint the cause of the delay, as there could be many reasons for it. Your main interest would be if the delay happens on the side of the server or on the side of (your) client.
If the delay is on the server side of things (might be a complicated operation to create a result, might be slow server, etc.), then you can look for workarounds to deal with that in your client, e.g.:
creating the page first and pulling the data from the service afterward via ajax, as you suggested
pulling the data from the service upfront in regular intervals and storing it in a local cache from which you construct your pages
etc...
If the delay is happening on the client side, you should try to find the root cause (e.g. network configuration, timeouts with reverse lookups, etc.) and fix it ;)
Edit: Given the posted wsdl, the web service offers itself in two variations, one for 'default' SOAP and one for SOAP 1.2. The 400 response indicates that the client is issuing the request in a non standard conform way, but it might also be that the service end is not properly set up for the protocol version it says to offer in the wsdl.
As for why you'd need one or the other, the answer is simple: Both offer the exact same methods, so you only need one. It could be that the delay is caused by your client first trying to use the defunct version a couple of times and only switching to the other after a while - but this is just guesswork. If SOAPUI works ok with the 1.2 version, I'd just try to tell the client to use that and see if that speeds things up.