• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Web Service  Basics and NWS Setup
 

Web Service Basics and NWS Setup

on

  • 647 views

SOAP Web Service Extension of NetSuite.

SOAP Web Service Extension of NetSuite.

Statistics

Views

Total Views
647
Views on SlideShare
647
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Web Service  Basics and NWS Setup Web Service Basics and NWS Setup Presentation Transcript

    • Web Service ArchitecturePrem Krishna Chettri
    • Table of Contents What’s Web Service? Why Web Service? Architecture Overview XML SOAP WSDL NetSuite Web Service
    • What’s Is Web Service? Web services are application programming interfaces(API) or Web APIs that are accessed via someprotocols like HTTP. “Software application identified by a URI, whoseinterfaces and bindings are capable of beingdefined, described, and discovered as XML artifacts”– W3C Web Services ArchitectureRequirements, Oct. 2002
    • Why Web Services? Allow companies to reduce the cost of doing e-business, to deploy solutions faster Need a common program-to-program communicationsmodel Allow heterogeneous applications to be integratedmore rapidly, easily and less expensively Facilitate deploying and providing access to businessfunctions over the Web
    • XML XML Inherited from SGML which is a markuplanguage like HTML. XML stands for Extensible Markup Languagebecause we can Extend its capability. XML uses parser to decode the file content.Example :- <?xml version="1.0"?> <note> <to>Receiver</to> <from>Sender </from> <heading>Reminder</heading> <body>Message Body!</body> </note>
    • SOAP: Simple ObjectAccess Protocol What is SOAP? SOAP is a communication protocol SOAP is for communication between applications SOAP is a format for sending messages SOAP is designed to communicate via Internet SOAP is platform independent SOAP is language independent SOAP is based on XML SOAP is simple and extensible SOAP will be developed as a W3C standard
    • SOAP Message Structure Request and Response messages Request invokes a method on a remoteobject Response returns result of running themethod SOAP specification defines an“envelop” “envelop” wraps the message itself Message is a different vocabulary Namespace prefix is used to distinguishthe two partsApplication-specificmessage vocabularySOAP Envelopvocabulary
    • SOAP Request Message<?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"><soap:Body xmlns:m="http://www.stock.org/stock"></soap:Body></soap:Envelope><m:GetStockPrice><m:StockName>IBM</m:StockName></m:GetStockPrice>SOAP EnvelopeMessageSOAP EnvelopeNamespaceMessageNamespace
    • SOAP Response Message<?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"><soap:Body xmlns:m="http://www.stock.org/stock"></soap:Body></soap:Envelope><m:GetStockPriceResponse><m:Price>34.5</m:Price></m:GetStockPriceResponse>SOAP EnvelopeMessageResultreturned inBody
    • Web Services Description Language What is WSDL? WSDL is written in XML WSDL is an XML document WSDL is used to describe Web services WSDL is also used to locate Web services WSDL is not yet a W3C standard Operational information about the service Location of the service Service interface Implementation details for the service interface
    • WSDL Document Structure (1/2) <portType> element Defines a web service, the operations that can beperformed, and the messages that are involved <message> element Defines the data elements of an operation consists of one or more parts. The parts can be compared to the parameters of afunction call in a traditional programming language
    • WSDL Document Structure (2/2) <types> element Defines the data type that are used by the webservice For maximum platform neutrality, WSDL uses XMLSchema syntax to define data types <binding> element Defines the message format and communicationprotocols used by the web service
    • NetSuite WSDL <defination xmlns:..> <types> <xsd:schema xmlns:xsd=“http://www.w3.org/2001/XMLSchema”> <xsd:import namespace=“ “ schemaLocation=“ ”> <xsd:import namespace=“ “ schemaLocation=“ ”> ………. </xsd:schema> </types> <message name=“ ”> <part name =“ “ element =“ ”> </message> <portType name=“NetSuitePortType”> <operation name=“Login”> <input name = “ login Request” message=“tns:loginRequest”> <outpur name=“loginResponse” message=“tns:loginResponse”> </operation> </portType>
    • WSDL Continuation <binding name="NetSuiteBinding" type="tns:NetSuitePortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="login"> <soap:operation soapAction="login"/> <input name="loginRequest"> <soap:header message="tns:headers" part="applicationInfo" use="literal"/> <soap:header message="tns:headers" part="partnerInfo" use="literal"/> <soap:body use="literal"/> </input> <output name="loginResponse"> <soap:body use="literal"/> </output> <fault name="InsufficientPermissionFault"> <soap:fault name="InsufficientPermissionFault" use="literal"/> </fault> </operation> </binding> <service name="NetSuiteService"> <port name="NetSuitePort" binding="tns:NetSuiteBinding"> <soap:address location="https://webservices.netsuite.com/services/NetSuitePort_2012_2"/> </port> </service> </definitions>
    • XML Schema Definition (XSD) An XML schema describes the structure of anXML document.NetSuite XSD’s:-1>core.xsd,2>messages.xsd,3>faults.xsd,4>common.xsd etc.
    • Web Service Model (1/3)
    • Web Service Model (2/3) Roles in Web Service architecture Service provider Owner of the service Platform that hosts access to the service Service requestor Business that requires certain functions to be satisfied Application looking for and invoking an interaction with aservice Service registry Searchable registry of service descriptions where serviceproviders publish their service descriptions
    • Web Service Model (3/3) Operations in a Web Service Architecture Publish Service descriptions need to be published in order forservice requestor to find them Find Service requestor retrieves a service description directlyor queries the service registry for the service required Bind Service requestor invokes or initiates an interaction withthe service at runtime
    • NetSuite WebServices General Setup (UI) :- To enable the Web services feature:1. As administrator, click Setup > Company > Enable Features.2. Click the SuiteCloud tab.3. Select the Web Services check box.4. Click Save. Enable Show Internal ID from :-1. Home > Set Preferences.2. Click the General Tab.3. check the Show Internal IDs box.
    • NetSuite IDE Setup Project Setup :-1> Install the IDE ( Visual Studio or Eclipse).2> Create a New Project.3> Add Web Reference. Using Below given URL’s WSDL URL :-https://webservices.netsuite.com/wsdl/v2012_2_0/netsuite.wsdl SOAP URL :-https://webservices.netsuite.com/services/NetSuitePort_2012_2Note :- Use dynamic method to get the correct service url’s by getDataCenterUrls() api. WebService Listener :-https://webservice.na1.netsuite.com Schema Browser (For Reference):-https://system.netsuite.com/help/helpcenter/en_US/SchemaBrowser/indexv2012_2_0.html
    • Web Services Class and API’s “NetSuiteService” Class is a primary Classexposed by NetsuiteWeb Interface. It has exposed Events and API’sExample :- add, delete, update, initializeget, search etc.
    • Practical’s NextQ&A
    • Thank You