Sunteți pe pagina 1din 30

Multimedia Messaging

Service Center (MMSC) v 2.6


MM7 Interface v 1.0
R efer enc e: MMSC- 2.6-MM7-1.0
Confidentiality Statement
Copyright © 2009-2010, Comviva Technologies Ltd. All rights reserved. This product or document
may not, in whole or in part, be copied, photocopied, reproduced, translated, or reduced to any
electronic medium or machine readable form, by any means electronic, mechanical, photographic,
optic recording or otherwise without prior consent, in writing, of the copyright owner. Statutory
declaration under section 52A of the Copyright Act 1957.

i
Restrictions and Copyright Declaration
The information in this document is subject to change without notice and describes only the product defined in the introduction of this
documentation. This document is intended for the use of prospective Comviva customers for the sole purpose of the agreement under which the
document is submitted. No part of it may be reproduced or transmitted in any form or means without the prior written permission of Comviva. The
intended audience for this document is professional personnel, who assume full responsibility for using the document appropriately. Comviva
welcomes customer comments as part of the process of continuous development and improvement of its documentation. The information or
statements given in this document concerning the suitability, capacity, or performance of the mentioned hardware or software products cannot be
considered binding, but shall be defined in contextual specific eventual agreement made between Comviva and the customer.
However, Comviva has made all reasonable efforts to ensure that the instructions contained in the document are adequate, sufficient and free of
material errors and omissions. Comviva will, if necessary, explain issues, which may not be covered by the document. Comviva’s liability for any
errors in the document is limited to the documentary correction of errors. Comviva will not be responsible, in any event, for errors in this document
or for any damages, incidental or consequential, including monetary losses, that might arise from the use of this document or the information in it.

This document and the product it describes are considered protected by Patent, Copyright and Trademark laws in accordance with relevant
Indian laws.
The only warranties for Comviva products and services are set forth in the express warranty statements accompanying its products and services.
Nothing herein should be construed as constituting an additional warranty. Comviva shall not be liable for technical or editorial errors or omissions
contained herein.
The Comviva logo is a registered trademark of Comviva Technologies Ltd. Other product names mentioned in this document may be trademarks
of their respective companies and they are mentioned for identification purposes only.
Copyright © 2009 Comviva Technologies Ltd. All rights reserved.

iii
Contents
1 MM7 Interface ........................................................................................................................................... 1-1

1.1 Dependencies ............................................................................................................................................. 1-1

1.2 MM7 SOAP Architecture ........................................................................................................................... 1-1


1.2.1 Adding VAS User ......................................................................................................................................... 1-1

1.3 SOAP Server ............................................................................................................................................... 1-4


1.3.1 MM7 SOAP Service Methods ...................................................................................................................... 1-4
1.3.2 MM7 Submit ................................................................................................................................................. 1-4
1.3.3 MM7 Deliver ................................................................................................................................................. 1-9
1.3.4 MM7 Replace/Cancel ................................................................................................................................. 1-11

2 Sample Programs .................................................................................................................................... 2-1

2.1 Dependencies ............................................................................................................................................. 2-1

2.2 Steps to Write MM7 SOAP Client ............................................................................................................. 2-1


2.2.1 Program to send a MM7_Submit.REQ to the SOAP Server ..................................................................... 2-1
2.2.2 How to Compile and Execute ...................................................................................................................... 2-5

Appendix A —Error Codes and Texts...................................................................................................... 2-1

Appendix B — Deploy SOAP Service ...................................................................................................... 2-1

Appendix C — SOAP Messaging Client .................................................................................................. 2-1

Appendix D — SOAP Service Handler ..................................................................................................... 2-1

Document Change History .............................................................................................................................I

Contact Us ......................................................................................................................................................III

v
Tables
Table 1: Document Change History .................................................................................................... I

vii
1 MM7 Interface
The Interface between a Value Added Service (VAS) and the MMS Relay/Server, over the
MM7 reference point is realized using SOAP 1.1. The MM7 SOAP message consists of a
SOAP Envelope, SOAP Header and SOAP Body Element. The SOAP message binds to the
HTTP request/response model by providing SOAP request parameters in the body of the
HTTP Post Data.

The MM7 SOAP interface uses a message oriented SOAP service approach in order to
provide full control over request and response SOAP Envelopes. Thus it is the responsibility
of the message oriented SOAP service implementation, to process the SOAP Envelope
contents and generate appropriate response SOAP Envelope.

The “Message Oriented SOAP Services” is hosted by a Servlet container (Jakarta Tomcat).
Hence all the HTTP requests for SOAP service must be delivered to the SOAP Servlet
(Messagerouter and rpcrouter). SOAP Servlet performs following operations:
 Register/deploy the SOAP service
 Un-register/Un-deploy the SOAP service
 Invoke the service methods
Send the response generated by the service method to the requesting client.

1.1 Dependencies
 Java Vesion1.3 or higher, and a Servlet engine supporting version 2.1 or above of
the Java Servlet API (Tomcat V 3.3 used)
 A JAXP compatible, namespace aware XML parser (Jxerces-1.2.3 used)
 JavaMail (mail.jar) and the JavaBeans Activation Framework (activation.jar)
 Apache SOAP V 2.2
 It requires jxreces-1.2.3 namespace aware xml parser so xerces.jar file must be
set as the first jar files in the CLASSPATH.
 W3C SOAP Schema 1.1 as published by 3GPP
(http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-
0)

1.2 M M 7 S OA P A rch ite c tu re


To enable a VAS application to access the Comviva MMSC, the VAS must be registered. This
can be done using Add Subscriber link on the MMSC Web GUI.

1.2.1 Adding VAS User


1. The user name field is mapped to VAS ID and the value must be digits.
2. Enter appropriate values for password, e-mail ID and class ID.
3. Select the Subscriber Type as VAS User.
4. Enter the VASP ID. This is mapped to VAS provider ID.
5. VAS URL field has 3 parts in sequence, each separated by a “|”
a) HTTP URL
b) Soap Service Name
c) Service Method Name to handle MM7_deliver.REQ

MM7 Interface 1-1


Troubleshooting Manual: MMSC-3.1

For Example:
http://127.0.0.1:8080/soap/servlet/messagerouter|mm7interface|DeliverReq
6. Add type of message rule.

The current version of MMSC provides following service methods:


1. SubmitReq: This is a 3GPP specifications service method for
MM7_submit.REQ requests. The SOAP response generated by this method
adheres to 3GPP MM7_submit.RES format.
2. ReplaceReq: This is a 3GPP specifications service method for
MM7_replace.REQ request. The SOAP response generated by this method
confirms to 3GPP MM7_replace.RES format.
3. CancelReq: This is a 3GPP specifications service method for
MM7_cancel.REQ request. The SOAP response generated by this method
confirms to the 3GPP MM7_cancel.RES format.
4. DeliverReq: This is a 3GPP specifications service method for
MM7_deliver.REQ request. The SOAP response generated by this method
confirms to the 3GPP MM7_deliver.RES format.

All these service methods are grouped under SOAP service, mm7interface. The SOAP
service is deployed during installation of the MM7 Interface.

A VAS provider can deploy its own customized service by registering the deployment
descriptor. Refer to Appendix A – Deploy SOAP Service for details on creating deployment
descriptor and registering.

MMSC’s MM7 interface supports the following messaging services:


 VAS Application Originated (AO): A multimedia message is sent by VAS
application to Comviva MMSC for processing. The VASP application can send
SOAP requests for SubmitReq, ReplaceReq and CancelReq service methods of
mm7inteface SOAP service. The SOAP request and response data are described
in the following section.
 VAS Application Terminated (AT): A message that is passed by the Comviva
MMS Relay/Server to a VASP for processing. For example, this may include
cases where the message originated from the MMS User-Agent.

MM7 Interface 1-2


Troubleshooting Manual: MMSC-3.1

The following figure gives the architecture of AO – MT interface.


 The interfaces between VAS and database, file, other trigger applications are
proprietary.
 The interface between VAS and SOAP Client is a function call for which an
Apache SOAP library can be used over HTTP 1.1 interface. The SOAP Envelope
and payload is sent as POST Data.

Figure 2-1: Application Originated – Mobile Terminated

The following figure illustrates the architecture of MO – AT interface.


 HTTP 1.1 interface, the SOAP Envelope and payload is sent as POST Data.
 The interface between VAS and SOAP Client is a function call for which an
Apache SOAP library can be used.
 A proprietary Interface is used between VAS and database, file or other
applications.

Figure 2-2: Mobile Originated – Application Terminated

The MM7 interface has 2 logical components:


 The SOAP server
 The MM7 SOAP Service methods

1-3 MM7 Interface


Troubleshooting Manual: MMSC-3.1

1.3 S OA P Se rv e r
The target URL used by the VAS Provider MM7 application is the apache SOAP’s
messagerouter servlet. The messagerouter Servlet is deployed in the application server. Thus
the Apache SOAP Servlet and the application server together provide the ability to receive
and process the SOAP request. The Servlet invokes the Java service methods.

1.3.1 MM7 SOAP Service Methods


The SOAP service methods must be deployed and registered with SOAP server. The SOAP
server finds the service descriptor and informs the application server to load the Java class to
perform the service. The application server invokes the Java method with SOAP message
body and attachments as parameter.

The following diagram describes the intercommunication of all the components:

Figure 2-3: MM7 Components

1.3.2 MM7 Submit


1. MM7 MM7_submit.REQ/MM7_cancel.REQ/MM7_replace.REQ from
VAS to MMSC.
2. MM7_submit.RES/MM7_cancel.REQ/MM7_replace.REQ from MMSC to
VAS.

MM7 Interface 1-4


Troubleshooting Manual: MMSC-3.1

3. The messagerouter Servlet requests for registered service functions against


the urn.
4. Service deployment descriptor returns the class name and the function
name.
5. The SOAP server instantiates the SOAP service class and invokes the
corresponding service method.
6. The SOAP service method generates MM7 SOAP format response and
sends it to the VAS through step 2.
7. The MM7 interface service method communicates with Comviva MMSC in a
proprietary format over HTTP.

MM7 Message Format:


Subsequent sub-clauses will specify the detailed architecture as defined by the 3GPP’s MM7
protocol.

The VAS submits a multimedia message as payload to MMSC and waits for SOAP
Response.

MM7_Submit.REQ

Information SOAP Element Location Type Presence


Element Name

Transaction ID TransactionID SOAP Header String Mandatory


MM7 Version MM7Version SOAP Body String Mandatory
VASP ID VASPID SOAP Body String Mandatory
VAS ID VASID SOAP Body String Mandatory
Sender SenderAddress SOAP Body String Optional
Address
TO To SOAP Body String Mandatory
CC Cc SOAP Body String Optional
BCC Bcc SOAP Body String Optional
Service Code ServiceCode SOAP Body String Optional
Linked ID LinkedID SOAP Body String Optional
Message Class MessageClass SOAP Body String Optional
Time Stamp TimeStamp SOAP Body String Optional
Earliest EearliestDeliveryTime SOAP Body Date Optional
Delivery Time Time
Expiry Date ExpiryDate SOAP Body Date Optional
Time
Reply Charging ReplyCharging SOAP Body Optional
Reply Charging replyChargingSize SOAP Body Optional
Size
Reply Dead replyDeadLine SOAP Body Date Optional
Line Time
Delivery Report DeliveryReport SOAP Body Boolean Optional
Read Reply ReadReply SOAP Body Boolean Optional
Priority Priority SOAP Body String Optional
Subject Subject SOAP Body String Optional

1-5 MM7 Interface


Troubleshooting Manual: MMSC-3.1

Information SOAP Element Location Type Presence


Element Name

Charged Party ChargedParty SOAP Body String Optional


Distribution DistributionProtection SOAP Body Number Optional
Protection
Content Content SOAP Body Optional
href Href SOAP Body String Optional
Allow Content allowAdaptations SOAP Body Boolean Optional
Adaptation

MM7_Submit.RES

Information SOAP Element Location Type Presence


Element Name
Transaction ID TransactionID SOAP String Mandatory
Header
MM7 Version MM7Version SOAP Body String Mandatory
Message ID MessageID SOAP Body String Mandatory
Response Status StatusCode SOAP Body String Mandatory
Response Text StatusText SOAP Body String Mandatory
Detail Description Details SOAP Body String Optional

Sample MM7_Submit.REQ
POST /soap/servlet/messagerouter HTTP/1.0
Host: 192.10.2.195
Content-Type: multipart/related; boundary="----
=_Part_1_6085183.1050660704628"; type="text/xml";
start="5285337.1050660705250.apache-soap.node2.jataayu.co.in"
Content-Length: 3004
SOAPAction: ""

------=_Part_1_6085183.1050660704628
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: <5285337.1050660705250.apache-soap.node2.jataayu.co.in>
Content-Length: 1425

<?xml version='1.0' encoding='UTF-8'?>


<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<mm7:TransactionID env:mustUnderstand="1"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/sch
ema/REL-5-MM7-1-0"> 123
</mm7:TransactionID>
</env:Header>
<env:Body>

MM7 Interface 1-6


Troubleshooting Manual: MMSC-3.1

<mm7:SubmitReq xmlns:mm7="urn:mm7interface">
<mm7:MM7Version>1.0</mm7:MM7Version>
<mm7:SenderIdentification>
<mm7:VASPID>TNN</mm7:VASPID>
<mm7:VASID>1234</mm7:VASID>
<mm7:SenderAddress>JataayuVAS_SAMPLE</mm7:SenderAddress>
</mm7:SenderIdentification>
<mm7:Recipients>
<mm7:To>
<mm7:Number>9845331850</mm7:Number>
<mm7:rfc822>sandips@jataayusoft.com</mm7:rfc822>
</mm7:To>
</mm7:Recipients>
<mm7:ServiceCode>gold-sp33-im42</mm7:ServiceCode>
<mm7:LinkedID>mms00016666</mm7:LinkedID>
<mm7:MessageClass> Informational </mm7:MessageClass>
<mm7:TimeStamp>2005-09-21T19:05:58</mm7:TimeStamp>
<mm7:EarliestDeliveryTime>2005-09-21T19:05:58-
05:30</mm7:EarliestDeliveryTime>
<mm7:ExpiryDate>2005-09-23T19:05:58</mm7:ExpiryDate>
<mm7:ReplyCharging replyChargingSize="2048" replyDeadline="10d"/>
<mm7:DeliveryReport>True</mm7:DeliveryReport>
<mm7:Priority>Normal</mm7:Priority>
<mm7:ChargedParty>Sender</mm7:ChargedParty>
<mm7:DistributionIndicator>True</mm7:DistributionIndicator>
<mm7:Subject>News for today</mm7:Subject>
<mm7:Content allowAdaptations="True" href="cid:foo.smil"/>
</mm7:SubmitReq>
</env:Body>
</env:Envelope>

------=_Part_1_6085183.1050660704628
Content-Type: application/smil
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=foo.smil
Content-ID: foo.smil
Content-Location: foo.smil
<smil>
<head>
<layout>
<root-layout background-color="black" width="352" height="144"
/>
<region id="image" width="176" height="144" left="0" top="0" />
<region id="text" width="176" heigøÿ¿°Ùht="144" left="176"
top="0" />
</layout>
</head>
<body>
<par dur="8s">

1-7 MM7 Interface


Troubleshooting Manual: MMSC-3.1

<img src="08.gif" region="image">


</img>
<text src="foo.txt" begin="2s" region="text">
</text>
</par>
</body>
</smil>

------=_Part_1_6085183.1050660704628
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=foo.txt
Content-ID: foo.txt
Content-Location: foo.txt

this is a text file.


------=_Part_1_6085183.1050660704628
Content-Type: image/gif
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename=08.gif
Content-ID: 08.gif
Content-Location: 08.gif

GIF89a~L^@^O^@~@ÿ^@ÿÿÿÀÀÀ!ù^D^A^@^@^A^@,^@^@^@^@~L^@^O^@^@^BÏ~L^_|\~J
í^O£~\´Ú~KÏÚ,û^O~F"Å~UcÕ~]ê~JN~@c~Jéº~A3vCo¹$ðkÈá~@4"qh;êv<f#^Eíi¤ÁZÂ
yEX^?Ë(~USõ~J~M_ì4«%W×O`çÍèÁÙíÇ^\^]=ãÝj}úÊ~C6µu^xwÈÇ&´~X¸ç~GH7~S^S§DY
'æ¨iÈ×X8^FÚ7ø×d¦HªÇɪÄõÊ)8Ù(ø§Q~[å~Z'~[Ú»Ië^Zé^[J:êg^[ÔY£{^D~GY&^U»õù
Ü÷^\fÝì^\|#Äò^M^^.q*^n~>è~M¾ÎNQ^@^@;

------=_Part_1_6085183.1050660704628--

Sample MM7_Submit.RES
<? xml version='1.0' ?>
<soap-env:Envelope xmlns:soap-
env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<3gpp-mm7:TransactionID xmlns:3gpp-
mm7="http://localhost/soap/REL-5-MM7-1-0" 3gpp-
mm7:mustUnderstand="1"> 123
</3gpp-mm7:TransactionID>
</soap-env:Header>
<soap-env:Body>
<mm7:SubmitRes>
<mm7:MM7Version> 1.0</mm7:MM7Version>
<mm7:Status>
<mm7:StatusCode> 4000</mm7:StatusCode>
<mm7:StatusText> gerneral service error</mm7:StatusText>
<mm7:Detail></mm7:Detail>
</mm7:Status>

MM7 Interface 1-8


Troubleshooting Manual: MMSC-3.1

<mm7:MessageID></mm7:MessageID>
</mm7:SubmitRes>
</soap-env:Body>
</soap-env:Envelope>

1.3.3 MM7 Deliver


MM7 deliver interface is invoked in Mobile Originated to VAS Terminated scenario. The
current version of MM7Deliver() stores the multimedia message along with attachment to the
directory as specified in the ATSaveDir parameter of the MM7 configuration file.

VAS Providers can add its own service methods, instead of using MM7Deliver() for handling
MM7_deliver.REQ.

MM7_deliver.REQ

Information SOAP Element Name Location Type Presence


Element

Transaction ID TransactionID SOAP Header String Mandatory


MM7 Version MM7Version SOAP Body String Mandatory
Linked ID LinkedID SOAP Body String Optional
Sender Address Sender SOAP Body String Mandatory
Recipient To SOAP Body String Mandatory
Time Stamp TimeStamp SOAP Body String Optional
Priority Priority SOAP Body String Optional
Subject Subject SOAP Body String Optional
Content Content SOAP Body String Optional
Href href SOAP Body String Optional

Sample MM7_deliver.REQ
POST /soap/servlet/messagerouter HTTP/1.1
Host: 192.10.2.195
Content-Type: multipart/related; boundary="----
=_NextPart_000_0017_01C2A8E7.84B40FE0"; type="text/xml; charset=utf-
8"; start="startid"
Content-Length: 2750
SOAPAction: ""

------=_NextPart_000_0017_01C2A8E7.84B40FE0
Content-Type: text/xml; charset= utf-8
Content-ID: <startid>
Content-Transfer-Encoding: 7bit

<?xml version='1.0' ?>


<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<mm7:TransactionID

1-9 MM7 Interface


Troubleshooting Manual: MMSC-3.1

xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/sch
ema/REL-5-MM7-1-0" env:mustUnderstand="1">
vas00001-sub
</mm7:TransactionID>
</env:Header>
<env:Body>
<mm7:DeliverReq xmlns:mm7="urn:mm7interface">
<mm7:MM7Version>1.0</mm7:MM7Version>
<mm7:Sender>+9845326569/TYPE=PLMN</mm7:Sender>
<mm7:Recipients>
<mm7:To>+8888/TYPE=PLMN</mm7:To>
</mm7:Recipients>
<mm7:ServiceCode>gold-sp33-im42</mm7:ServiceCode>
<mm7:LinkedID>mms00016666</mm7:LinkedID>
<mm7:MessageClass>Informational</mm7:MessageClass>
<mm7:TimeStamp>123456</mm7:TimeStamp>
<mm7:EarliestDeliveryTime>20020</mm7:EarliestDeliveryTime>
<mm7:ExpiryDate>1234</mm7:ExpiryDate>
<mm7:ReplyCharging replyDeadline="10d" replyChargingSize="2048"/>
<mm7:DeliveryReport>True</mm7:DeliveryReport>
<mm7:Priority>Normal</mm7:Priority>
<mm7:ChargedParty>Sender</mm7:ChargedParty>
<mm7:DistributionIndicator>True</mm7:DistributionIndicator>
<mm7:Subject>News for today</mm7:Subject>
<mm7:Content href="cid:alarm.jpg" allowAdaptations="True"/>
</mm7:DeliverReq>
</env:Body>
</env:Envelope>

------=_NextPart_000_0017_01C2A8E7.84B40FE0
Content-Type: image/jpeg
Content-ID: <cid:alarm.jpg>
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="alarm.jpg"

/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UH
RofHh0a.....

NextPart_000_0017_01C2A8E7.84B40FE0--

Sample MM7_Deliver.RES
<? xml version='1.0' ?>
<soap-env:Envelopexmlns:soap-
env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<3gpp-mm7:TransactionIDxmlns:3gpp-
mm7="http://localhost/soap/REL-5-MM7-1-0"3gpp-
mm7:mustUnderstand="1"> vas00001-sub
</3gpp-mm7:TransactionID>
</soap-env:Header>
<soap-env:Body>
<mm7:DeliverRes>
<mm7:MM7Version>1.0</mm7:MM7Version>
<mm7:Status>

MM7 Interface 1-10


Troubleshooting Manual: MMSC-3.1

<mm7:StatusCode>1000</mm7:StatusCode>
<mm7:StatusText>Success</mm7:StatusText>
<mm7:Detail>Content stored in [/var/tmp/saved-
data/9845115059/1049954669005]</mm7:Detail>
</mm7:Status>
<mm7:MessageID></mm7:MessageID>
</mm7:DeliverRes>
</soap-env:Body>
</soap-env:Envelope>

1.3.4 MM7 Replace/Cancel


MMSC provides option for VASP to cancel a submitted message prior to delivery or replace a
submitted message with a new message.

MM7_replace.REQ

Information SOAP Element Name Location Type Presence


Element

Transaction ID TransactionID SOAP Header String Mandatory


MM7 Version MM7Version SOAP Body String Mandatory
VASP ID VASPID SOAP Body String Mandatory
VAS ID VASID SOAP Body String Mandatory
Message ID MessageID SOAP Body String Mandatory
Service Code ServiceCode SOAP Body String Optional
Time Stamp TimeStamp SOAP Body String Optional
Earliest EearliestDeliveryTime SOAP Body Date Optional
Delivery Time Time
Expiry Date ExpiryDate SOAP Body Date Optional
Time
Reply Charging ReplyCharging SOAP Body Optional
Reply Charging replyChargingSize SOAP Body Optional
Size
Reply Dead replyDeadLine SOAP Body Date Optional
Line Time
Delivery Report DeliveryReport SOAP Body Boolean Optional
Read Reply ReadReply SOAP Body Boolean Optional
Distribution DistributionProtection SOAP Body Number Optional
Protection
Content Content SOAP Body Optional
Href href SOAP Body String Optional
Allow Content allowAdaptations SOAP Body Boolean Optional
Adaptation

1-11 MM7 Interface


Troubleshooting Manual: MMSC-3.1

MM7_replace.RES
Information SOAP Element Location Type Presence
Element Name

Transaction ID TransactionID SOAP Header String Mandatory


MM7 Version MM7Version SOAP Body String Mandatory
Response Status StatusCode SOAP Body String Mandatory
Response Text StatusText SOAP Body String Mandatory
Detail Description Details SOAP Body String Optional

MM7_cancel.REQ

Information SOAP Element Location Type Presence


Element Name
Transaction ID TransactionID SOAP Header String Mandatory
MM7 Version MM7Version SOAP Body String Mandatory
VASP ID VASPID SOAP Body String Optional
VAS ID VASID SOAP Body String Optional
Sender Address SenderAddress SOAP Body String Optional
Message ID MesageID SOAP Body String Mandatory

MM7_cancel.RES

Information SOAP Element Location Type Presence


Element Name

Transaction ID TransactionID SOAP Header String Mandatory


MM7 Version MM7Version SOAP Body String Mandatory
Response Status StatusCode SOAP Body String Mandatory
Response Text StatusText SOAP Body String Mandatory
Detail Description Details SOAP Body String Optional

Sample MM7_cancel.REQ
POST /soap/servlet/messagerouter HTTP/1.0
Host: 192.10.2.195
Content-Type: text/xml; charset=utf-8
Content-Length: 719
SOAPAction: ""

<?xml version='1.0' encoding='UTF-8'?>


<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<mm7:TransactionID env:mustUnderstand="1"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/sch
ema/REL-5-MM7-1-0">vas00001-sub</mm7:TransactionID>

MM7 Interface 1-12


Troubleshooting Manual: MMSC-3.1

</env:Header>
<env:Body>
<mm7:CancelReq xmlns:mm7="urn:mm7interface">
<mm7:MM7Version>1.0</mm7:MM7Version>
<mm7:SenderIdentification>
<mm7:VASPID>TNN</mm7:VASPID>
<mm7:VASID>8888</mm7:VASID>
<mm7:SenderAddress>JataayuVAS_SAMPLE</mm7:SenderAddress>
</mm7:SenderIdentification>

<mm7:MessageID>4GaU4nzr4WRVW400004VRyW.kWRqV4kc38Qc0Wg</mm7:MessageID
>
</mm7:CancelReq>
</env:Body>
</env:Envelope>

Sample MM7_cancel.RES
POST /soap/servlet/messagerouter HTTP/1.0
Host: 192.10.2.195
Content-Type: text/xml; charset=utf-8
Content-Length: 719
SOAPAction: ""

<?xml version='1.0' encoding='UTF-8'?>


<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<mm7:TransactionID env:mustUnderstand="1"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:mm7="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/sch
ema/REL-5-MM7-1-0">vas00001-sub</mm7:TransactionID>
</env:Header>
<env:Body>
<mm7:CancelRes xmlns:mm7="urn:mm7interface">
<mm7:MM7Version>1.0</mm7:MM7Version>
<mm7:Status>
<mm7:StatusCode>3001</mm7:StatusCode>
<mm7:StatusText>Not possible</mm7:StatusText>
<mm7:Detail></mm7:Detail>
</mm7:Status>
</mm7:CancelReq>
</env:Body>
</env:Envelope>

1-13 MM7 Interface


2 Sample Programs
2.1 Dependencies
The sample MM7 SOAP client requires following jar files in the CLASSPATH:
 xerces.jar Version 1.2.3
 mail.jar Version 1.3
 activation.jar Version 1.0 or above
 soap.jar Version 2.2 or above

2.2 S te p s to Write M M 7 S OA P C lie n t


1. Create an org.apache.soap.messaging.Message object
2. Add all attachments to the message object
3. Create SOAP Envelope XML
4. Send the SOAP Envelope and attachment(s) to the Servlet listening for
message oriented soap requests
5. Read the response SOAP Envelope
6. Parse the response SOAP Envelope

2.2.1 Program to send a MM7_Submit.REQ to the SOAP Server


/*The SOAP service urn is “urn:mm7interface” and must be deployed on the SOAP server.
* parameter List
 The message router Servlet URL is
“http://{SOAP_SERVER_IP}:{TOMCAT_PORT}/soap/servlet/messagerouter” and is
passed as first command line argument to this application.
 Service method name is SubmitReq and is the first child node after XML body
element. Service method name is passed as second command line argument to
this application.
 All subsequent command line arguments are the file names that will be sent as
attachments.
*/
import java.io.*;
import java.util.*;
import java.net.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.util.mime.*;
import org.apache.soap.*;
import org.apache.soap.transport.*;
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;
import org.apache.soap.rpc.*;
import org.apache.soap.messaging.*;
import javax.activation.*;
import javax.mail.internet.*;

Sample Programs 2-1


Troubleshooting Manual: MMSC-3.1

import javax.xml.parsers.*;

public class MM7Client {


public static void main(String[] args) throws Exception {
String encodingStyleURI = Constants.NS_URI_SOAP_ENC;
/* URL of the messagerouter servlet */
URL url = new URL(args[0]);
try {
// Build the Message. Step 1
Message msg = new Message () ;

// Add attachments. Step 2


String attachments = "" ;

for (int i = 2; i < args.length; i++) {


ByteArrayDataSource ds =
new ByteArrayDataSource (new File (args [i]), null);
DataHandler dh = new DataHandler (ds);
MimeBodyPart bp = new MimeBodyPart ();
bp.setDataHandler (dh);
bp.setFileName (args[i]);
bp.setHeader
(org.apache.soap.Constants.HEADER_CONTENT_LOCATION,"myfile" + (i -
2));
msg.addBodyPart (bp) ;
attachments += "\n<file size=\"" + ds.getSize()
+ "\" location =\"myfile" + (i - 2) + "\">"
+ args[i]
+ "</file>";
}

// Build the envelope. Step 3


String xmlmsg = "";

// SOAP Envelope.
xmlmsg += "<env:Envelope
xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"> \n" ;

// SOAP Header
xmlmsg += "<env:Header> \n" ;

// Transaction ID
xmlmsg += " <mm7:TransactionID
xmlns:mm7=\"http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/s
chema/REL-5-MM7-1-0\" env:mustUnderstand=\"1\">vas00001-
sub</mm7:TransactionID> \n" ;
xmlmsg += "</env:Header> \n" ;

// SOAP Body
xmlmsg += "<env:Body> \n" ;

Sample Programs 2-2


Troubleshooting Manual: MMSC-3.1

// args [1] is the service function


// mm7interface is the SOAP Service urn as deployed in the
SOAP Server
xmlmsg += " <mm7:" + args [1] + "
xmlns:mm7=\"urn:mm7interface\">\n" ;

xmlmsg += " <mm7:MM7Version>1.0</mm7:MM7Version> \n" ;


xmlmsg += " <mm7:SenderIdentification> \n" ;
xmlmsg += " <mm7:VASPID>TNN</mm7:VASPID> \n" ;
xmlmsg += " <mm7:VASID>News</mm7:VASID> \n" ;
xmlmsg += " </mm7:SenderIdentification> \n" ;

xmlmsg += " <mm7:Recipients> \n" ;


xmlmsg += " <mm7:To> \n" ;
xmlmsg += " <mm7:Number>9844001436</mm7:Number> \n"
;
xmlmsg += " </mm7:To> \n" ;
xmlmsg += " </mm7:Recipients> \n" ;

xmlmsg += "
<mm7:MessageClass>Informational</mm7:MessageClass> \n" ;
xmlmsg += " <mm7:TimeStamp>2005-09-
27T11:48:25</mm7:TimeStamp> \n" ;
xmlmsg += " <mm7:Priority>Normal</mm7:Priority> \n" ;
xmlmsg += " <mm7:Subject>News for today</mm7:Subject>
\n" ;

xmlmsg += " <mm7:Content href=\"cid:SaturnPics-930 \"


allowAdaptations=\"True\"/> \n" ;

xmlmsg += " </mm7:" + args [1] + "> \n" ;


xmlmsg += "</env:Body> \n" ;
xmlmsg += "</env:Envelope> \n" ;

DocumentBuilder xdb = XMLParserUtils.getXMLDocBuilder ();


Document doc = xdb.parse (new InputSource (new StringReader
(xmlmsg)));
if (doc == null) {
System.err.println ("Failed to parse XML");
return;
}

// SOAP Envelope. Step 3


Envelope msgEnv = Envelope.unmarshall
(doc.getDocumentElement());

// Invoke. Step 4
msg.send (url, "", msgEnv);

2-3 Sample Programs


Troubleshooting Manual: MMSC-3.1

// Receive response as DataHandler. Step 5


printObject(msg.receive());
} catch(Exception e) {
e.printStackTrace();
}
}

/* Parse the response object and prints the status. Step 6 */


public static void printObject(Object obj) {
if (obj instanceof DataHandler) {
DataHandler dh = (DataHandler)obj;
Object o;
try {
o = dh.getContent();
} catch(IOException ioe) {
o = ioe;
}
System.out.println("DataHandler, name=" + dh.getName()
+ ", type=" + dh.getContentType()
+ ", content: (" +
o.getClass().getName()
+ ")\n" + o);
DataSource ds = dh.getDataSource();
String fname = "" + System.currentTimeMillis() + ".out";
System.out.println(" Writing attachment to file: " +
fname);
try {
ByteArrayDataSource bds = new ByteArrayDataSource(
ds.getInputStream(), dh.getContentType());
bds.writeTo(new FileOutputStream(fname));
} catch(IOException ioe) {
System.out.println(ioe);
ioe.printStackTrace(System.err);
}
} else if (obj instanceof Vector) {
for (Enumeration enum = ((Vector)obj).elements();
enum.hasMoreElements(); )
printObject (enum.nextElement());
} else if (obj instanceof Object[]) {
Object[] s = (Object[])obj;
for (int i = 0; i < s.length; i++)
printObject(s[i]);
} else
System.out.println(obj);
}
}

Sample Programs 2-4


Troubleshooting Manual: MMSC-3.1

2.2.2 How to Compile and Execute


/* Provide absolute path for the following jar files */
CLASSPATH=xerces.jar
CLASSPATH=$CLASSPATH:mail.jar
CLASSPATH=$CLASSPATH:soap.jar
CLASSPATH=$CLASSPATH:activation.jar
CLASSPATH=$CLASSPATH:.

export $CLASSPATH
/* Compiling the client */
Javac –classpath $CLASSPATH MM7Clinet.java

/* Executing the client */


java –classpath $CLASSPATH MM7Client
http://192.10.2.6:8080/soap/servlet/messagerouter SubmitReq foo.txt

2-5 Sample Programs


Appendix A —Error Codes and Texts
The following table gives the MM7 Interfaces error codes and texts.

Status Code Status Text Meaning

1000 Success This code indicates that the request was executed
completely
1100 Partial success This code indicates that the request was executed
partially but some parts of the request could not be
completed. Lower order digits and the optional Details
element may indicate what parts of the request were
not completed.
2000 Client error Client made an invalid request
2001 Operation restricted The request was refused due to lack of permission to
execute the command.
2002 Address Error The address supplied in the request was not in a
recognized format or the MMS Relay/Server
ascertained that the address was not valid for the
network because it was determined not to be serviced
by this MMS Relay/Server. When used in response-
result, and multiple recipients were specified in the
corresponding push submission, this status code
indicates that at least one address is incorrect.
2003 Address Not Found The address supplied in the request could not be
located by the MMS Relay/Server. This code is
returned when an operation is requested on a
previously submitted message and the MMS
Relay/Server cannot find the message for the address
specified.
2004 Multimedia content The server could not parse the MIME content that was
refused attached to the SOAP message and indicated by the
Content element or the content size or media type was
unacceptable.
2005 Message ID Not found This code is returned when an operation is requested
on a previously submitted message and the MMS
Relay/Server cannot find the message for the
message ID specified or when the VASP receives a
report concerning a previously submitted message
and the message ID is not recognized.
2006 LinkedID not found This code is returned when a LinkedID was supplied
and the MMS Relay/Server could not find the related
message.
2007 Message format corrupt An element value format is inappropriate or incorrect.
3000 Server Error The server failed to fulfill an apparently valid request.
3001 Not Possible The request could not be carried out because it is not
possible. This code is normally used as a result of a
cancel or status query on a message that is no longer
available for cancel or status query. The MMS
Relay/Server has recognized the message in
question, but it cannot fulfill the request because the
message is already complete or status is no longer
available.
3002 Message rejected Server could not complete the service requested.
3003 Multiple addresses not The MMS Relay/Server does not support this

Appendix A —Error Codes and Texts 2-1


Troubleshooting Manual: MMSC-3.1

Status Code Status Text Meaning


supported operation on multiple recipients. The operation MAY
be resubmitted as multiple single recipient operations.
4000 General service error The requested service cannot be fulfilled.
4001 Improper identification Identification header of the request does not uniquely
identify the client (either the VASP or MMS
Relay/Server).
4002 Unsupported version The version indicated by the MM7 Version element is
not supported.
4003 Unsupported operation The server does not support the request indicated by
the Message Type element in the header of the
message.
4004 Validation error The SOAP and XML structures could not be parsed,
mandatory fields are missing, or the message-format
is not compatible to the format specified. Details field
may specify the parsing error that caused this status.
4005 Service error The operation caused a server (either MMS
Relay/Server or VASP) failure and should not be
resent.
4006 Service unavailable This indication may be sent by the server when
service is temporarily unavailable, e.g. when server is
busy
4007 Service denied The client does not have permission or funds to
perform the requested operation.

Appendix A —Error Codes and Texts 2-2


Appendix B — Deploy SOAP Service
How to deploy the SOAP service
Step 1: Create a deployment descriptor file.
Alongside the java source files for the Quotation Database service is the corresponding
deployment descriptor (DeploymentDescriptor.xml). If you are developing your own service
classes then note the sections shown in green below - these are where you will potentially
need to make changes. Explanatory notes follow.
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
id="urn:QuotationService">
<isd:provider type="java"
scope="Application"
methods="getAllQuotations submitQuotation">
<isd:java
class="com.soapuser.soap.server.quotation.QuotationDB"
static="false"/>
</isd:provider>

<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:fault
Listener>
</isd:service>

 id="urn:QuotationService" : This is where you specify the URN of the service. You
can choose any URN - but it will need to be made known to the client.
 scope="Application" : The scope refers to the lifetime of the service object (in our
case the QuotationDB object) and it can take one of three values. In this way you
can specify to the SOAP servlet how long the service object should stay alive.
Specifying Request means that the object will only live for the duration of the
service invocation. Specifying Session means that the object will remain alive as
long as the http session that created it (the object is available only to that http
session). We have specified Application to indicate that we want the service object
to be instantiated once and that everyone should share this object from then on.
This makes sense as our service class represents a shared database of
quotations where by "shared" we mean shared across all invocations and http
sessions.
 methods="getAllQuotations getQuotationsByAuthor submitQuotation" : This is
simply where you specify your service method names.
 class="com.soapuser.soap.server.quotation.QuotationDB" : The fully qualified
classname of the implementing class (note that following this, you can specify
static as true if the service methods are defined static in the implementing class).

Step 2: Register the service using the following command:


javaorg.apache.soap.server.ServiceManagerClient
http://localhost:8080/soap/servlet/rpcrouter deploy <deployment
descriptor file name>

Appendix B — Deploy SOAP Service 2-1


Appendix C — SOAP Messaging Client
Writing SOAP Messaging Client
Writing clients to access SOAP message-oriented services requires that you interact with a
lower-level set of Apache SOAP APIs than you would otherwise have to if you were writing a
SOAP RPC-based client. However, message-oriented services provide you with a finer grain
of control over what is actually being transmitted over SOAP. (In fact, the RPC mechanism is
built on type of this message-oriented layer.)
The basic steps for creating a client, which interacts with a SOAP message-oriented service,
are as follows:
1. Obtain the interface description of the SOAP service, so that you know what
the format of the SOAP message should be (i.e. what headers it should
have, what the body should look like, etc.) as well as the type of message
exchange which will take place. You can either look at a WSDL file (or at
some other interface definition format) for the service, or directly at its
implementation. Unlike SOAP RPC, there is no predefined message
exchange pattern defined, so a message-oriented service may return a
SOAP envelope, may return another type of data, or may return nothing at
all.
2. Construct an org.apache.soap.Envelope which contains the information that
the SOAP service requires. At the very least, you will need to add an
org.apache.soap.Body object to the envelope. You can optionally add
headers as well.

 When the message is received on the server, it will be routed to the proper service by
looking at the XML Namespace associated with the first child element in the body, and then to the
correct method/function within that service via the name of the element itself.
3. Create an org.apache.soap.messaging.Message object. If you need to add
MIME attachments to your message, then you can use addBodyPart(...)
method to do so. If you need to send your message over a transport other
than HTTP, then you will need to invoke the setSOAPTransport(...) method.
4. Invoke the send(...) method on the Message object, providing the URL of the
endpoint which is providing the service (i.e.
http://localhost/soap/servlet/messagerouter), the actionURI, and your
envelope.
5. If your service is returning data, and assuming that the transport supports
two-way interaction, then you need to retrieve the SOAPTransport object
from the Message object (assuming that you don't already have a handle to
it) by using the getSOAPTransport() method. You can then invoke the
receive() method on the SOAPTransport object to retrieve the returned data.
If the service is returning a SOAP Envelope, then you can parse the XML
and pass the root element to org.apache.soap.Envelope's unmarshall (..)
method to allow it to reconstruct a SOAP Envelope object for you. If an error
has occurred on the server during the processing of the request, the server
will automatically send back a SOAP Envelope with a SOAP Fault in the
body describing what went wrong.

Appendix C — SOAP Messaging Client 2-1


Appendix D — SOAP Service Handler
Writing SOAP messaging service handler
(A Java Implementation using apache SOAP 2.2)
 Create a service method with following signature
Example:
public static void ServiceMethodName (
Envelope env,
/*represents the contents and semantics *of an <SOAP-
ENV:Envelope> element. */
SOAP Context reqCtx,
/* Request Context */
SOAPContext retCtx
/* Response Context */
)
throws IOException, MessagingException
{
// Service method code
}

 Application can access the Soap Envelope using marshall ()


Example:
SOAPMappingRegistry smr = new SOAPMappingRegistry () ;
StringWriter payloadSW = new StringWriter () ;
env.marshall (payloadSW, smr, reqCtx) ;

 Application can access the Soap Attachments by using getBodyPart () of Request


Context Object
Example:
MimeBodyPart bp = reqCtx.getBodyPart (int count);

 Application must send appropriate response and setRootPart () of Response


Context can be used for the same.
Example:
retCtx.setRootPart (String ResponseString, String
ResponseContentType) ;

Appendix D — SOAP Service Handler 2-1


Document Change History
Table 1: Document Change History

Version Change Description Comments Date of Author


Number Mode of Changes Creation
(A/M/D)
1.0 Initial Release 9 Dec 2008 Prema

Source: Comviva

*A – Added, M – Modified, D – Deleted

Document Change History I


Contact Us
Corporate Office
A-26, Info City
Sector 34
Gurgaon 122001
Haryana, India
T: +91-124-4819000
F: +91-124-4819777

Bangalore Office
4, 12th Km
Bellary Road, Jakkur
Bangalore 560064
India
T: +91-80-43401600
F: +91-80-28565854

Mumbai Office
Unit 1-4, 1st Floor, Paradigm Tower
Tower B, Mindspace
Malad(W), Mumbai 400064, India
T: +91-22-40774300
F: +91-22-40774333

E-mail: techwriters@comviva.com

Contact Us III

S-ar putea să vă placă și