WebServices interoperability with .NET
WebServices interoperability with .NET
- Subject: WebServices interoperability with .NET
- From: Jake MacMullin <email@hidden>
- Date: Wed, 7 Apr 2004 17:37:09 +1000
I'm trying to get a basic WebObjects 'Direct to Web Services'
application to work with a .NET client.
.NET includes tools to generate proxy objects from the WebObjects
generated WSDL - so I'm part the way there - I can call a method in my
.NET proxy, which results in the WebObjects method being called.
However, no matter what type of 'Direct to Web Services' application I
create - WebObjects always seems to send a SOAP response that .NET
trips over. Below is the SOAP that is being sent back and forth:
The .NET client sends this basic SOAP message to my WebObjects service:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://mydomain/cgi-bin/WebObjects/ws2.woa/ws/BugService/
wsdl"
xmlns:types="http://mydomain/cgi-bin/WebObjects/ws2.woa/ws/BugService/
wsdl/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:getBug>
<id xsi:type="xsd:int">1000014</id>
</tns:getBug>
</soap:Body>
</soap:Envelope>
This is basically calling the getBug method with the argument: 1000014
WebObjects parses the SOAP request fine, goes to the database, gets the
bug - prepares a SOAP response and fires it back:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:getBugResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://mydomain/cgi-bin/WebObjects/ws2.woa/ws/BugService/
wsdl">
<return href="#id0"/>
</ns1:getBugResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="soapenc:Array" soapenc:arrayType="ns2:anyType[1]"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://www.w3.org/1999/XMLSchema">
<item href="#id1"/>
</multiRef>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="soapenc:Struct"
xmlns:ns3="http://www.apple.com/webobjects/webservices/soap/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<feedback xsi:type="xsd:string">This is the contents of the
database record.</feedback>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
The problem is, .NET throws an exception when parsing the XML. It
complains when it gets to: soapenc:arrayType="ns2:anyType[1]"
According to .NET, anyType is not defined in the name space: ns2, which
if you look at the XML is http://www.w3.org/1999/XMLSchema
Now, I don't know that much about SOAP and XML namespaces and the like
- but I can't find any mention of anyType in that name space. So I'm a
bit stumped. I don't know enough about .NET to try and solve the
problem on that end - so I'm wondering how I can solve the problem with
WebObjects. Can any web services gurus out there hep me answer these
questions?
Why does getBugResponse return href="#id0" instead of simply returning
"<feedback xsi:type="xsd:string">This is the contents of the database
record.</feedback> "?
Why does id0 seem to return an array when there is only 1 String to be
returned?
Why does id0 use ns2:anyType instead of xsd:anyType?
How can I get my wizard generated code to behave differently?
Regards,
Jake MacMullin
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.