Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

Questa pagina è un work in progress con visibilità ristretta a Cigoli, Miscia, Gorni, Arrigoni

Table of Contents

URL degli endpoint del servizio MailUpService: 

Endpoints

SOAP: http://services.mailupnet.it/1.0/MailUpService.svc

...

  1. REST is supported only when XML parameters are passed with http POST method (Ping method is the only exception, which can be called using http GET http://services.mailupnet.it/1.0/MailUpService.svc/rest/Ping)
  2. JSON is not supported

 

How to use REST

Client configuration with WCF (Windows Communication Foundation)

Add the following entries in web.config file to enable REST

Code Block
languagehtml/xml
<system.serviceModel>
	<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
	...
 	<behaviors>
		...
		<endpointBehaviors>
			<behavior name="restBehavior">
				<webHttp/>
			</behavior>
		</endpointBehaviors>
	</behaviors>
	<services>
		<service behaviorConfiguration="MailUp.WS.Host.Web.MailUpServiceBehavior" name="MailUp.WS.Service.MailUpService">
		<endpoint  address="rest" binding="webHttpBinding" contract="MailUp.WS.Contract.IMailUpService" behaviorConfiguration="restBehavior"/>
		...
	</services>
	...
</system.serviceModel>

 

Example

...

titleAuthenticationLogin with REST (Request)

...

REST Example

Info

Please refer to REST configuration page to get some tips about enabling REST

 

Call http://services.mailupnet.it/1.0/MailUpService.svc/rest/AuthenticationLogin

...

 passing the

...

following

...

XML

...

as

...

parameter

...

in

...

HTTP

...

POST:

...

Code Block
titleAuthenticationLogin with REST (Request)
<LoginRequest>
	<Username>xxxx</Username>
	<Password>yyyy</Password>
	<IdConsole>10001</IdConsole>
</LoginRequest>

 

A successful response has this format:

Code Block
titleAuthenticationLogin using REST (Response)
XML response when request is successful ("Token" is the returned Access key):
<LoginResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<Token>A973Amr5FJZzsZukgfdBkjblveNL8TKnqc5iLjDyixLDF9VdTx0M9N9z4Hiw=</Token>
</LoginResponse>


Unsuccessful response:
HTTP 400 Bad Request

...

while "HTTP 400 Bad Request" is returned in case of unsuccessful response