Saving a service using save_service and the response message in .NET

Maker GS1 - 13 in .NET Saving a service using save_service and the response message
Listing 11-19 Saving a service using save_service and the response message
EAN13 Creation In .NET
Using Barcode drawer for .NET framework Control to generate, create EAN-13 image in .NET applications.
<!-- saving a service to an existing business -->
Recognizing EAN 13 In Visual Studio .NET
Using Barcode reader for .NET framework Control to read, scan read, scan image in Visual Studio .NET applications.
TEAM FLY PRESENTS
Making Bar Code In Visual Studio .NET
Using Barcode generation for VS .NET Control to generate, create barcode image in .NET framework applications.
<save_service generic="20" xmlns="urn:uddi-org:api_v2"> <authInfo>1BAAAAAAA</authInfo> <businessService businessKey="677cfa1a-2717-4620-be39-6631bb74b6e1" serviceKey=""> <name xml:lang="en">Time service</name> <description xml:lang="en">Server time service</description> <bindingTemplates> <bindingTemplate bindingKey=""> <accessPoint URLType="http"> http://wwwlearnxmlwscom/services/serverTimeasmx </accessPoint> <tModelInstanceDetails> <tModelInstanceInfo tModelKey="uuid:7f30bebd-35cc-4873-8f91-f53f779d92fd"> <instanceDetails> <overviewDoc> <overviewURL> http://wwwlearnxmlwscom/services/serverTimeasmx WSDL </overviewURL> </overviewDoc> </instanceDetails> </tModelInstanceInfo> </tModelInstanceDetails> </bindingTemplate> </bindingTemplates> </businessService> </save_service>
Scan Bar Code In .NET
Using Barcode scanner for .NET framework Control to read, scan read, scan image in .NET applications.
TEAM FLY PRESENTS
Creating EAN / UCC - 13 In Visual Studio .NET
Using Barcode generator for ASP.NET Control to generate, create GTIN - 13 image in ASP.NET applications.
<!-- response --> <serviceDetail generic="20" operator="Microsoft Corporation" truncated="false" xmlns="urn:uddi-org:api_v2"> <businessService serviceKey="8267329b-535e-4366-9059-d5c3124460cd" businessKey="677cfa1a-2717-4620-be39-6631bb74b6e1"> <name xml:lang="en">Time service</name> <description xml:lang="en">Server time service</description> <bindingTemplates> <bindingTemplate bindingKey="0f694b511-5852-451c-8b03-5b91330dff83" serviceKey="8267329b-535e-4366-9059-d5c3124460cd"> <accessPoint URLType="http"> http://wwwlearnxmlwscom/services/serverTimeasmx </accessPoint> <tModelInstanceDetails> <tModelInstanceInfo tModelKey="uuid:7f30bebd-35cc-4873-8f91-f53f779d92fd"> <instanceDetails> <overviewDoc> <overviewURL> http://wwwlearnxmlwscom/services/serverTimeasmx WSDL </overviewURL> </overviewDoc> </instanceDetails> </tModelInstanceInfo>
Generating Bar Code In VS .NET
Using Barcode maker for .NET Control to generate, create barcode image in Visual Studio .NET applications.
TEAM FLY PRESENTS
Barcode Creation In .NET Framework
Using Barcode creation for VS .NET Control to generate, create barcode image in .NET framework applications.
</tModelInstanceDetails> </bindingTemplate> </bindingTemplates> </businessService> </serviceDetail>
Drawing UPC-A Supplement 5 In .NET
Using Barcode generator for .NET framework Control to generate, create UPC-A Supplement 5 image in VS .NET applications.
The returned businessService structure contains newly assigned serviceKey and bindingKey Others can later use these keys with get_serviceDetails and get_bindingDetails to get service and binding details respectively To update this service, you send another save_service message with the new information and the serviceKey to indicate you want to update an existing service vs create a new one
ECC200 Generator In .NET Framework
Using Barcode encoder for .NET Control to generate, create DataMatrix image in VS .NET applications.
Specifying Business Relations To associate two businesses, you send a set_publisherAssertions message with the keys of the two businesses that you want to associate and a keyedReference indicate the relation type (see the section on publisherAssertion data structure) The example in listing 11-20 sends a message to associate the business entities DevXpert and LearnXmlWS specifying parent-child as the relation type
Painting Identcode In Visual Studio .NET
Using Barcode printer for .NET Control to generate, create Identcode image in VS .NET applications.
Listing 11-20 Relating business entities with set_publisherAssertions and the corresponding response message
Code 3 Of 9 Drawer In Visual Basic .NET
Using Barcode creator for VS .NET Control to generate, create ANSI/AIM Code 39 image in .NET framework applications.
<!-- set publisher assertions --> <set_publisherAssertions generic="20" xmlns="urn:uddi-org:api_v2"> <authInfo>1BAAAAAAAH!</authInfo> <publisherAssertion> <fromKey>1030973b-c87d-4e00-bc16-f3a815f2d883</fromKey> <toKey>677cfa1a-2717-4620-be39-6631bb74b6e1</toKey> <keyedReference tModelKey="uuid:807a2c6a-ee22-470d-adc7-e0424a337c03" keyName="BusinessRelation" keyValue="parent-child" /> </publisherAssertion> </set_publisherAssertions> <!-- set publisher assertions response -->
Painting ANSI/AIM Code 39 In Visual C#.NET
Using Barcode creation for .NET framework Control to generate, create Code 39 image in VS .NET applications.
TEAM FLY PRESENTS
Make Code128 In Visual C#.NET
Using Barcode generation for .NET Control to generate, create Code 128 Code Set A image in Visual Studio .NET applications.
<publisherAssertions operator="Microsoft Corporation" authorizedName=" Yasser Shohoud" generic="20" xmlns="urn:uddi-org:api_v2"> <publisherAssertion> <fromKey>1030973b-c87d-4e00-bc16-f3a815f2d883</fromKey> <toKey>677cfa1a-2717-4620-be39-6631bb74b6e1</toKey> <keyedReference tModelKey="uuid:807a2c6a-ee22-470d-adc7-e0424a337c03" keyName="BusinessRelation" keyValue="parent-child" /> </publisherAssertion> </publisherAssertions>
Data Matrix Creator In Java
Using Barcode generation for Java Control to generate, create Data Matrix 2d barcode image in Java applications.
The response message returns a list of all assertions made by the publisher who s identified by authInfo Since the publisher in this case is the authorized owner of both businesses, one set_publisherAssertions message is sufficient to establish the relation Otherwise, if the two businesses are managed by two different publishers, each publisher must submit a set_publisherAssertions message with the same content for the relation to be established
Painting ANSI/AIM Code 128 In VS .NET
Using Barcode generator for ASP.NET Control to generate, create Code 128A image in ASP.NET applications.
An Inquiry Example
USS Code 39 Decoder In VS .NET
Using Barcode scanner for VS .NET Control to read, scan read, scan image in Visual Studio .NET applications.
Choosing Services That Implement a Specific Interface Here s a sample application that searches for services implementing a specific interface and lets the user choose which service to invoke This application uses the UDDI APIs directly by forming and sending SOAP messages The application is Web based using ASPNET You can access this application on your server using the URL http://VBWSServer/VBWSBook/11/WeatherChooseraspx The first page, weatherchooseraspx, sends a find_business message with a tModelBag that contains the tModelKey of the Weather service interface To form the message, the application uses an XmlTextWriter and a StringWriter as shown in listing 11-24 It then uses an instance of UDDIAPI to call SendInquiryMsg passing it the find_business message UDDIAPI is a class I wrote to send messages to the UDDI registry You pass it the message, it wraps it in a SOAP envelope then uses HttpWebRequest and HttpWebResponse to send and receive the HTTP POST request It then returns the response as a string Listing 11-21 Finding services that implement the weather interface (VBWSBook\11 \WeatherChooseraspxvb)
Create Data Matrix In C#.NET
Using Barcode generation for VS .NET Control to generate, create Data Matrix 2d barcode image in .NET framework applications.
Private Sub lnkView_Click(ByVal sender As SystemObject, _ ByVal e As SystemEventArgs) Handles lnkViewClick
Bar Code Maker In Java
Using Barcode creation for Java Control to generate, create bar code image in Java applications.
TEAM FLY PRESENTS
Code-39 Creator In Java
Using Barcode maker for Java Control to generate, create Code 39 Full ASCII image in Java applications.
Dim sw As New StringWriter() Dim xw As New XmlTextWriter(sw) 'form the message xwWriteStartElement("find_business", UDDI_NS) xwWriteAttributeString("generic", "20") xwWriteStartElement("tModelBag") xwWriteElementString("tModelKey", KEY) xwWriteEndElement() xwWriteEndElement() reqMsgText = swToString()
Bar Code Maker In Visual Basic .NET
Using Barcode encoder for .NET framework Control to generate, create bar code image in Visual Studio .NET applications.
Dim listsw As New StringWriter() Dim uddi As New UDDIAPI() Dim resp As String 'send the message resp = uddiSendInquiryMsg(swToString(), False) respMsgText = resp
'parse the response using the DOM Dim doc As New XmlDocument() Dim nl As XmlNodeList Dim bus As XmlNode Dim nsmgr As XmlNamespaceManager = _ New XmlNamespaceManager(docNameTable) nsmgrAddNamespace("u", UDDI_NS) docLoadXml(resp) nl = docSelectNodes("//u:businessInfo", nsmgr) If nlCount = 0 Then
TEAM FLY PRESENTS
'no businesses found Else 'display the list of businesses For Each bus In nl 'note: the following line contained HTML what was too long 'to print, please see the code file weatherchooseraspxvb listswWriteLine("see code file for HTML that goes here " _ busSelectSingleNode("u:name", nsmgr)InnerText, _ busSelectSingleNode( _ "u:serviceInfos/u:serviceInfo/u:name", nsmgr)InnerText, _ busSelectSingleNode( _ "u:serviceInfos/u:serviceInfo/@serviceKey", _ nsmgr)InnerText) Next End If serviceListInnerHtml = listswToString() End Sub
To parse the returned list of businesses, the code in listing 11-24 loads this string into a DOM document and uses XPath queries with SelectNodes and SelectSingleNode to find the business name, service name, and service key The service key is particularly important as it will be passed to the next page when the user chooses a service to invoke The parsed information is then formatted with HTML and added to the output stream that gets sent to the browser Each service listed has a hyperlink that points to weatheraspx with the service id in the query string, eg: http://VBWSServer/VBWSBook/11/Weatheraspx id=7c19ab87-1bc5-4fb6-841b-a4149a802a71 As an added bonus, I display the find_business message and its response at the bottom of the page so you can see what message was sent to UDDI and the response that came back Figure 11-17 shows an example weatherchooseraspx page