2009-12-17 11 views
6

से कॉल करते समय जटिल जटिल प्रकार के तत्व कभी भी पॉप्युलेट नहीं होते हैं। मैं अपने कोल्डफ्यूजन-आधारित द्वारा प्रदान किए गए वेब सर्वर के साथ पूरी तरह से काम कर रहे .NET क्लाइंट को प्राप्त करने के लिए कुछ दिनों के लिए प्रयास कर रहा हूं। वेब अप्प। मैं एक .NET डेवलपर नहीं हूं, लेकिन मेरे पास वीएस 2003 की एक प्रति है, जो ऐसा लगता है कि यह चाल चलाना चाहिए।नेक्सड-आधारित वेब सेवा को .NET

मैं अपनी वेब सेवा में एक साधारण गुणक() विधि का उपयोग कर सकता हूं जो दो संख्याएं लेता है और एक संख्या देता है, इसलिए सरल प्रकार ठीक काम कर रहे हैं। यह जटिल प्रकार है जो मुझे मार रहे हैं। मैं मूल रूप से get_struct() नामक विधि से एक सहयोगी सरणी वापस करने की कोशिश कर रहा हूं। मुझे मैप बैक टाइप करने का ऑब्जेक्ट मिलता है, लेकिन संपत्ति (आइटम कहा जाता है), जिसे दो तत्वों (टाइप मैपइटम के प्रकार) के साथ एक सरणी माना जाता है, हमेशा एक "अपरिभाषित मान" होता है।

यहाँ डबल्यूएसडीएल कि ColdFusion द्वारा उत्पन्न होता है है:

<?xml version="1.0" encoding="UTF-8"?> 
<wsdl:definitions targetNamespace="http://trunk.v.pfapi.remote_api" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://trunk.v.pfapi.remote_api" xmlns:intf="http://trunk.v.pfapi.remote_api" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://rpc.xml.coldfusion" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
<!--WSDL created by Macromedia ColdFusion MX version 7,0,2,142559--> 
<wsdl:types> 
    <schema targetNamespace="http://rpc.xml.coldfusion" xmlns="http://www.w3.org/2001/XMLSchema"> 
    <import namespace="http://trunk.v.pfapi.remote_api"/> 
    <import namespace="http://xml.apache.org/xml-soap"/> 
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> 
    <complexType name="CFCInvocationException"> 
    <sequence/> 
    </complexType> 
    <complexType name="QueryBean"> 
    <sequence> 
    <element name="columnList" nillable="true" type="impl:ArrayOf_xsd_string"/> 
    <element name="data" nillable="true" type="impl:ArrayOfArrayOf_xsd_anyType"/> 
    </sequence> 
    </complexType> 
    </schema> 
    <schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema"> 
    <import namespace="http://trunk.v.pfapi.remote_api"/> 
    <import namespace="http://rpc.xml.coldfusion"/> 
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> 
    <complexType name="mapItem"> 
    <sequence> 
    <element name="key" nillable="true" type="xsd:anyType"/> 
    <element name="value" nillable="true" type="xsd:anyType"/> 
    </sequence> 
    </complexType> 
    <complexType name="Map"> 
    <sequence> 
    <element maxOccurs="unbounded" minOccurs="0" name="item" type="apachesoap:mapItem"/> 
    </sequence> 
    </complexType> 
    </schema> 
    <schema targetNamespace="http://trunk.v.pfapi.remote_api" xmlns="http://www.w3.org/2001/XMLSchema"> 
    <import namespace="http://rpc.xml.coldfusion"/> 
    <import namespace="http://xml.apache.org/xml-soap"/> 
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> 
    <complexType name="ArrayOf_xsd_string"> 
    <complexContent> 
    <restriction base="soapenc:Array"> 
     <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/> 
    </restriction> 
    </complexContent> 
    </complexType> 
    <complexType name="ArrayOfArrayOf_xsd_anyType"> 
    <complexContent> 
    <restriction base="soapenc:Array"> 
     <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[][]"/> 
    </restriction> 
    </complexContent> 
    </complexType> 
    </schema> 
</wsdl:types> 
    <wsdl:message name="CFCInvocationException"> 
     <wsdl:part name="fault" type="tns1:CFCInvocationException"/> 
    </wsdl:message> 
    <wsdl:message name="multiplierResponse"> 
     <wsdl:part name="multiplierReturn" type="xsd:double"/> 
    </wsdl:message> 
    <wsdl:message name="get_structResponse"> 
     <wsdl:part name="get_structReturn" type="apachesoap:Map"/> 
    </wsdl:message> 
    <wsdl:message name="struct_keycountResponse"> 
     <wsdl:part name="struct_keycountReturn" type="xsd:double"/> 
    </wsdl:message> 
    <wsdl:message name="get_structRequest"> 
    </wsdl:message> 
    <wsdl:message name="multiplierRequest"> 
     <wsdl:part name="factor1" type="xsd:double"/> 
     <wsdl:part name="factor2" type="xsd:double"/> </wsdl:message> 
    <wsdl:message name="struct_keycountRequest"> 
     <wsdl:part name="theStruct" type="apachesoap:Map"/> 
    </wsdl:message> 
    <wsdl:portType name="remote_io_test"> 
     <wsdl:operation name="multiplier" parameterOrder="factor1 factor2"> 
     <wsdl:input message="impl:multiplierRequest" name="multiplierRequest"/> 
     <wsdl:output message="impl:multiplierResponse" name="multiplierResponse"/> 
     <wsdl:fault message="impl:CFCInvocationException" name="CFCInvocationException"/> 
     </wsdl:operation> 
     <wsdl:operation name="get_struct"> 
     <wsdl:input message="impl:get_structRequest" name="get_structRequest"/> 
     <wsdl:output message="impl:get_structResponse" name="get_structResponse"/> 
     <wsdl:fault message="impl:CFCInvocationException" name="CFCInvocationException"/> 
     </wsdl:operation> 
     <wsdl:operation name="struct_keycount" parameterOrder="theStruct"> 
     <wsdl:input message="impl:struct_keycountRequest" name="struct_keycountRequest"/> 
     <wsdl:output message="impl:struct_keycountResponse" name="struct_keycountResponse"/> 
     <wsdl:fault message="impl:CFCInvocationException" name="CFCInvocationException"/> 
     </wsdl:operation> 
    </wsdl:portType> 
    <wsdl:binding name="remote_io_test.cfcSoapBinding" type="impl:remote_io_test"> 
     <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> 
     <wsdl:operation name="multiplier"> 
     <wsdlsoap:operation soapAction=""/> 
     <wsdl:input name="multiplierRequest"> 
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://trunk.v.pfapi.remote_api" use="encoded"/> 
     </wsdl:input> 
     <wsdl:output name="multiplierResponse"> 
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://trunk.v.pfapi.remote_api" use="encoded"/> 
     </wsdl:output> 
     <wsdl:fault name="CFCInvocationException"> 
      <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="CFCInvocationException" namespace="http://trunk.v.pfapi.remote_api" use="encoded"/> 
     </wsdl:fault> 
     </wsdl:operation> 
     <wsdl:operation name="get_struct"> 
     <wsdlsoap:operation soapAction=""/> 
     <wsdl:input name="get_structRequest"> 
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://trunk.v.pfapi.remote_api" use="encoded"/> 
     </wsdl:input> 
     <wsdl:output name="get_structResponse"> 
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://trunk.v.pfapi.remote_api" use="encoded"/> 
     </wsdl:output> 
     <wsdl:fault name="CFCInvocationException"> 
      <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="CFCInvocationException" namespace="http://trunk.v.pfapi.remote_api" use="encoded"/> 
     </wsdl:fault> 
     </wsdl:operation> 
     <wsdl:operation name="struct_keycount"> 
     <wsdlsoap:operation soapAction=""/> 
     <wsdl:input name="struct_keycountRequest"> 
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://trunk.v.pfapi.remote_api" use="encoded"/> 
     </wsdl:input> 
     <wsdl:output name="struct_keycountResponse"> 
      <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://trunk.v.pfapi.remote_api" use="encoded"/> 
     </wsdl:output> 
     <wsdl:fault name="CFCInvocationException"> 
      <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="CFCInvocationException" namespace="http://trunk.v.pfapi.remote_api" use="encoded"/> 
     </wsdl:fault> 
     </wsdl:operation> 
    </wsdl:binding> 
    <wsdl:service name="remote_io_testService"> 
    <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> 
This is a collection of test methods to allow remote developers 
    to evaluate datatype support, etc in their programming environment. 
    The WSDL endpoint for this web service is [YOUR PEERFOCUS SITE]/remote_api/pfapi/v/trunk/remote_io_test.cfc?wsdl </wsdl:documentation> 
     <wsdl:port binding="impl:remote_io_test.cfcSoapBinding" name="remote_io_test.cfc"> 
     <wsdlsoap:address location="http://leon.cupahr.tafkan.localhost/remote_api/pfapi/v/trunk/remote_io_test.cfc"/> 
     </wsdl:port> 
    </wsdl:service> 
</wsdl:definitions> 

और यहाँ वेब सेवा उत्पन्न जब मैं वी.एस. में एक वेब संदर्भ जोड़ने के ठूंठ है:

//------------------------------------------------------------------------------ 
// <autogenerated> 
//  This code was generated by a tool. 
//  Runtime Version: 1.1.4322.2443 
// 
//  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 Microsoft.VSDesigner, Version 1.1.4322.2443. 
// 
namespace pfapi_test.remote_io_test { 
    using System.Diagnostics; 
    using System.Xml.Serialization; 
    using System; 
    using System.Web.Services.Protocols; 
    using System.ComponentModel; 
    using System.Web.Services; 


    /// <remarks/> 
    [System.Diagnostics.DebuggerStepThroughAttribute()] 
    [System.ComponentModel.DesignerCategoryAttribute("code")] 
    [System.Web.Services.WebServiceBindingAttribute(Name="remote_io_test.cfcSoapBinding", Namespace="http://trunk.v.pfapi.remote_api")] 
    [System.Xml.Serialization.SoapIncludeAttribute(typeof(QueryBean))] 
    [System.Xml.Serialization.SoapIncludeAttribute(typeof(CFCInvocationException))] 
    public class remote_io_testService : System.Web.Services.Protocols.SoapHttpClientProtocol { 

     /// <remarks/> 
     public remote_io_testService() { 
      this.Url = "http://leon.cupahr.tafkan.nooch/remote_api/pfapi/v/trunk/remote_io_test.cfc"; 
     } 

     /// <remarks/> 
     [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://trunk.v.pfapi.remote_api", ResponseNamespace="http://trunk.v.pfapi.remote_api")] 
     [return: System.Xml.Serialization.SoapElementAttribute("multiplierReturn")] 
     public System.Double multiplier(System.Double factor1, System.Double factor2) { 
      object[] results = this.Invoke("multiplier", new object[] { 
         factor1, 
         factor2}); 
      return ((System.Double)(results[0])); 
     } 

     /// <remarks/> 
     public System.IAsyncResult Beginmultiplier(System.Double factor1, System.Double factor2, System.AsyncCallback callback, object asyncState) { 
      return this.BeginInvoke("multiplier", new object[] { 
         factor1, 
         factor2}, callback, asyncState); 
     } 

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

     /// <remarks/> 
     [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://trunk.v.pfapi.remote_api", ResponseNamespace="http://trunk.v.pfapi.remote_api")] 
     [return: System.Xml.Serialization.SoapElementAttribute("get_structReturn")] 
     public Map get_struct() { 
      object[] results = this.Invoke("get_struct", new object[0]); 
      return ((Map)(results[0])); 
     } 

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

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

     /// <remarks/> 
     [System.Web.Services.Protocols.SoapRpcMethodAttribute("", RequestNamespace="http://trunk.v.pfapi.remote_api", ResponseNamespace="http://trunk.v.pfapi.remote_api")] 
     [return: System.Xml.Serialization.SoapElementAttribute("struct_keycountReturn")] 
     public System.Double struct_keycount(Map theStruct) { 
      object[] results = this.Invoke("struct_keycount", new object[] { 
         theStruct}); 
      return ((System.Double)(results[0])); 
     } 

     /// <remarks/> 
     public System.IAsyncResult Beginstruct_keycount(Map theStruct, System.AsyncCallback callback, object asyncState) { 
      return this.BeginInvoke("struct_keycount", new object[] { 
         theStruct}, callback, asyncState); 
     } 

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

    /// <remarks/> 
    [System.Xml.Serialization.SoapTypeAttribute("Map", "http://xml.apache.org/xml-soap")] 
    public class Map { 

     /// <remarks/> 
     public mapItem[] item; 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.SoapTypeAttribute("mapItem", "http://xml.apache.org/xml-soap")] 
    public class mapItem { 

     /// <remarks/> 
     public object key; 

     /// <remarks/> 
     public object value; 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.SoapTypeAttribute("QueryBean", "http://rpc.xml.coldfusion")] 
    public class QueryBean { 

     /// <remarks/> 
     public string[] columnList; 

     /// <remarks/> 
     public object[] data; 
    } 

    /// <remarks/> 
    [System.Xml.Serialization.SoapTypeAttribute("CFCInvocationException", "http://rpc.xml.coldfusion")] 
    public class CFCInvocationException { 
    } 
} 

और अंत में, मेरी CLI अनुप्रयोग है कि सेवा का परीक्षण करता है:

using System; 

namespace pfapi_test 
{ 
/// <summary> 
/// Summary description for Class1. 
/// </summary> 
class Class1 
{ 
    /// <summary> 
    /// The main entry point for the application. 
    /// </summary> 
    [STAThread] 
    static void Main(string[] args) 
    { 
    // 
    // TODO: Add code to start application here 
    // 

    Console.WriteLine("Instantiating WS"); 

    remote_io_test.remote_io_testService testWS = new remote_io_test.remote_io_testService(); 

    Console.WriteLine("Calling multiplier(3,15)"); 
    Console.WriteLine(testWS.multiplier(3,15)); 

    Console.WriteLine("Calling get_struct()"); 
    remote_io_test.Map theStruct = testWS.get_struct(); 
    Console.Write("result: "); 
    Console.WriteLine(theStruct); 
    Console.Write("result.item: "); 
    Console.WriteLine(theStruct.item); 

    Console.WriteLine("Press Enter to exit..."); 
    Console.ReadLine(); 
    } 
} 
} 

कोई फर्क नहीं पड़ता कि मैं क्या प्रयास करता हूं ,Struct.item हमेशा "अनिश्चित है डीबगर के अनुसार "ined मूल्य"। मुद्रित आउटपुट लगता है:

Instantiating WS 
Calling multiplier(3,15) 
45 
Calling get_struct() 
result: pfapi_test.remote_io_test.Map 
result.item: 
Press Enter to exit... 

मैं ColdFusion 8 का उपयोग कर की कोशिश की है, और वहाँ कोई अंतर नहीं है। मैंने अपने विज्ञापन-प्रसार सहयोगी सरणी के बजाय दो गुणों के साथ एक वास्तविक कस्टम डेटाबेस लौटने का प्रयास किया है, और यह ठीक काम करता है, लेकिन सहयोगी सरणी से बचने के लिए मेरे एपीआई को फिर से लिखना वास्तव में एक विकल्प नहीं है। एपीआई कोल्डफ्यूजन, PHP/NuSOAP, और रेल पर रूबी के साथ ठीक काम करता है, इसलिए ऐसा लगता है कि इसे .NET के साथ भी काम करना संभव होना चाहिए।

मुझे आशा है कि कोई व्यक्ति कुछ अंतर्दृष्टि प्रदान कर सकता है। मुझे संदेह है कि यहां कुछ प्रकार का नेमस्पेस मुद्दा है, लेकिन मुझे यह पता लगाने के लिए एसओएपी और एक्सएमएल पर्याप्त नहीं है कि यह क्या है। मैंने ऑनलाइन समाधान के लिए पागल की तरह भी खोज की है, लेकिन मुझे एक भी व्यक्ति नहीं मिला है जिसने इस समस्या को हल किया है, जो बहुत निराशाजनक है!

अनुरोध:

POST /remote_api/pfapi/v/trunk/remote_io_test.cfc HTTP/1.1 
VsDebuggerCausalityData: [snip] 
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.2443) 
Content-Type: text/xml; charset=utf-8 
SOAPAction: "" 
Content-Length: 488 
Expect: 100-continue 
Host: leon.cupahr.tafkan.nooch 

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://trunk.v.pfapi.remote_api" xmlns:types="http://trunk.v.pfapi.remote_api/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
    <tns:get_struct /> 
    </soap:Body> 
</soap:Envelope> 

प्रतिक्रिया:

HTTP/1.1 200 OK 
Date: Thu, 17 Dec 2009 15:14:33 GMT 
Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.7l DAV/2 PHP/5.2.8 JRun/4.0 Phusion_Passenger/2.2.7 
Set-Cookie: CFID=21543;expires=Sat, 10-Dec-2039 15:14:33 GMT;path=/ 
Set-Cookie: CFTOKEN=479cc311ca4875db-9D346355-ED36-6183-C8895635E4EE1252;expires=Sat, 10-Dec-2039 15:14:33 GMT;path=/ 
Transfer-Encoding: chunked 
Content-Type: text/xml; charset=utf-8 

<?xml version="1.0" encoding="utf-8"?> 
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<soapenv:Body> 
    <ns1:get_structResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://trunk.v.pfapi.remote_api"> 
    <get_structReturn xsi:type="ns2:Map" xmlns:ns2="http://xml.apache.org/xml-soap"> 
    <item xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> 
    <key xsi:type="soapenc:string">FOO</key> 
    <value xsi:type="soapenc:string">bar</value> 
    </item> 
    <item> 
    <key xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">ANOTHERKEY</key> 
    <value xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">another value</value> 
    </item> 
    </get_structReturn> 
    </ns1:get_structResponse> 
</soapenv:Body> 
</soapenv:Envelope> 

अद्यतन: मैं दूसरे छोर पर नेट डेवलपर की ओर से सुना है, और वह कोई लाभ नहीं हुआ निम्न में से सभी की कोशिश की है:

  • ASMX
  • के बजाय WETF का उपयोग करते हुए .NET 3.5
  • VB.NET का उपयोग कर सी #

के बजाय वेब सेवा के साथ संवाद करने उसने मुझे सेवा संदर्भ सेटिंग संवाद के "डेटा प्रकार" अनुभाग का स्क्रीनशॉट भेजें था। क्या यह संभव है कि संग्रह प्रकार और शब्दकोश संग्रह प्रकार के लिए सेटिंग्स को बदलने से इस समस्या का समाधान हो सकता है?

अद्यतन 2: यहां दूरस्थ_io_test के लिए कोल्डफ्यूजन कोड है।सीएफसी

<cfcomponent name="remote_io_test" 
    hint="This is a collection of test methods to allow remote developers 
     to evaluate datatype support, etc in their programming environment."> 

<cffunction name="get_struct" returntype="struct" access="remote" output="no" 
     hint="Returns an associative array with two keys, 'foo' and 'anotherKey'. 
      Allows you to test your implementation's support for WDDX encoding. 
      ColdFusion and PHP (w/ NuSOAP) will automatically decode the result 
      into an associative array. Feedback on other languages is appreciated."> 
    <cfset var stFoo = structNew()> 
    <cfset stFoo.foo = "bar"> 
    <cfset stFoo.anotherKey = "another value"> 
    <cfreturn duplicate(stFoo)> 
</cffunction> <!--- get_struct ---> 


<cffunction name="multiplier" returntype="numeric" access="remote" output="no" 
     hint="Multiplies two factors and returns the result. Allows you to test 
      passing simple variables to a remote method."> 
    <cfargument name="factor1" type="numeric" required="yes"> 
    <cfargument name="factor2" type="numeric" required="yes"> 

    <cfreturn factor1 * factor2> 
</cffunction> <!--- multiplier ---> 


<cffunction name="struct_keycount" returntype="numeric" access="remote" output="no" 
     hint="Returns the number of keys in an upload associative array. Allows 
      you to test passing complex variables to a remote method."> 
    <cfargument name="theStruct" type="struct" required="yes"> 

    <cfreturn structCount(theStruct)> 
</cffunction> <!--- struct_keycount ---> 

अपने उत्तर के लिए पहले से पढ़ने के लिए

धन्यवाद, और धन्यवाद! link text

+0

आप अगर निर्धारित किया है यह एक सर्वर या ग्राहक मुद्दा है? (क्या कोई अन्य सॉफ़्टवेयर क्लाइंट सफलतापूर्वक get_struct() को कॉल कर रहे हैं?) –

+0

क्या आप एक सरल स्टैंड जोड़ सकते हैं अकेले कोल्डफ्यूजन कोड का उदाहरण आपका .net ऐप बार्फ़िंग कर रहा है ताकि हम में से कुछ इसका परीक्षण कर सकें? – kevink

+0

@ डैन सोरेनसेन, प्रश्न के लिए धन्यवाद। मेरे पास रेलवे क्लाइंट्स पर कोल्डफ्यूजन, पीएचपी और रूबी सफलतापूर्वक मेरे असली एपीआई में structs भेज और प्राप्त कर रहा है। जब यह एपीआई के साथ शुरू हो रहा है तो यह वेब सेवा इंटरऑपरेबिलिटी परीक्षण के लिए है। – sbleon

उत्तर

1

उत्तर है: अपनी वेब सेवा में कोल्डफ्यूजन structs का उपयोग न करें।

हमारे सामने हर किसी की तरह, हमने अनुरोध या प्रतिक्रिया में किसी भी सहयोगी सरणी का उपयोग न करने के लिए हमारे एपीआई को छोड़ दिया और फिर से लिखा। अब हम स्केलर, सरणी और जटिल टाइप्स का उपयोग कर रहे हैं जो स्वचालित रूप से सीएफसी से बनाए जाते हैं। इस बार, हमने यह सुनिश्चित करने के लिए PHP, रूबी, कोल्डफ्यूजन, जावा और .NET के साथ हमारे प्रमाण-अवधारणा का परीक्षण किया, यह वास्तव में अंतःक्रियात्मक था।

यह अब बहुत समझ में आता है कि एक स्थैतिक रूप से टाइप की गई भाषा किसी भी समझदार तरीके से पूरी तरह मनमानी दूरस्थ डेटाटाइप को संभालने में असमर्थ होगी।

आपकी सभी प्रतिक्रियाओं के लिए धन्यवाद!

2

पर

पार तैनात मैं इस आइटम के साथ अपने आप चीजों की नेट ग्राहक की ओर से संघर्ष कर रहा है - मैं एक वेब सेवा ColdFusion में लिखा उपभोग करने के लिए कोशिश कर रहा हूँ। मैंने पाया दस्तावेज से, कोल्डफ्यूजन में संरचना डेटा प्रकार सीधे किसी भी वेब सेवा प्रकार पर मैप नहीं करता है, और ऐसा लगता है कि यह एक्सिस के साथ एक गलती है।

आपने शायद इस समस्या को हल करने का प्रयास करते समय वही वेब पेज पढ़े हैं, लेकिन ऐसा लगता है कि यदि आप कोल्डफ्यूजन का उपयोग करके एक वेब सेवा बनाना चाहते हैं, तो सिफारिश संरचना प्रकार का उपयोग नहीं करना है। यदि आपकी वेब सेवा अभी तक लाइव नहीं है, और आप कुछ अलग उपयोग करने से दूर हो सकते हैं, तो मैं इस मार्ग पर जाने का सुझाव दूंगा। मैंने कोल्डफ्यूजन से ऑब्जेक्ट्स लौटने की कोशिश की, जिसने मेरे लिए .NET क्लाइंट से ठीक काम किया।

मैंने वास्तव में इस समस्या को छोड़ दिया और मेरे .NET प्रोग्राम के लिए एक कस्टम क्लाइंट लिखा जो कि कोल्डफ्यूजन वेब सेवा द्वारा लौटाए गए एक्सएमएल को पढ़ेगा और इसे एक शब्दकोश में परिवर्तित करेगा, क्योंकि मेरे पास सेवा पर कोई प्रभाव नहीं है कॉल करने की कोशिश कर रहा है।

एक परीक्षण जो मैंने अपने परीक्षण के दौरान पाया - सेवा जिसे मैं कॉल करने का प्रयास कर रहा हूं वह कोल्डफ्यूजन (7 मुझे विश्वास है) के पुराने संस्करण पर चल रहा है। जब भी मैं उस सेवा को कॉल करता हूं, .NET क्लाइंट शून्य लौटाता है। मैंने अपनी मशीन पर कोल्डफ्यूजन स्थापित किया और एक सरल सेवा लिखी, और पाया कि .NET क्लाइंट ने टाइप मैप (जो डब्ल्यूएसडीएल से आया था) का एक ऑब्जेक्ट लौटाया, लेकिन मानचित्र ऑब्जेक्ट के गुण सभी शून्य थे।

मुझे यह देखने में दिलचस्पी होगी कि क्या रॉट हास का सुझाव dotNetSoapEncFix को स्थापित करने के आपके प्रश्न पर टिप्पणियों में सुझाव समस्या हल करता है।

+0

धन्यवाद, रिचर्ड। मैं अपने विकल्पों को देख रहा हूं। मुझे लगता है कि मुझे अपने एपीआई के लिए एक स्ट्रिंग-आधारित प्रारूप (एक्सएमएल या जेएसओएन) के साथ जाना होगा। जटिल डेटा प्रकारों से जुड़े किसी भी समाधान में केवल परेशानी की मांग है जब हम ढीले/दृढ़ता से टाइप की गई भाषा विभाजन को पुल करने की कोशिश कर रहे हैं। – sbleon

+0

एक्सिस 1.2 दस्तावेज को देखते हुए, वे कहते हैं कि हैंशटेबल (यानी सीएफ संरचनाएं) विशेष रूप से .NET के साथ http://ws.apache.org/axis/java/user-guide.html#WhatAxisCanSendViaSOAPWithRestrictedInteroperability – Leigh

0

अपने समस्या का समाधान नहीं है और यह यहाँ है:

http://ws-i.org/Profiles/BasicProfile-2.0-2010-11-09.html#soapenc_Array

http://ws-i.org/Profiles/BasicProfile-1.2-2010-11-09.html#soapenc_Array

आपकी समस्या यहां देता है सटीक होना करने के लिए:

<complexType name="ArrayOf_xsd_string"> 
    <complexContent> 
    <restriction base="soapenc:Array"> 
     <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/> 
    </restriction> 
    </complexContent> 
    </complexType> 
    <complexType name="ArrayOfArrayOf_xsd_anyType"> 
    <complexContent> 
    <restriction base="soapenc:Array"> 
     <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[][]"/> 
    </restriction> 
    </complexContent> 
    </complexType> 

वैसे ही जैसे उन प्रकार को फिर से परिभाषित यह:

<element name="ArrayOf_xsd_string" type="tns:OnlyStringArrayType"/> 
<complexType name="OnlyStringArrayType"> 
    <sequence> 
    <element name="array_element" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> 
    </sequence> 
</complexType> 
<element name="ArrayOfArrayOf_xsd_anyType" type="tns:AnyTypeArrayType"/> 
<complexType name="AnyTypeArrayType"> 
    <sequence> 
    <element name="array_element" type="xsd:anyType" minOccurs="0" maxOccurs="unbounded"/> 
    </sequence> 
</complexType> 

यह अभी भी तत्व नामों के कारण उपरोक्त वर्णित डब्ल्यूएस-आई प्रोफाइल के अनुरूप नहीं है, लेकिन ग्राहकों और कक्षा फ़ाइल जेनरेटर द्वारा प्रक्रिया करना बहुत आसान होना चाहिए।

मैं जो दूसरों को इस समस्या :)

पर और जिस तरह से WSDL और साबुन से ठोकर होगा के लिए इस समाधान में लिखा था यह .... में एक एक बड़ा दर्द है;)

+0

Pawel, धन्यवाद उत्तर के लिए मुझे लगता है कि यह "मानचित्र" प्रकार था जो वास्तव में मुझे समस्याएं दे रहा था। तारों की Arrays वास्तव में मेरे लिए एक समाधान नहीं था क्योंकि मुझे घोंसला जटिल डेटा भेजने की जरूरत थी। किसी भी मामले में, हमारे .NET क्लाइंट अब हमारे नए एपीआई संस्करण का उपयोग कर रहे हैं जो सहयोगी क्षेत्रों के उपयोग को पूर्ववत करता है। – sbleon

संबंधित मुद्दे