To the person who wrote on Sunday-
I finally got the C# answer to returning a vector of Strings from a WSDL created by Axis:
Basically you have to return a struct Vector of  IEnumerable objects..

//here is a Main method to make everything work
static void Main()
{
     strings[] = {"Tom","Dick","Harry"};
     Vector f = new Vector(); //instantiate the struct
     foreach (string item in f)  //there are many strings within Vector
     {
         f.push(item); //push the values into the Vector
         Console.WriteLine(item); //write one string out at a time
      }
 }

struct Vector 
{
String s[]; //array of strings within vector..
static int ctr=0;
  //make a class that will push the strings into the vector
 push(str) { s[ctr++]=str; Tokens =new Tokens(s[ctr],',');} 
};

// tokens2.cs
using System;
using System.Collections;
public class Tokens: IEnumerable
{
static int ctr=0; private string[] elements; //contained in here are all the IEnumerable elements
// Test Method for Tokens, TokenEnumerator static void Main(string[] args) { Tokens f = new Tokens(args, new char [] = {' ','-',','}); //delimiters foreach (string item in f) { Console.WriteLine(item); } } Tokens(string source, char[] delimiters) { //split the source by delimiters elements[ctr++] = source.Split(delimiters); } //get the IEnumerable Interface Implementation (TokenEnumerator): public TokenEnumerator GetEnumerator() // non-IEnumerable version { return new TokenEnumerator(this); } IEnumerator IEnumerable.GetEnumerator() // IEnumerable version { return (IEnumerator) new TokenEnumerator(this); } // Inner class implements IEnumerator interface: public class TokenEnumerator: IEnumerator { //this inner class handles Enumerator positioning private int position = -1; private Tokens t; //Parent Class Tokens
//Constructor for Enumerator for Tokens public TokenEnumerator(Tokens t) { this.t = t; }
//Move position to next object public bool MoveNext() { if (position < t.elements.Length - 1) { position++; return true; } else { return false; } } //move position to default -1 public void Reset() { position = -1; } //return the String value of the element located at Current position public string Current // non-IEnumerator version: type-safe { get { return t.elements[position]; } } //return the object of the element located at Current Position object IEnumerator.Current // IEnumerator version: returns object { get { return t.elements[position]; } } } }
I am not a C# expert and this needs ALOT OF WORK but you get the gist of how to handle a vector of strings in C#


hth,
Martin Gainty

______________________________________________

Disclaimer and confidentiality note

Everything in this e-mail and any attachments relating to the official business of Laconia Data Systems (LDS) is proprietary to the company. It is confidential, legally privileged and protected by law. LDS does not own and endorse any other content.

<
>From: "Ghershony, Arie" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: interoperability. SPROXY
>Date: Mon, 10 Mar 2003 16:04:43 -0500
>MIME-Version: 1.0
>Received: from apache.org ([208.185.179.12]) by mc6-f13.law1.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Mon, 10 Mar 2003 13:07:50 -0800
>Received: (qmail 66304 invoked by uid 500); 10 Mar 2003 21:07:27 -0000
>Received: (qmail 66294 invoked from network); 10 Mar 2003 21:07:27 -0000
>Received: from ns0.gdgsc.com (HELO Newman.GSC.GTE.Com) (192.160.62.66) by daedalus.apache.org with SMTP; 10 Mar 2003 21:07:27 -0000
>Received: from gscex01.gsc.gte.com ("port 4415"@gscex01.gsc.gte.com [155.95.162.170]) by Newman.GSC.GTE.Com (PMDF V6.1-1 #38231) with ESMTP id <[EMAIL PROTECTED]> for [EMAIL PROTECTED]; Mon, 10 Mar 2003 16:07:31 -0400 (EDT)
>Received: by gscex01.gsc.gte.com with Internet Mail Service (5.5.2653.19)id ; Mon, 10 Mar 2003 16:09:34 -0500
>X-Message-Info: JGTYoYF78jEHjJx36Oi8+Q1OJDRSDidP
>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>Precedence: bulk
>list-help:
>list-unsubscribe:
>list-post:
>Delivered-To: mailing list [EMAIL PROTECTED]
>Content-return: allowed
>Message-id: <[EMAIL PROTECTED]>
>X-Mailer: Internet Mail Service (5.5.2653.19)
>X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>Return-Path: [EMAIL PROTECTED]
>X-OriginalArrivalTime: 10 Mar 2003 21:07:50.0554 (UTC) FILETIME=[1BD79FA0:01C2E749]
>
>
>
>I have a WSDL that was written in AXIS/Java. and the client is .NET C++ .
>I used SPROXY to read that WSDL file and receive the following error: how
>should I handle: "Anytype??
>
>Thanks,
>Aria:
>
>
>
>C:\UIX\UIXClient\UIXClient>sproxy /out:C:\UIX\EOBservice.h
>http://ccvaapps02:80
>80/axis/services/MessageService4?wsdl
>Microsoft (R) Native Web Service Proxy Generator 7.00.9466
>Copyright (C) Microsoft Corporation 1999-2001. All rights reserved.
>
>sproxy : error SDL1009 : could not resolve element, with
> [
> namespace = "http://www.w3.org/2001/XMLSchema"
> name = "anyType"
> ]
>
>sproxy : error SDL1002 : failure in generating output file:
>"C:\UIX\EOBservice.h
>"
>
>SPROXY Error SDL1009
>See Also
>SPROXY.EXE: Web Service Proxy Generation Tool
>
>could not resolve element, with
>[
>namespace = "namespace"
>name = "name"
>]
>SPROXY has encountered a reference to an element it cannot find in the WSDL
>document.
>
>
>
>This is my WSDL file:
>
>
>- >targetNamespace="http://localhost:8080/axis/services/MessageService4"
>xmlns="http://schemas.xmlsoap.org/wsdl/"
>xmlns:apachesoap="http://xml.apache.org/xml-soap"
>xmlns:impl="http://localhost:8080/axis/services/MessageService4"
>xmlns:intf="http://localhost:8080/axis/services/MessageService4"
>xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>xmlns:xsd="http://www.w3.org/2001/XMLSchema">
>-
>
>
>
>-
>-
> >/>
> >name="echoElementsResponse" />
>
>
>- >type="impl:MessageService4">
> >transport="http://schemas.xmlsoap.org/soap/http" />
>-
>
>-
> >namespace="http://localhost:8080/axis/services/MessageService4"
>use="literal" />
>
>-
> >namespace="http://localhost:8080/axis/services/MessageService4"
>use="literal" />
>
>
>
>-
>- >name="MessageService4">
> >location="http://localhost:8080/axis/services/MessageService4" />
>
>
>


STOP MORE SPAM with the new MSN 8 and get 2 months FREE*

Reply via email to