Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Wasn't sure where to post this question, so I'll post it here.

I'm reading this API, and creating an XSD file to code against.
This API, has all the names prefixed with v1:

The API says
The First Data Global Gateway Web Service API uses HTTPS and SOAP to communicate with
your applications. As such, it is completely platform independent. The choice of languages,
frameworks, or tools to integrate with the Web Service API is up to you.

Regardless of the transaction type, the basic XML document structure
of a credit card transaction is as follows:
<fdggwsapi:FDGGWSApiOrderRequest 
xmlns:v1="http://secure.linkpt.net/fdggwsapi/schemas_us/v1" 
xmlns:fdggwsapi="http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi">
 <v1:Transaction>
  <v1:CreditCardTxType>...</v1:CreditCardTxType>
  <v1:CreditCardData>...</v1:CreditCardData>
  <v1:Payment>...</v1:Payment>
  <v1:TransactionDetails>...</v1:TransactionDetails>
  <v1:Billing>...</v1:Billing>
  <v1:Shipping>...</v1:Shipping>
 </v1:Transaction>
</fdggwsapi:FDGGWSApiOrderRequest>

End of API Says

It's been awhile since I wrote a XSD file, not sure if I've seen this before, perhaps in another format.
But It won't pass the XSD validator because it's invalid of course.

What do you guys think,
dump the v1's.
Add something that will prefix v1.
Or just wait days for vendor tech support to answer the question, which I doubt.
Code against it using another method.
<xs:schema attributeformdefault="unqualified" elementformdefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:attribute name="xmlns:v1" type="xs:string" />
  <xs:attribute name="xmlns:fdggwsapi" type="xs:string" />
  <xs:element name="v1:Transaction">
    <xs:complextype>
      <xs:sequence>
        <xs:element name="v1:CreditCardTxType">
          <xs:complextype>
            <xs:sequence>
              <xs:element name="v1:Type" type="xs:string" />
            </xs:sequence>
          </xs:complextype>
        </xs:element>
        <xs:element name="v1:CreditCardData">
          <xs:complextype>
            <xs:sequence>
              <xs:element name="v1:CardNumber" type="xs:string" />
              <xs:element name="v1:ExpMonth" type="xs:string" />
              <xs:element name="v1:ExpYear" type="xs:string" />
              <xs:element name="v1:CardCodeValue" type="xs:string" />
            </xs:sequence>
          </xs:complextype>
        </xs:element>       
      </xs:sequence>
    </xs:complextype>
  </xs:element>
</xs:schema>
Posted
Updated 18-Dec-14 6:54am
v2

I think you have an error in the beginning of the XSD.

XML
<xs:schema attributeformdefault="unqualified" elementformdefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:attribute name="xmlns:v1" type="xs:string" />
  <xs:attribute name="xmlns:fdggwsapi" type="xs:string" />

Should be:
XML
<xs:schema attributeformdefault="unqualified" elementformdefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:v1="http://secure.linkpt.net/fdggwsapi/schemas_us/v1" 
xmlns:fdggwsapi="http://secure.linkpt.net/fdggwsapi/schemas_us/fdggwsapi">
</xs:schema>
 
Share this answer
 
v2
Comments
jkirkerx 18-Dec-14 12:32pm    
Yah, I'm kind of fuzzy on those attributes in the first element.
Not quite sure how to implement that. I wrote it by hand, and modeled it using Liquid XML, community mode.
George Jonsson 18-Dec-14 22:48pm    
Well you put the attributes outside the element and directly on the schema level which is not correct.
(I also saw I had a > too many inside the declaration, that I have removed.)
Good that you found a solution. :)
jkirkerx 18-Dec-14 23:34pm    
Those attr threw for a loop. Not use to them at that level.
The company had several sets of API's and some wsdl's. I was pointed to the wrong set by the sales rep, and tech support told me to use the new wsdl.

I'll take it for a spin Friday, and see which one works better.

I did finish the XSD file, and compiled it against xsd.exe for a class to code against in asp.net.

First data seems to be sort of confusing when it comes to documentation, compared to others I have worked with.
Called tech support and got the other API, which is just straight XML, no v1's and those other pesky attributes.

I'm not sure what to think here.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900