Webservices and Structure of SOAP Envelope
Webservices and Structure of SOAP Envelope
- Subject: Webservices and Structure of SOAP Envelope
- From: "Krys Malak" <email@hidden>
- Date: Tue, 29 Apr 2008 16:34:41 +0200
Hi,
i'm trying to access a webservice and retrieve data from it, but something
goes wrong when i get the response from the server and i lose some of the
data i actually need.
Here's the setup:
A webservice (written in java) running in a Glassfish Server on my Windows
machine that has a method getNew that returns a List of Song-Objects
(containg artist, title etc.) from my database.
My mac as the client with access to the server using Xcode and the
WebServices Framework.
So i successfully manage to build the SOAP Request, set ist parameters and
am able to connect to the web service and retrieve data, but as i said not
all of it.
Here is the result object i get when i run my code:
2008-04-28 10:01:42.033 WebServiceClient[210:10b] Result: {
"/Result" = {
return = {
artist = "Rise Against";
id = sgfasd;
mp3 = "http://3";
new1 = true;
title = "Behind Closed Doors";
top10 = true;
};
};
"/WSDebugInBody" = "<?xml version=\"1.0\" ?>
<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">
<S:Body>
<ns2:getNewResponse xmlns:ns2=\"http://soap.service/\">
<return>
<artist>Rihanna</artist>
<id>aslfh2</id>
<mp3>http://1</mp3>
<new1>true</new1>
<title>Umbrella</title>
</return>
<return>
<artist>Rise Against</artist>
<id>sgfasd</id>
<mp3>http://3</mp3>
<new1>true</new1>
<title>Behind Closed Doors</title>
<top10>true</top10>
</return>
</ns2:getNewResponse>
</S:Body>
</S:Envelope>";
"/WSDebugInHeaders" = {
Connection = close;
"Content-Type" = "text/xml;charset=\"utf-8\"";
Date = "Mon, 28 Apr 2008 08:01:39 GMT";
Server = "Sun Java System Application Server 9.1";
"X-Powered-By" = "Servlet/2.5";
};
"/WSDebugOutBody" = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n
<SOAP-ENV:Envelope\n\n xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n\n
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\n
xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\n\n
SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"\n\n
xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\n\n
<SOAP-ENV:Body>\n\n
<getNew xmlns=\"http://soap.service/\">\n\n </getNew>
</SOAP-ENV:Body>\n\n
</SOAP-ENV:Envelope>\n\n";
"/WSDebugOutHeaders" = {
"Content-Type" = "text/xml";
Host = "192.168.21.19";
Soapaction = "";
"User-Agent" = "Mac OS X; WebServicesCore.framework (1.0.0)";
};
"/kWSHTTPResponseMessage" = <NSCFType: 0x128f40>;
return =
artist = "Rise Against";
id = sgfasd;
mp3 = "http://3";
new1 = true;
title = "Behind Closed Doors";
top10 = true;
};
}
I reformated it a bit so it's easier to read. So we can see that the
WSDebugInBody has two Song elements, and the the WSDebugOutBody hasn't. Also
the Envelope is changed so it looks like the same i have in my request.
So my thoughts about possible options:
1. change my request so it's envelopes matches the servers response
envelope, which hopefully would lead to no conversion and successful
retrival of all data
The only way i could find so far, was chaing to the SOAP1999Protocol, which
lead to a slightly different header and an "m:" being used infront of the
getNew (same as the ns2: in the original server response) Is there a way to
directly manipulate the envelope and just add the one line contained in the
server response to it and leave out the rest? And I still could not figure
out what this ns2: m: mean, if anybody has a clue there?
2. Not allowing the Client to Convert between DebugIn and DebugOut, but I
don't know how i could surpress this conversion and I'm not sure if this is
really the right way to do it.
If somebody has any answer to these questions or any other idea's, they are
most welcome, i also can post my code if necessary.
Cheers,
Krys
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden