I'm with Dino. I think you should convince your card processing
service people to provide you with a decent schema. My chief concern
is in regards to future maintenance. What if these "card processing
service" people decide to change the message structure at some point
in the future. Do they have a plan to inform you of these changes?
If they aren't willing to provide you with a schema, then it's
relatively easy for you to construct one from the format they've
supplied. Do you know if they are using any namespaces in the XML
string? Your sample shows no namespaces, but if they add them, that
will definitely impact your WSDL definition.
Your schema should look like this:
<s:element name="GetAVSResponseCodeValueResponse">
<s:complexType>
<s:sequence>
<s:element name="NewDataSet">
<s:complexType>
<s:sequence>
<s:element name="s:AVSRespCode">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1"
name="AVSCode" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1"
name="AVSMessage" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1"
name="ID" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1"
name="Status" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
- Anne
On Mon, 28 Feb 2005 14:43:23 -0800, Dino Chiesa <[EMAIL PROTECTED]> wrote:
> Not stupid...
>
> Your approach is reasonable, but... Can you not contact the "card
> processing service" people and ask them to resolve the difference
> between the doc and the WSDL ?
>
>
> -----Original Message-----
> From: Elaine Nance [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 28, 2005 3:45 PM
> To: [email protected]
> Subject: Handmade WSDL?
>
> Hope this is not stupid, but
>
> Problem: the wsdl for our (supposedly) enterprise credit card
> processing service shows well defined request parameters, but the
> SOAP responses are all designated as string, as shown below.
>
> I am thinking that the best way to generate the client stubs I need in
> Java is to create a wsdl with better response typing and generate the
> stubs using WSDL2Java and then test.
>
> Does it make sense to proceed like the above? or should I just build
> parsers using SAX or DOM or whatever?
>
> Thank you,
> Elaine
>
> - example request
> <s:element name="GetAVSResponseCodeValue">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1" name="sCode"
> type="s:string" />
> </s:sequence>
> </s:complexType>
> </s:element>
>
> - example response as given
> <s:element name="GetAVSResponseCodeValueResponse">
> <s:complexType>
> <s:sequence>
> <s:element minOccurs="0" maxOccurs="1"
> name="GetAVSResponseCodeValueResult" type="s:string" />
> </s:sequence>
> </s:complexType>
> </s:element>
>
> - WHAT THE RESPONSE SHOULD LOOK LIKE (I THINK) <s:element
> name="GetAVSResponseCodeValueResponse">
> <s:complexType type="s:AVSRespCode">
> <s:sequence>
> <s:element minOccurs="1" maxOccurs="1" name="AVSCode"
> type="s:string"/>
> <s:element minOccurs="1" maxOccurs="1" name="AVSMessage"
> type="s:string"/>
> <s:element minOccurs="1" maxOccurs="1" name="ID"
> type="s:string"/>
> <s:element minOccurs="1" maxOccurs="1" name="Status"
> type="s:string"/>
> </s:sequence>
> </s:complexType>
> </s:element>
>
> - ALTERNATIVELY
> <s:element name="GetAVSResponseCodeValueResponse">
> <s:complexType type="s:NewDataSet">
> <s:sequence type="s:AVSRespCode">
> <s:element minOccurs="1" maxOccurs="1" name="AVSCode"
> type="s:string"/>
> <s:element minOccurs="1" maxOccurs="1" name="AVSMessage"
> type="s:string"/>
> <s:element minOccurs="1" maxOccurs="1" name="ID"
> type="s:string"/>
> <s:element minOccurs="1" maxOccurs="1" name="Status"
> type="s:string"/>
> </s:sequence>
> </s:complexType>
> </s:element>
>
> - the web service docs indicate that the xml returned (minus SOAP
> envelope) will look like the following:
>
> <NewDataSet>
> <AVSRespCode>
> <AVSCode>1</AVSCode>
> <AVSMessage>No Address Supplied</AVSMessage>
> <ID>1</ID>
> <Status>E</Status>
> </AVSRespCode>
> </NewDataSet>
>
> <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> | Computers are useless. They can only give you answers.
> | -- Pablo Picasso --
> <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>