Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions /

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba

SOAPModelAccess / Content-Type of response


Go to End
Reply


3 Posts   1361 Views

Avatar
rob.s

Community Member, 78 Posts

5 September 2010 at 1:22am

Edited: 04/02/2011 9:23pm

Hi,

these days i'm trying to consume a SS-Model by a C# (.NET 2.0) SOAP Client.
The wsdl is correctly interprated since SS 2.4.x !! :-)

But i'm always getting an error when getXML() is invoked.

Something like:
... the expected Content-Type is text/xml. The Content-Type of the response is "text/html; charset=UTF-8"

I tried to insert at:
SOAPModelAccess.php

	function getXML($class, $id, $relation = false, $username = null, $password = null) {
		$this->authenticate($username, $password);
		
		$response = Director::test(
			$this->buildRestfulURL($class, $id, $relation, 'xml'),
			null,
			null,
			'GET'
		);
                $response->addHeader('Content-Type', 'text/xml');
		return ($response->isError()) ? $this->getErrorMessage($response) : $response->getBody();
	}

with no luck ......

Can anyone help me ?

Greetings,
Rob

Avatar
rob.s

Community Member, 78 Posts

4 February 2011 at 9:21pm

Edited: 04/02/2011 9:22pm

Sorry for bumping this post.
Are there any ideas out there, how to fix this issue ?

Rob

Edit: 2.4.4. is in use ...

Avatar
saviolan

Community Member, 1 Post

2 February 2012 at 8:31am