I'm new to WS.   I've been reading a lot and prototyping but having
tremendous difficulty in successfully executing a simple Axis2 Web
service from a ASP.NET client.

My goal is to have ASP.NET client utilize a Web Service proxy (C#) to
call Axis2 (v1.1.1) hosted WebServices on Tomcat (v5.5.16).   For the
sake of getting started quickly, I went from the bottom up with a
Javabean.  The generated WSDL/services.xml file seemed to worked fine
(deployed .aar) and running a simple REST request against it. 

However the WSDL was not sufficient or did not work right when adding a
'Web Reference' in Visual Studio.  To make a long story short, I tried a
VS generated WSDL from a C# WebService (equivalent to the Javabean
hosted in AXIS2).  I used that WSDL when packaging the .aar file (under
meta-inf as prescribed) with the Java .class.   I validated the WSDL
(v1.1) with XMLSpy.   I get further.   I'm running soapUI to check my WS
call over SOAP.   All I can say - it's all in the WSDL.   It takes a
while.   

However, I still have a disconnect somewhere on the client side.
Somehow I missing the Operation in my End Point Reference.  Is this
coming from the client side generation in .NET, or in a poorly formated
WSDL?  In soapUI - if I manually add the operation /sayHello to the EPR,
I see it work.    Running the ASP page I get this error message below:

Help is extremely appreciative.  Thanks in advance.   If you need more
info, please let me know.    
Ken

Fault Error:

Operation Not found EPR is
http://wstm0164715.develop.ubsw.net:7003/axis2/services/HelloService and
WSA Action =
http://wstm0164715.develop.ubsw.net:7003/axis2/services/HelloService/say
Hello 

Java Class:

public class Hello {
   public String sayHello(String sParameterIn) {
           if (sParameterIn != null && sParameterIn.length() > 0) return
"Hello " + sParameterIn;
           else
                   return "Hello anonymous";
   }
}

Snippet C# Client:

<script language="C#" runat="server">

  string name = "";

  public void Submit_Click(Object sender, EventArgs E) {
      try {
        name = Name.Text;   // Name is a textbox
      }
      catch (Exception) { /* ignored */ }

      HelloService.HelloService service  = new
HelloService.HelloService();    // my App Web Reference 
      HelloService.sayHelloInput helloIn = new
HelloService.sayHelloInput();

      // source the parameter from the form field      
      helloIn.sParameterIn = name;

      switch (((Control)sender).ID) {
            case "echoName":
                {
                    // call the WS                    
                    HelloService.sayHelloResponse helloOut = new
HelloService.sayHelloResponse();
                    helloOut = service.sayHello(helloIn);
                    Result.Text = "<b>Result</b> = " +
([EMAIL PROTECTED]);
                    break;
                }
        }
  }

My WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
xmlns:tns="http://ubs.com/gcs/HelloService/";
targetNamespace="http://ubs.com/gcs/HelloService/";>
        <wsdl:types>
                <xs:schema elementFormDefault="qualified"
targetNamespace="http://ubs.com/gcs/HelloService/";>
                        <xs:element name="sayHelloInput">
                                <xs:complexType>
                                        <xs:sequence>
                                                <xs:element
name="sParameterIn" nillable="true" type="xs:string"/>
                                        </xs:sequence>
                                </xs:complexType>
                        </xs:element>
                        <xs:element name="sayHelloResponse">
                                <xs:complexType>
                                        <xs:sequence>
                                                <xs:element
name="return" nillable="true" type="xs:string"/>
                                        </xs:sequence>
                                </xs:complexType>
                        </xs:element>
                </xs:schema>
        </wsdl:types>
        <wsdl:message name="sayHelloMessageIn">
                <wsdl:part name="part1" element="tns:sayHelloInput"/>
        </wsdl:message>
        <wsdl:message name="sayHelloMessageOut">
                <wsdl:part name="part1" element="tns:sayHelloResponse"/>
        </wsdl:message>
        <wsdl:portType name="HelloServicePortType">
                <wsdl:operation name="sayHello">
                        <wsdl:input message="tns:sayHelloMessageIn"/>
                        <wsdl:output message="tns:sayHelloMessageOut"/>
                </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="HelloServiceBindingSoap"
type="tns:HelloServicePortType">
                <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
                <wsdl:operation name="sayHello">
                        <soap:operation
soapAction="http://wstm0164715.develop.ubsw.net:7003/axis2/services/Hell
oService/sayHello" style="document"/>
                        <wsdl:input>
                                <soap:body use="literal"/>
                        </wsdl:input>
                        <wsdl:output>
                                <soap:body use="literal"/>
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="HelloService">
                <wsdl:port name="HelloServicePortSoap"
binding="tns:HelloServiceBindingSoap">
                        <soap:address
location="http://wstm0164715.develop.ubsw.net:7003/axis2/services/HelloS
ervice"/>
                </wsdl:port>
        </wsdl:service>
</wsdl:definitions>

services.xml
</serviceGroup>
<service name="HelloService" scope="application"
targetNamespace="http://wstm0164715.develop.ubsw.net:7003/";>
    <description>
        Sample Hello Service
    </description>
    <messageReceivers>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only";
 
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out";
 
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
    </messageReceivers>
    <schema
schemaNamespace="http://wstm0164715.develop.ubsw.net:7003/axis2/xsd"/>
    <parameter
name="ServiceClass">com.ubs.gcs.sample.services.Hello</parameter>
</service>
</serviceGroup>

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to