Loading ...
Sorry, an error occurred while loading the content.

10453RE: [soapbuilders] Re: Problems with WSDL

Expand Messages
  • Zina Kalish
    Oct 27, 2005
    • 0 Attachment
      Hi,
      I create a web service in java and deployed it using Eclipse and Embeded
      wasp werver. A method doesn't have parameter and returns a string. Beloow
      is wsdl which I got. A client is C#. I generated client proxy useing
      microsoft wsdl.exe tool.

      wsdl:
      <?xml version="1.0" encoding="UTF-8"?>
      <definitions name="com.TestWsdl"
      targetNamespace="http://systinet.com/wsdl/com/"
      xmlns:tns="http://systinet.com/wsdl/com/"
      xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:map="http://systinet.com/mapping/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns="http://schemas.xmlsoap.org/wsdl/">
      <message name="TestWsdl_getName_Request_Soap"/>
      <message name="TestWsdl_getName_Response_Soap">
      <part name="response" type="xsd:string"/>
      </message>
      <portType name="TestWsdl">
      <operation name="getName">
      <input message="tns:TestWsdl_getName_Request_Soap"/>
      <output message="tns:TestWsdl_getName_Response_Soap"/>
      </operation>
      </portType>
      <binding name="TestWsdl" type="tns:TestWsdl">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
      style="rpc"/>
      <operation name="getName">
      <map:java-operation name="getName"
      signature="KClMamF2YS9sYW5nL1N0cmluZzs="/>
      <soap:operation style="rpc"/>
      <input>
      <soap:body use="encoded"

      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

      namespace="http://systinet.com/wsdl/com/TestWsdl#getName?KClMamF2YS9sYW5nL1N
      0cmluZzs="/>
      </input>
      <output>
      <soap:body parts="response" use="encoded"

      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

      namespace="http://systinet.com/wsdl/com/TestWsdl#getName?KClMamF2YS9sYW5nL1N
      0cmluZzs="/>
      </output>
      </operation>
      </binding>
      <binding name="TestWsdl_SOAP12" type="tns:TestWsdl">
      <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
      style="rpc"/>
      <operation name="getName">
      <map:java-operation name="getName"
      signature="KClMamF2YS9sYW5nL1N0cmluZzs="/>
      <soap12:operation style="rpc"/>
      <input>
      <soap12:body use="encoded"
      encodingStyle="http://www.w3.org/2003/05/soap-encoding"

      namespace="http://systinet.com/wsdl/com/TestWsdl#getName?KClMamF2YS9sYW5nL1N
      0cmluZzs="/>
      </input>
      <output>
      <soap12:body parts="response" use="encoded"
      encodingStyle="http://www.w3.org/2003/05/soap-encoding"

      namespace="http://systinet.com/wsdl/com/TestWsdl#getName?KClMamF2YS9sYW5nL1N
      0cmluZzs="/>
      </output>
      </operation>
      </binding>
      <service name="TestWsdl">
      <port name="TestWsdl" binding="tns:TestWsdl">
      <soap:address location="url here"/>
      </port>
      <port name="TestWsdl_SOAP12" binding="tns:TestWsdl_SOAP12">
      <soap12:address
      location="url here"/>
      </port>
      </service>
      </definitions>

      This is Java class
      /*
      * Created on Oct 27, 2005
      *
      * TODO To change the template for this generated file go to
      * Window - Preferences - Java - Code Style - Code Templates
      */
      package com;

      /**
      * @author zina kalish
      *
      * TODO To change the template for this generated type comment go to Window
      -
      * Preferences - Java - Code Style - Code Templates
      */
      public class TestWsdl {

      public String getName() {
      return "My name is Zina";
      }
      }

      Here is client:
      using System;

      namespace TestWsdlClient
      {
      /// <summary>
      /// Summary description for Class1.
      /// </summary>
      class Class1
      {
      /// <summary>
      /// The main entry point for the application.
      /// </summary>
      [STAThread]
      static void Main(string[] args)
      {
      TestWsdl pr = new TestWsdl();
      string str = pr.getName();
      Console.WriteLine("result is '"+str+"'");
      }
      }
      }

      Client Proxy is here:

      //--------------------------------------------------------------------------
      ----
      // <autogenerated>
      // This code was generated by a tool.
      // Runtime Version: 1.1.4322.2032
      //
      // Changes to this file may cause incorrect behavior and will be lost if

      // the code is regenerated.
      // </autogenerated>
      //--------------------------------------------------------------------------
      ----

      //
      // This source code was auto-generated by wsdl, Version=1.1.4322.2032.
      //
      using System.Diagnostics;
      using System.Xml.Serialization;
      using System;
      using System.Web.Services.Protocols;
      using System.ComponentModel;
      using System.Web.Services;


      /// <remarks/>
      // CODEGEN: The optional WSDL extension element 'java-operation' from
      namespace 'http://systinet.com/mapping/' was not handled.
      [System.Diagnostics.DebuggerStepThroughAttribute()]
      [System.ComponentModel.DesignerCategoryAttribute("code")]
      [System.Web.Services.WebServiceBindingAttribute(Name="TestWsdl",
      Namespace="http://systinet.com/wsdl/com/")]
      public class TestWsdl : System.Web.Services.Protocols.SoapHttpClientProtocol
      {

      /// <remarks/>
      public TestWsdl() {
      this.Url = "http://xena.braintech.com:6060/TestWsdl/";
      }

      /// <remarks/>
      [System.Web.Services.Protocols.SoapRpcMethodAttribute("",
      RequestNamespace="http://systinet.com/wsdl/com/TestWsdl#getName?KClMamF2YS9s
      YW5nL1N0cmluZzs=",
      ResponseNamespace="http://systinet.com/wsdl/com/TestWsdl#getName?KClMamF2YS9
      sYW5nL1N0cmluZzs=")]
      [return: System.Xml.Serialization.SoapElementAttribute("response")]
      public string getName() {
      object[] results = this.Invoke("getName", new object[0]);
      return ((string)(results[0]));
      }

      /// <remarks/>
      public System.IAsyncResult BegingetName(System.AsyncCallback callback,
      object asyncState) {
      return this.BeginInvoke("getName", new object[0], callback,
      asyncState);
      }

      /// <remarks/>
      public string EndgetName(System.IAsyncResult asyncResult) {
      object[] results = this.EndInvoke(asyncResult);
      return ((string)(results[0]));
      }
      }

      It works fine.
      I hope it will help.

      Regards

      Zina
      -----Original Message-----
      From: umike777 [mailto:umike777@...]
      Sent: October 27, 2005 6:55 AM
      To: soapbuilders@yahoogroups.com
      Subject: [soapbuilders] Re: Problems with WSDL


      No, WSDL is generated from java classes with Axis,
      but it's no compatible with .NET
      and i try to understand whi is that...

      How to define method with no input params and with one output param
      in WSDL with rpc/encoded style? Also this method must receive header.


      <nilesh_s_ghorpade@y...> wrote:
      >
      > Hi,
      >
      > Are you writing the WSDL manually or generating it
      > using some tool. As far as I can understand if you use
      > some tool to generate a WSDL then all your problems
      > should be resolved.
      >
      > Hope this helps.
      >
      > Regards
      >
      > Nilesh
      >
      > --- umike777 <umike777@y...> wrote:
      >
      > > Hello!
      > > I have WSDL from web-service (java) (at the end of
      > > message)
      > >
      > > How i can describe in WSDL (rpc/encoded)
      > > method with no parameters, but with return value and
      > > with header
      > >
      > > when i describe like this
      > >
      > > <wsdl:binding name="TestSoapBinding"
      > > type="impl:Test">
      > > <wsdlsoap:binding style="rpc"
      > > transport="http://schemas.xmlsoap.org/soap/http"/>
      > > <wsdl:operation name="getTestURL">
      > >
      > > <wsdlsoap:operation soapAction=""/>
      > > <wsdl:input name="getTestURLRequest">
      > > <wsdlsoap:body
      > >
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > >
      > >
      > namespace="http:/www.site.ru/namespace/Site/Web/Test"
      > > use="encoded"/>
      > > <wsdlsoap:header
      > >
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > >
      > > message="impl:getTestURLRequest"
      > >
      > namespace="http:/www.site.ru/namespace/Site/Web/Test"
      > >
      > > part="userContext" use="encoded">
      > > </wsdlsoap:header>
      > > </wsdl:input>
      > > <wsdl:output name="getTestURLResponse">
      > > <wsdlsoap:body
      > >
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > >
      > >
      > namespace="http:/www.site.ru/namespace/Site/Web/Test"
      > > use="encoded"/>
      > > </wsdl:output>
      > > <wsdl:fault name="TestException">
      > > <wsdlsoap:fault
      > >
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > >
      > > name="TestException"
      > >
      > namespace="http:/www.site.ru/namespace/Site/Web/Test"
      > > use="encoded"/>
      > > </wsdl:fault>
      > > </wsdl:operation>
      > > </wsdl:binding>
      > >
      > > some toolkit like MS (wsdl.exe) �reate proxy with
      > > getTestUrlRequest
      > > (userContext), not getTestUrlRequest()
      > > i see strange solution for this ... set parts="" to
      > > wsdl:input, but
      > > MS toolkit (wsdl.exe) don't understand this
      > >
      > > Thanks
      > >
      > >
      > >
      > > <?xml version="1.0" encoding="UTF-8"?>
      > > <wsdl:definitions
      > >
      > targetNamespace="http:/www.site.ru/namespace/Site/Web/Test"
      > >
      > > xmlns:apachesoap="http://xml.apache.org/xml-soap"
      > >
      > xmlns:impl="http:/www.site.ru/namespace/Site/Web/Test"
      > >
      > >
      > xmlns:intf="http:/www.site.ru/namespace/Site/Web/Test"
      > >
      > >
      > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      > >
      > > xmlns:tns1="http:/www.site.ru/namespace/Site/Web"
      > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      > >
      > xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
      > >
      > > xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      > > <wsdl:types>
      > > <schema
      > >
      > targetNamespace="http:/www.site.ru/namespace/Site/Web"
      > >
      > > xmlns="http://www.w3.org/2001/XMLSchema">
      > > <import
      > >
      > namespace="http:/www.site.ru/namespace/Site/Web/Test"/>
      > > <import
      > >
      > namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      > > <complexType name="userContext">
      > > <sequence>
      > > <element name="name" nillable="true"
      > > type="xsd:string"/>
      > > <element name="password" nillable="true"
      > > type="xsd:string"/>
      > > </sequence>
      > > </complexType>
      > > <complexType name="wsException">
      > > <sequence>
      > > <element name="code" nillable="true"
      > > type="xsd:string"/>
      > > <element name="localMessage" nillable="true"
      > > type="xsd:string"/>
      > > <element name="type" nillable="true"
      > > type="xsd:string"/>
      > > </sequence>
      > > </complexType>
      > > <complexType name="exception">
      > > <complexContent>
      > > <extension base="tns1:wsException">
      > > <sequence/>
      > > </extension>
      > > </complexContent>
      > > </complexType>
      > > </schema>
      > > </wsdl:types>
      > > <wsdl:message name="getTestURLResponse">
      > > <wsdl:part name="getTestURLReturn"
      > > type="xsd:string"/>
      > > </wsdl:message>
      > > <wsdl:message name="getTestURLRequest">
      > > <wsdl:part name="userContext"
      > > type="tns1:userContext"/>
      > > </wsdl:message>
      > > <wsdl:message name="TestException">
      > > <wsdl:part name="fault"
      > > type="tns1:exception"/>
      > > </wsdl:message>
      > > <wsdl:portType name="Test">
      > > <wsdl:operation name="getTestURL"
      > > parameterOrder="userContext">
      > > <wsdl:input
      > > message="impl:getTestURLRequest"
      > > name="getTestURLRequest"/>
      > > <wsdl:output
      > > message="impl:getTestURLResponse"
      > > name="getTestURLResponse"/>
      > > <wsdl:fault message="impl:TestException"
      > > name="TestException"/>
      > > </wsdl:operation>
      > > </wsdl:portType>
      > > <wsdl:binding name="TestSoapBinding"
      > > type="impl:Test">
      > > <wsdlsoap:binding style="rpc"
      > > transport="http://schemas.xmlsoap.org/soap/http"/>
      > > <wsdl:operation name="getTestURL">
      > > <wsdlsoap:operation soapAction=""/>
      > > <wsdl:input name="getTestURLRequest">
      > > <wsdlsoap:body
      > >
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > >
      > >
      > namespace="http:/www.site.ru/namespace/Site/Web/Test"
      > > use="encoded"/>
      > > <wsdlsoap:header
      > >
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > >
      > > message="impl:getTestURLRequest"
      > >
      > namespace="http:/www.site.ru/namespace/Site/Web/Test"
      > >
      > > part="userContext" use="encoded">
      > > </wsdlsoap:header>
      > > </wsdl:input>
      > > <wsdl:output name="getTestURLResponse">
      > > <wsdlsoap:body
      > >
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > >
      > >
      > namespace="http:/www.site.ru/namespace/Site/Web/Test"
      > > use="encoded"/>
      > > </wsdl:output>
      > > <wsdl:fault name="TestException">
      > > <wsdlsoap:fault
      > >
      > encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > >
      > > name="TestException"
      > >
      > namespace="http:/www.site.ru/namespace/Site/Web/Test"
      > > use="encoded"/>
      > > </wsdl:fault>
      > > </wsdl:operation>
      > > </wsdl:binding>
      > > <wsdl:service name="TestService">
      > > <wsdl:port binding="impl:TestSoapBinding"
      > > name="Test">
      > > <wsdlsoap:address
      > > location="http://localhost:5080/web/services/Test"/>
      > > </wsdl:port>
      > > </wsdl:service>
      > > </wsdl:definitions>
      > >
      > >
      > >
      > >
      > >
      > >
      >
      >
      >
      >
      >
      > __________________________________
      > Yahoo! Mail - PC Magazine Editors' Choice 2005
      > http://mail.yahoo.com
      >







      -----------------------------------------------------------------
      This group is a forum for builders of SOAP implementations to discuss
      implementation and interoperability issues. Please stay on-topic.
      Yahoo! Groups Links
    • Show all 5 messages in this topic