试图在Coldfusion 10中使用.Net webservice,wdsl给我带来了麻烦

时间:2015-02-14 07:55:30

标签: coldfusion wsdl webservices-client

自1999年以来,我一直是一名冷血开发人员,但在过去的几年里,我一直在与其他技术合作。 最近我被要求实施一个网络服务的客户端,允许人们在批发仓库订购药剂师药品。

可在此处找到完整的服务说明: http://services.bitler.be/GenericServices/OrderProcessingService.svc?singleWsdl

我认为消费客户的相关部分是以下部分,但如果我遗漏了任何内容,请随时查看完整说明:

  • 功能:<wsdl:operation name="ProcessOrder">
  • 预期参数:
<xs:complexType name="OrderProcessingRequest">
<xs:complexContent mixed="false">
<xs:extension .... base="q1:RequestBase">
<xs:sequence>
<xs:element minOccurs="0" name="CustomerEmail" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="ProcessOrderLines" nillable="true" type="tns:ArrayOfProcessOrderLine"/>
<xs:element ... minOccurs="0" name="Site" type="q2:FebelcoSite"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="OrderProcessingRequest" nillable="true" type="tns:OrderProcessingRequest"/>
<xs:complexType name="ArrayOfProcessOrderLine">
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" name="ProcessOrderLine" nillable="true" type="tns:ProcessOrderLine"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ArrayOfProcessOrderLine" nillable="true" type="tns:ArrayOfProcessOrderLine"/>
<xs:complexType name="ProcessOrderLine">
<xs:sequence>
<xs:element minOccurs="0" name="ProductNumber" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="QuantityRequested" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:element name="ProcessOrderLine" nillable="true" type="tns:ProcessOrderLine"/>

<xs:complexType name="RequestBase">
<xs:sequence>
<xs:element minOccurs="0" name="ApbNumber" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="BSKey" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="WholesalerId" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:element name="RequestBase" nillable="true" type="tns:RequestBase"/>

这是我到目前为止所提出的:

cffunction name="placeOrder" access="remote" returntype="any">
    <cfargument name="apbnr" required="yes" type="string">
    <cfargument name="bskey" required="yes" type="string">
    <cfargument name="cnk" required="yes" type="string">
    <cfargument name="quantity" required="yes" type="string">
    <cfargument name="site" required="yes" type="string">
    <cfscript>
        orderProcessingRequest = StructNew();
        orderProcessingRequest.apb = apbnr;
        orderProcessingRequest.bskey = bskey;
        orderProcessingRequest.vestiging = site;
        productOrderLines = ArrayNew(1);
        productOrderLine = StructNew();
        productOrderLine.cnk = cnk;
        productOrderLine.quantity = quantity;
        productOrderLines[1] = productOrderLine;
        orderProcessingRequest.productOrderLines = productOrderLines;
        ws = CreateObject("webservice", "http://testservices.bitler.be/GenericServices/OrderProcessingService.svc?singleWsdl" );
        newOrder = ws.ProcessOrder(orderProcessingRequest); 
        writeoutput(newOrder);      
    </cfscript>             
</cffunction>

但它一直在我调用函数的行中抛出错误。 我怀疑我在“orderProcessingRequest”中有错误,但老实说我无法弄清楚在哪里。

Cannot perform web service invocation ProcessOrder.
The fault returned when invoking the web service operation is:

org.apache.axis2.AxisFault: There was an error while requesting your data. Please contact Bitler support with error ref (O150214084734).
    at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
    at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375)
    at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
    at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
    at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
    at org.tempuri.OrderProcessingServiceStub.processOrder(OrderProcessingServiceStub.java:193)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at coldfusion.xml.rpc.Axis2ServiceProxy.... ''


The error occurred in C:/ColdFusion10/cfusion/wwwroot/_cfc/febelco.cfc: line 43

41 :                orderProcessingRequest.productOrderLines = productOrderLines;
42 :                ws = CreateObject("webservice", "http://testservices.bitler.be/GenericServices/OrderProcessingService.svc?singleWsdl" ); //, { refreshWSDL=true, wsversion=1 } 
43 :                newOrder = ws.ProcessOrder(orderProcessingRequest); 
44 :                writeoutput(newOrder);      
45 :            </cfscript>             

此致 尔根

1 个答案:

答案 0 :(得分:0)

最近我从CF 9转到CF 10后遇到了一些web服务问题。我们通过HTTPS连接到web服务,所以我们必须将它的SSL证书导入JVM(与你无关)我看到您通过HTTP使用Web服务并使用{wsversion="1",refreshwsdl="true"}

尝试从

更改时会发生什么

ws = CreateObject("webservice", "http://testservices.bitler.be/GenericServices/OrderProcessingService.svc?singleWsdl" ); //, { refreshWSDL=true, wsversion=1 }

ws = CreateObject("webservice", "http://testservices.bitler.be/GenericServices/OrderProcessingService.svc?singleWsdl", { refreshWSDL=true, wsversion=1 } );