[SOAP]Probleem met Schema-Instance namespace in WSDL bestand

Pagina: 1
Acties:

  • Nick_S
  • Registratie: Juni 2003
  • Laatst online: 19-02 23:40

Nick_S

++?????++ Out of Cheese Error

Topicstarter
Ik zit met een probleem met het maken van een WSDL bestand bij een aantal werkende webservices. Deze reageren echter nogal strak op namespaces (logisch), maar ook op de namespace van Schema-Instance (http://www.w3.org/2001/XMLSchema-instance) Ik krijg deze namespace maar niet goed in het resultaatbericht by de attributen "type".

Dit is mijn huidige WSDL file (enkele bedrijfsspecifieke dingen eruit gehaald, dus misschien dat namen niet overal kloppen)
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
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.mycompany.nl/webservice" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.mycompany.nl/webservice">
    <wsdl:types>
        <s:schema elementFormDefault="qualified" attributeFormDefault="qualified" targetNamespace="http://www.mycompany.nl/webservice/">
            <s:element name="webserviceRequest">
                <s:complexType>
                    <s:sequence>
                        <s:element name="Services" type="Services"/>
                        <s:element name="id" type="s:string" minOccurs="1" maxOccurs="1"/>
                    </s:sequence>
                </s:complexType>
            </s:element>

            <s:element name="webserviceResponse">
                <s:complexType>
                    <s:sequence>
                        <s:element name="cat" type="s:string" minOccurs="0" maxOccurs="unbounded"/>
                    </s:sequence>
                </s:complexType>
            </s:element>

            <s:complexType name="Services">
                <s:sequence>
                    <s:element name="_cookie" type="s:string" minOccurs="1" maxOccurs="1"/>
                </s:sequence>
                <s:attribute name="type"/>
            </s:complexType>
        </s:schema>
    </wsdl:types>

    <wsdl:message name="webserviceRequestMessage">

        <wsdl:part name="request" element="tns:webserviceRequest"/>
    </wsdl:message>

    <wsdl:message name="webserviceResponseMessage">

        <wsdl:part name="request" element="tns:webserviceResponse"/>
    </wsdl:message>

    <wsdl:portType name="CompanyPortType">

        <wsdl:operation name="webservice">
            <wsdl:input name="newRequest" message="tns:webserviceRequestMessage"/>
            <wsdl:output name="newResponse" message="tns:webserviceResponseMessage"/>
        </wsdl:operation>
    </wsdl:portType>

    <wsdl:binding name="CompanyBinding" type="tns:CompanyPortType">

        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

        <wsdl:operation name="webservice">
            <soap:operation soapAction="/Services#webservice" style="rpc"/>
            <wsdl:input>
                <soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="/Services"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="/Services"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>

    <wsdl:service name="webservice">
        <wsdl:port name="CompanyPort" binding="tns:CompanyBinding">
            <soap:address location="http://company.nl:143"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>

Dit is wat de huidige webservice verwacht voordat ik antwoord krijg (let op de xsi prefixes bij type).
XML:
1
2
3
4
5
6
7
8
9
10
11
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:namesp3="http://namespaces.soaplite.com/perl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ file:///c:/temp/soap02.xsd">
     <SOAP-ENV:Body>
           <namesp2:webservice xmlns:namesp2="/Services">
                <Services xsi:type="namesp3:Services">
                     <_cookie xsi:type="xsd:string">string</_cookie>
                </Services>
                <id xsi:type="xsd:int">44</id>
           </namesp2:webservice>
     </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Dit is echter wat mijn WSDL file aan soaprequest genereerd (Let op het ontbreken van de XSI prefix) waardoor dit request niet word geaccepteerd.:
XML:
1
2
3
4
5
6
7
8
9
10
11
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   xmlns:m0="http://company.nl/webservice/">
    <SOAP-ENV:Body>
        <m:shop_category_list xmlns:m="/Services" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <m0:Services type="">
                <m0:_cookie>String</m0:_cookie>
            </m0:Services>
            <m0:id>String</m0:id_shop>
        </m:shop_category_list>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Weet iemand hoe ik toch deze xsi prefix in mijn request bericht krijg?

'Nae King! Nae quin! Nae Laird! Nae master! We willna' be fooled agin!'