Ik heb een Web Service die via een .wsdl file zaken uit SAP ophaalt. WSDL bestand in kwestie ziet er als volgt uit:
Een bijhorende request ziet er als volgt uit
Ik heb in mijn .NET project een Service Reference toegevoegd. Vervolgens zijn er tal van klasses waar ik een instantie kan van aanmaken.
Ik vind echter niet hoe ik de request kan doorgeven, en de daarop volgende response kan ophalen. Dien ik alles te parsen om zo de informatie van de request en response bruikbaar te maken? Nu zit deze namelijk tussen tags "verstopt"? Ik heb reeds volgende tutorial gevonden maar loop wat vast.
Zie ik iets over het hoofd, heb ik een totaal verkeerde aanpak?
.
XML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
| <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions name="Customer_Out" targetNamespace="..." xmlns:p1="...." xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:documentation/> <wsp:UsingPolicy wsdl:required="true"/> <wsp:Policy wsu:Id="OP_CustomerRead_sync"/> <wsdl:types> <xsd:schema targetNamespace="..." xmlns="..." xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="MT_CustomerRead_response" type="DT_CustomerRead_response"/> <xsd:element name="FMT_Customer"> <xsd:complexType> <xsd:sequence> <xsd:element name="standard" type="ExchangeFaultData"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="MT_CustomerRead_request" type="DT_CustomerRead_request"/> <xsd:complexType name="ExchangeFaultData"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/VersionID">..</xsd:appinfo> </xsd:annotation> <xsd:sequence> <xsd:element name="faultText" type="xsd:string"/> <xsd:element name="faultUrl" type="xsd:string" minOccurs="0"/> <xsd:element name="faultDetail" type="ExchangeLogData" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="DT_Customer"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/VersionID">...</xsd:appinfo> </xsd:annotation> <xsd:sequence> <xsd:element name="BpId" type="xsd:string"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="Name" type="xsd:string"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="AccountGroup" type="xsd:string" minOccurs="0"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="Street" type="xsd:string" minOccurs="0"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="Number" type="xsd:string" minOccurs="0"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="City" type="xsd:string" minOccurs="0"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="Country" type="xsd:string" minOccurs="0"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="Region" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="DT_CustomerRead_request"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/VersionID">...</xsd:appinfo> </xsd:annotation> <xsd:sequence> <xsd:element name="RowLimit" type="xsd:integer"/> <xsd:element name="BpId" minOccurs="0"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:maxLength value="10"/> </xsd:restriction> </xsd:simpleType> </xsd:element> <xsd:element name="Name" type="xsd:string" minOccurs="0"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="ExternalCustomer" type="xsd:string" minOccurs="0"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="AccountGroup" type="xsd:string" minOccurs="0"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ExchangeLogData"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/VersionID">...</xsd:appinfo> </xsd:annotation> <xsd:sequence> <xsd:element name="severity" type="xsd:string" minOccurs="0"/> <xsd:element name="text" type="xsd:string"/> <xsd:element name="url" type="xsd:string" minOccurs="0"/> <xsd:element name="id" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="DT_CustomerRead_response"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/VersionID">...</xsd:appinfo> </xsd:annotation> <xsd:sequence> <xsd:element name="Customer" type="DT_Customer" minOccurs="0" maxOccurs="unbounded"> <xsd:annotation> <xsd:appinfo source="http://sap.com/xi/TextID">...</xsd:appinfo> </xsd:annotation> </xsd:element> <xsd:element name="Remark" type="xsd:string" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:schema> </wsdl:types> <wsdl:message name="MT_CustomerRead_request"> <wsdl:documentation/> <wsdl:part name="MT_CustomerRead_request" element="p1:MT_CustomerRead_request"/> </wsdl:message> <wsdl:message name="MT_CustomerRead_response"> <wsdl:documentation/> <wsdl:part name="MT_CustomerRead_response" element="p1:MT_CustomerRead_response"/> </wsdl:message> <wsdl:message name="FMT_Customer"> <wsdl:documentation/> <wsdl:part name="FMT_Customer" element="p1:FMT_Customer"/> </wsdl:message> <wsdl:portType name="Customer_Out"> <wsdl:documentation/> <wsdl:operation name="CustomerRead_sync"> <wsdl:documentation/> <wsp:Policy> <wsp:PolicyReference URI="#OP_CustomerRead_sync"/> </wsp:Policy> <wsdl:input message="p1:MT_CustomerRead_request"/> <wsdl:output message="p1:MT_CustomerRead_response"/> <wsdl:fault name="FMT_Customer" message="p1:FMT_Customer"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="Customer_OutBinding" type="p1:Customer_Out"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> <wsdl:operation name="CustomerRead_sync"> <soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> <wsdl:input> <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> </wsdl:input> <wsdl:output> <soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> </wsdl:output> <wsdl:fault name="FMT_Customer"> <soap:fault use="literal" name="FMT_Customer" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> </wsdl:fault> </wsdl:operation> </wsdl:binding> <wsdl:service name="Customer_OutService"> <wsdl:port name="HTTP_Port" binding="p1:Customer_OutBinding"> <soap:address location="..." xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"/> </wsdl:port> </wsdl:service> </wsdl:definitions> |
Een bijhorende request ziet er als volgt uit
XML:
1
2
3
4
5
6
7
8
9
10
| <man:MT_CustomerRead_request> <RowLimit>100</RowLimit> <!--Optional:--> <!-- <CustomerId>? <!--Optional:--> <Name>Dell*</Name> <!--Optional:--> <!--Optional:--> <AccountGroup>ABC</AccountGroup> </man:MT_CustomerRead_request> |
Ik heb in mijn .NET project een Service Reference toegevoegd. Vervolgens zijn er tal van klasses waar ik een instantie kan van aanmaken.
Ik vind echter niet hoe ik de request kan doorgeven, en de daarop volgende response kan ophalen. Dien ik alles te parsen om zo de informatie van de request en response bruikbaar te maken? Nu zit deze namelijk tussen tags "verstopt"? Ik heb reeds volgende tutorial gevonden maar loop wat vast.
Zie ik iets over het hoofd, heb ik een totaal verkeerde aanpak?
.