The Artima Developer Community
Sponsored Link

Web Services Forum
Exposing an API for XML-based I/O

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Hector Santos

Posts: 6
Nickname: hector
Registered: May, 2007

Exposing an API for XML-based I/O Posted: May 19, 2007 5:09 PM
Reply to this message Reply
Advertisement
Folks,

I am not sure I have the proper terminology, "Bridge" or converter, but I'm sure you experts can guide me in the right direction.

We have an C/C++ based RPC client/server and with rich client API and fixed type structures.

I need to explore the current methods, techniques, etc, for exposing the API and structures in a XML format for both I/O (read/write) operations:

AJAX <--> XML I/O <--> BRIDGE? <--> FIXED I/O <--> SERVER

A former engineer had written a API converter to create JAVA API using classes. This is for java based clients who have knowledge of the data structure via the auto-generated classes.

For example, for a simple C typedef struct:

typedef struct tagTUserInfo {
DWORD Id;
char Name[SIZE_USER_NAME];
char Title[SIZE_USER_TITLE];
} TUserInfo;

The CPP2JAVA converter will create this:

// File: TUserInfo.java
// (c) copyright 1996-2007 Santronics Software Inc.
//
//****************************************************
// DO NOT EDIT THIS FILE!!!
// CPP2JAVA GENERATED FROM SOURCE FILE: wctype.h
//****************************************************
//

package COM.winserver.wildcat;

import java.io.IOException;

public class TUserInfo extends WcRecord {
public int Id;
public String Name;
public String Title;

// Total size
public static final int SIZE = 0+4+72+12;

// Constructors
public TUserInfo()
{
}

public TUserInfo(byte[] x)
{
fromByteArray(x);
}

// Methods
protected void writeTo(WcOutputStream out) throws IOException
{
super.writeTo(out);
out.writeInt(Id);
out.writeString(Name, 72);
out.writeString(Title, 12);
}

protected void readFrom(WcInputStream in) throws IOException
{
super.readFrom(in);
Id = in.readInt();
Name = in.readString(72);
Title = in.readString(12);
}
}


I am not sure how we leverage this work for web-based AJAX clients.

Any comments, tips?

Thanks in Advance

Topic: VevoCart Free Asp.net Shopping Cart Previous Topic   Next Topic Topic: Have a doubt to resolve an erron

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use