Hi Bill,
I used the document/literal in my .wsdl file and generated the stub/skel files using WSDL2Java
but when I try to invoke my service method iam getting the following error
 
AxisFault
 faultCode: {http://xml.apache.org/axis/}Client
 faultSubcode:
 faultString: No such operation 'iName'
 faultActor:
 faultNode:
 faultDetail:
 {http://xml.apache.org/axis/}hostname:BSD-GFA0094J
 
No such operation 'iName'
 at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:221)
 
My wsdl file:
<?xml version="1.0" ?>
<definitions name="urn:GetPO"
             targetNamespace="urn:GetPO"
             xmlns:tns="urn:GetPO"            
             xmlns:typens="urn:GetPO"                         
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
        xmlns:wbm="http://www.webmethods.com/2001/10/soap/encoding/"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:spc="http://schemas.xmlsoap.org/soap/encoding/">
 
  <!-- type defs -->
  <types>
       <xsd:schema targetNamespace="urn:GetPO"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema">               
 
      <xsd:complexType name="purchaseorder">
        <xsd:sequence>
      <xsd:element name="ItemName" type="xsd:string"/>       
         <xsd:element name="Quantity" type="xsd:int"/>       
   <xsd:element name="price" type="xsd:float"/>                
   <xsd:element name="currency" type="xsd:string"/>                         
        </xsd:sequence>
      </xsd:complexType> 
 
      <xsd:complexType name="confirmorder">
        <xsd:sequence>
      <xsd:element name="orderedItem" type="xsd:string"/>       
         <xsd:element name="Total" type="xsd:float"/>       
        </xsd:sequence>
      </xsd:complexType> 
    </xsd:schema>
  </types>
 
  <message name="empty"/>
 
  <message name="AddOrderRequest">
    <part name="iName" type="xsd:string"/>
    <part name="purchaseOrder" type="typens:purchaseorder"/>
  </message>
  <message name="GetOrderRequest">
    <part name="nameofitem" type="xsd:string"/>
  </message>
  <message name="GetOrderResponse">
   <part name="podetails" type="typens:purchaseorder"/>
  </message>
  <!-- port type declns -->
  <portType name="PurchaseOrderBook">
    <operation name="addEntry">
      <input message="tns:AddOrderRequest"/>
      <output message="tns:empty"/>
    </operation>
    <operation name="getOrder">
      <input message="tns:GetOrderRequest"/>
      <output message="tns:GetOrderResponse"/>
    </operation>
  </portType>
 
  <!-- binding declns -->
  <binding name="TestingNet" type="tns:PurchaseOrderBook">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="addEntry">
      <soap:operation soapAction="urn:GetPO/addEntry"/>
      <input>
        <soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
    </operation>
 
    <operation name="getOrder">
      <soap:operation soapAction="urn:GetPO/getOrder"/>
      <input>
        <soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
       </output>
    </operation>
  </binding>
 
  <!-- service decln -->
  <service name="POservice">
    <port name="GetPO" binding="tns:TestingNet" >
      <soap:address location="http://localhost:8080/axis/services/GetPO"/>
    </port>
  </service>
</definitions>
 
my deploy.wsdd
 
  <!-- Services from POservice WSDL service -->
 
  <service name="GetPO" provider="java:RPC" style="document" use="literal">
      <parameter name="wsdlTargetNamespace" value="urn:GetPO"/>
      <parameter name="wsdlServiceElement" value="POservice"/>
      <parameter name="wsdlServicePort" value="GetPO"/>
      <parameter name="className" value="GetPO.TestingNetSkeleton"/>
      <parameter name="wsdlPortType" value="PurchaseOrderBook"/>
      <parameter name="allowedMethods" value="*"/>
 
      <typeMapping
        xmlns:ns="urn:GetPO"
        qname="ns:purchaseorder"
        type="java:GetPO.Purchaseorder"
        serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
        deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
        encodingStyle=""
      />
  </service>
</deployment>
 
Any idea where iam going wrong..should I make changed to implementation classes
when i use document/literal...previously I was using rpc..
 
regards..
 
 
-----Original Message-----
From: Bill Keese [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 27, 2005 11:45 AM
To: [EMAIL PROTECTED]
Subject: Re: Using complex types Axis and .Net

You can do either document/literal or wrapped/literal.  The difference is that wrapped/literal includes the operation name in the XML message, like:

<soap:body>
  <GetOrderRequest>
    <name>foo</name>
  </GetOrderRequest>
</soap:body>

whereas document/literal doesn't:

<soap:body>
    <name>foo</name>
</soap:body>

Getting AXIS to do document/literal or wrapped/literal mode is tricky.  There are still lots of bugs.  However, at least for the purposes of testing you can change your WSDL file to be document/literal mode, and then see if .NET can "Add Web Reference".

Change your use="encoded" to use="literal", and style="rpc" to style="document", and erase the encodingStyle attributes.

Bill

Dhananjayan_K wrote:
Hi Bill,
I tried using xsd:sequence still the same problem occurs...
what's the other way I can go instead of using RPC/encoded...
-----Original Message-----
From: Bill Keese [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 27, 2005 11:17 AM
To: [EMAIL PROTECTED]
Subject: Re: Using complex types Axis and .Net

Using RPC/encoded with .NET is risky.  (Some people say it works; other people say it doesn't.)  Also, have you tried using xsd:sequence instead of xsd:all?

Bill

Dhananjayan_K wrote:
Hi,

I have a problem related to complex types in axis.

I have a webservice running on Axis, the webserice returns a complex type
"purchaseorder",
i am able to succesfully connect to the webservice from java client,
But when i try to add a "Add Web reference" from .Net iam not able to 
get the webservice instance.
Can you please help me in this regard...

wsdl file content...

<?xml version="1.0" ?>
<definitions name="urn:GetPO" targetNamespace="urn:GetPO"
xmlns:tns="urn:GetPO" xmlns:typens="urn:GetPO"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wbm="http://www.webmethods.
com/2001/10/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spc="http://schemas.xmlsoap.org/soap/encoding/">
  <!-- type defs -->
  <types>
       <xsd:schema targetNamespace="urn:GetPO"
                xmlns:xsd="http://www.w3.org/1999/XMLSchema">
                
      <xsd:complexType name="purchaseorder">
        <xsd:all>
		    <xsd:element name="ItemName" type="xsd:string"/>        
   		    <xsd:element name="Quantity" type="xsd:int"/>        
			<xsd:element name="price" type="xsd:float"/>

			<xsd:element name="currency" type="xsd:string"/>

        </xsd:all>
      </xsd:complexType>  
    </xsd:schema>
  </types>
  <message name="empty"/>
  <message name="GetOrderRequest">
    <part name="name" type="xsd:string"/>
  </message>
  <message name="GetOrderResponse">
   <part name="purchaseOrder" type="typens:purchaseorder"/> <!--Note: If I
change this to xsd:string then iam able to add the webreference in .Net)
  </message>
  <!-- port type declns -->
  <portType name="PurchaseOrderBook">
    <operation name="getOrder">
      <input message="tns:GetOrderRequest"/>
      <output message="tns:GetOrderResponse"/>
    </operation>
  </portType>
  <!-- binding declns -->
  <binding name="TestingNet" type="tns:PurchaseOrderBook">
    <soap:binding style="rpc"
                  transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="getOrder">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="encoded"
                   namespace="urn:GetPO"
 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="encoded"
                   namespace="urn:GetPO"
 
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
    </operation>
  </binding>
  <!-- service decln -->
  <service name="POservice">
    <port name="GetPO" binding="tns:TestingNet" >
      <soap:address location="http://localhost:8080/axis/services/GetPO"/>
    </port>
  </service>
</definitions>


Please help...thanks in advance...

regards,
Dhananjayan K
    


  

Reply via email to